ITK  5.4.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 
21 #include "itkImageToImageFilter.h"
22 
23 namespace itk
24 {
49 template <typename TInputImage, typename TOutputImage>
50 class ITK_TEMPLATE_EXPORT DerivativeImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
51 {
52 public:
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)
106 
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
131  GenerateInputRequestedRegion() override;
132 
133 protected:
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 
153 private:
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
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DerivativeImageFilter::DerivativeImageFilter
DerivativeImageFilter()
Definition: itkDerivativeImageFilter.h:134
itk::DerivativeImageFilter::OutputInternalPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
Definition: itkDerivativeImageFilter.h:64
itk::DerivativeImageFilter
Computes the directional derivative of an image. The directional derivative at each pixel location is...
Definition: itkDerivativeImageFilter.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::DerivativeImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkDerivativeImageFilter.h:65
itk::Concept::Signed
Definition: itkConceptChecking.h:654
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::DerivativeImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkDerivativeImageFilter.h:63
itk::DerivativeImageFilter::InputInternalPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
Definition: itkDerivativeImageFilter.h:66
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90