ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGradientVectorFlowImageFilter.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 itkGradientVectorFlowImageFilter_h
19 #define itkGradientVectorFlowImageFilter_h
20 
21 #include "vnl/vnl_matrix_fixed.h"
22 #include "itkMath.h"
23 #include "itkImage.h"
24 #include "itkVector.h"
26 #include "itkImageRegionIterator.h"
28 
29 namespace itk
30 {
48 template< typename TInputImage, typename TOutputImage, typename TInternalPixel = double >
49 class ITK_TEMPLATE_EXPORT GradientVectorFlowImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
50 {
51 public:
52  ITK_DISALLOW_COPY_AND_ASSIGN(GradientVectorFlowImageFilter);
53 
56 
59 
63 
65  itkNewMacro(Self);
66 
69 
71  using InputImageType = TInputImage;
72  using OutputImageType = TOutputImage;
73 
75  using SizeType = typename TInputImage::SizeType;
76  using PixelType = typename TInputImage::PixelType;
77  using OutputImagePointer = typename OutputImageType::Pointer;
79 
84 
86  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
87  static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
88 
89  using InternalPixelType = TInternalPixel;
94 
97 
100  itkSetObjectMacro(LaplacianFilter, LaplacianFilterType);
101  itkGetModifiableObjectMacro(LaplacianFilter, LaplacianFilterType);
102 
103  itkSetMacro(TimeStep, double);
104  itkGetConstMacro(TimeStep, double);
105 
106  itkSetMacro(NoiseLevel, double);
107  itkGetConstMacro(NoiseLevel, double);
108 
109  itkSetMacro(IterationNum, int);
110  itkGetConstMacro(IterationNum, int);
111 
112 #ifdef ITK_USE_CONCEPT_CHECKING
113  // Begin concept checking
114  itkConceptMacro( SameDimensionCheck,
116  itkConceptMacro( InputHasNumericTraitsCheck,
118  itkConceptMacro( OutputHasNumericTraitsCheck,
120  // End concept checking
121 #endif
122 
123 protected:
125  ~GradientVectorFlowImageFilter() override = default;
126  void PrintSelf(std::ostream & os, Indent indent) const override;
127 
128  void GenerateData() override;
129 
131  void InitInterImage();
132 
137  void UpdateInterImage();
138 
140  void UpdatePixels();
141 
142 private:
143  // parameters;
144  double m_TimeStep; // the timestep of each
145  // iteration
146  double m_Steps[Superclass::InputImageDimension]; // set to be 1 in all
147  // directions in most cases
148  double m_NoiseLevel; // the noise level of the
149  // image
150  int m_IterationNum; // the iteration number
151 
154 
155  InternalImagePointer m_InternalImages[Superclass::InputImageDimension];
156  InternalImagePointer m_BImage; // store the "b" value for every pixel
157 
158  typename Superclass::InputImagePointer m_CImage; // store the $c_i$ value for
159  // every pixel
160 };
161 } // end namespace itk
162 
163 #ifndef ITK_MANUAL_INSTANTIATION
164 #include "itkGradientVectorFlowImageFilter.hxx"
165 #endif
166 
167 #endif
typename OutputImageType::Pointer OutputImagePointer
typename InternalImageType::Pointer InternalImagePointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
This class computes a diffusion of the gradient vectors for graylevel or binary edge map derive from ...
Base class for all process objects that output image data.
typename InputImageType::Pointer InputImagePointer
A multi-dimensional iterator templated over image type that walks a region of pixels.
TOutputImage OutputImageType
typename OutputImageType::RegionType RegionType
typename LaplacianFilterType::Pointer LaplacianFilterPointer
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
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
Definition: itkImage.h:75
A multi-dimensional iterator templated over image type that walks a region of pixels.