ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkDerivativeImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
47 template< typename TInputImage, typename TOutputImage >
48 class ITK_TEMPLATE_EXPORT DerivativeImageFilter:
49  public ImageToImageFilter< TInputImage, TOutputImage >
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_ASSIGN(DerivativeImageFilter);
53 
59 
62  using OutputPixelType = typename TOutputImage::PixelType;
63  using OutputInternalPixelType = typename TOutputImage::InternalPixelType;
64  using InputPixelType = typename TInputImage::PixelType;
65  using InputInternalPixelType = typename TInputImage::InternalPixelType;
66 
69  static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
70 
72  using InputImageType = TInputImage;
73  using OutputImageType = TOutputImage;
74 
76  itkNewMacro(Self);
77 
80 
82 #ifdef ITK_USE_CONCEPT_CHECKING
83  // Begin concept checking
84  itkConceptMacro( SignedOutputPixelType,
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 
99  { this->SetUseImageSpacing(true); }
100 
104  { this->SetUseImageSpacing(false); }
105 
108  itkSetMacro(UseImageSpacing, bool);
109  itkGetConstMacro(UseImageSpacing, bool);
111 
119  void GenerateInputRequestedRegion() override;
120 
121 protected:
123  {
124  m_Order = 1;
125  m_Direction = 0;
126  m_UseImageSpacing = true;
127  }
128 
129  ~DerivativeImageFilter() override = default;
130  void PrintSelf(std::ostream & os, Indent indent) const override;
131 
137  void GenerateData() override;
138 
139 private:
141  unsigned int m_Order;
142 
144  unsigned int m_Direction;
145 
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkDerivativeImageFilter.hxx"
152 #endif
153 
154 #endif
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Base class for all process objects that output image data.
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::InternalPixelType InputInternalPixelType
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
typename TInputImage::PixelType InputPixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define itkConceptMacro(name, concept)
typename TOutputImage::InternalPixelType OutputInternalPixelType
Computes the directional derivative of an image. The directional derivative at each pixel location is...