ITK  5.2.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  * http://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 
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);
95 
98  void
100  {
101  this->SetUseImageSpacing(true);
102  }
103 
106  void
108  {
109  this->SetUseImageSpacing(false);
110  }
111 
114  itkSetMacro(UseImageSpacing, bool);
115  itkGetConstMacro(UseImageSpacing, bool);
117 
125  void
126  GenerateInputRequestedRegion() override;
127 
128 protected:
130  {
131  m_Order = 1;
132  m_Direction = 0;
133  m_UseImageSpacing = true;
134  }
135 
136  ~DerivativeImageFilter() override = default;
137  void
138  PrintSelf(std::ostream & os, Indent indent) const override;
139 
145  void
146  GenerateData() override;
147 
148 private:
150  unsigned int m_Order;
151 
153  unsigned int m_Direction;
154 
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 # include "itkDerivativeImageFilter.hxx"
161 #endif
162 
163 #endif
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DerivativeImageFilter::DerivativeImageFilter
DerivativeImageFilter()
Definition: itkDerivativeImageFilter.h:129
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::DerivativeImageFilter::m_UseImageSpacing
bool m_UseImageSpacing
Definition: itkDerivativeImageFilter.h:155
itk::Concept::Signed
Definition: itkConceptChecking.h:652
itk::DerivativeImageFilter::m_Direction
unsigned int m_Direction
Definition: itkDerivativeImageFilter.h:153
itk::DerivativeImageFilter::SetUseImageSpacingOn
void SetUseImageSpacingOn()
Definition: itkDerivativeImageFilter.h:99
itk::DerivativeImageFilter::SetUseImageSpacingOff
void SetUseImageSpacingOff()
Definition: itkDerivativeImageFilter.h:107
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itkImageToImageFilter.h
itk::DerivativeImageFilter::m_Order
unsigned int m_Order
Definition: itkDerivativeImageFilter.h:150
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:64
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:138
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