ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkHigherOrderAccurateGradientImageFilter.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 itkHigherOrderAccurateGradientImageFilter_h
19 #define itkHigherOrderAccurateGradientImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "itkCovariantVector.h"
23 
24 namespace itk
25 {
26 
53 template< typename TInputImage, typename TOperatorValueType = float,
54  class TOutputValueType = float >
56  Image< CovariantVector< TOutputValueType, TInputImage::ImageDimension >, TInputImage::ImageDimension > >
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_ASSIGN(HigherOrderAccurateGradientImageFilter);
60 
62  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
63 
66 
68  using InputImageType = TInputImage;
69  using InputImagePointer = typename InputImageType::Pointer;
71  TOutputValueType, itkGetStaticConstMacro(OutputImageDimension) >,
72  itkGetStaticConstMacro(OutputImageDimension) >;
75 
80 
82  itkNewMacro(Self);
83 
86 
88  using InputPixelType = typename InputImageType::PixelType;
89  using OperatorValueType = TOperatorValueType;
90  using OutputValueType = TOutputValueType;
92  OutputValueType, itkGetStaticConstMacro(OutputImageDimension) >;
94 
97  itkSetMacro(UseImageSpacing, bool);
98  itkGetConstMacro(UseImageSpacing, bool);
99  itkBooleanMacro(UseImageSpacing);
101 
102 #ifdef ITK_USE_CONCEPT_CHECKING
103 
104  itkConceptMacro( InputConvertibleToOutputCheck,
106  itkConceptMacro( OutputHasNumericTraitsCheck,
108 
110 #endif
111 
122  itkSetMacro(UseImageDirection, bool);
123  itkGetConstMacro(UseImageDirection, bool);
124  itkBooleanMacro(UseImageDirection);
126 
129  itkSetMacro( OrderOfAccuracy, unsigned int );
130  itkGetConstMacro( OrderOfAccuracy, unsigned int )
131 
132 protected:
135  void PrintSelf(std::ostream & os, Indent indent) const override;
136 
143  void GenerateInputRequestedRegion() override;
144 
155  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
156 
157 private:
159 
160  // flag to take or not the image direction into account
161  // when computing the derivatives.
163 
164  unsigned int m_OrderOfAccuracy;
165 };
166 
167 } // end namespace itk
168 
169 #ifndef ITK_MANUAL_INSTANTIATION
170 #include "itkHigherOrderAccurateGradientImageFilter.hxx"
171 #endif
172 
173 #endif
Light weight base class for most itk classes.
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
Calculate the image gradient from a higher order accurate central-difference derivative kernel...
typename Superclass::RegionType RegionType
Definition: itkImage.h:139
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< Self > Pointer
Definition: itkImage.h:83
#define itkConceptMacro(name, concept)
A templated class holding a n-Dimensional covariant vector.
Templated n-dimensional image class.
Definition: itkImage.h:75