ITK  6.0.0
Insight Toolkit
itkDerivativeImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkDerivativeImageFilter_h
19#define itkDerivativeImageFilter_h
20
22
23namespace itk
24{
49template <typename TInputImage, typename TOutputImage>
50class ITK_TEMPLATE_EXPORT DerivativeImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
51{
52public:
53 ITK_DISALLOW_COPY_AND_MOVE(DerivativeImageFilter);
54
60
63 using OutputPixelType = typename TOutputImage::PixelType;
64 using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
65 using InputPixelType = typename TInputImage::PixelType;
66 using InputInternalPixelType = typename TInputImage::InternalPixelType;
67
70 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
71
73 using InputImageType = TInputImage;
74 using OutputImageType = TOutputImage;
75
77 itkNewMacro(Self);
78
80 itkOverrideGetNameOfClassMacro(DerivativeImageFilter);
81
83#ifdef ITK_USE_CONCEPT_CHECKING
84 // Begin concept checking
85 itkConceptMacro(SignedOutputPixelType, (Concept::Signed<OutputPixelType>));
86 // End concept checking
87#endif
88
90 itkSetMacro(Order, unsigned int);
91 itkGetConstMacro(Order, unsigned int);
92 itkSetMacro(Direction, unsigned int);
93 itkGetConstMacro(Direction, unsigned int);
100 itkSetMacro(UseImageSpacing, bool);
101 itkGetConstMacro(UseImageSpacing, bool);
102 itkBooleanMacro(UseImageSpacing);
105#if !defined(ITK_FUTURE_LEGACY_REMOVE)
108 void
109 SetUseImageSpacingOn()
110 {
111 this->SetUseImageSpacing(true);
112 }
113
116 void
117 SetUseImageSpacingOff()
118 {
119 this->SetUseImageSpacing(false);
120 }
121#endif
122
130 void
132
133protected:
135 {
136 m_Order = 1;
137 m_Direction = 0;
138 m_UseImageSpacing = true;
139 }
140
141 ~DerivativeImageFilter() override = default;
142 void
143 PrintSelf(std::ostream & os, Indent indent) const override;
144
150 void
151 GenerateData() override;
152
153private:
155 unsigned int m_Order{};
156
158 unsigned int m_Direction{};
159
160 bool m_UseImageSpacing{};
161};
162} // end namespace itk
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "itkDerivativeImageFilter.hxx"
166#endif
167
168#endif
Computes the directional derivative of an image. The directional derivative at each pixel location is...
typename TInputImage::InternalPixelType InputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
void GenerateData() override
typename TInputImage::PixelType InputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
void GenerateInputRequestedRegion() override
typename TOutputImage::PixelType OutputPixelType
~DerivativeImageFilter() override=default
Base class for all process objects that output image data.
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....