ITK  4.13.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:
54 
57 
61 
63  itkNewMacro(Self);
64 
67 
69  typedef TInputImage InputImageType;
70  typedef TOutputImage OutputImageType;
71 
73  typedef typename TInputImage::SizeType SizeType;
74  typedef typename TInputImage::PixelType PixelType;
75  typedef typename OutputImageType::Pointer OutputImagePointer;
76  typedef typename OutputImageType::RegionType RegionType;
77 
82 
84  itkStaticConstMacro(ImageDimension, unsigned int,
85  TInputImage::ImageDimension);
86  itkStaticConstMacro(OutputImageDimension, unsigned int,
87  TOutputImage::ImageDimension);
89 
90  typedef TInternalPixel InternalPixelType;
95 
98 
101  itkSetObjectMacro(LaplacianFilter, LaplacianFilterType);
102  itkGetModifiableObjectMacro(LaplacianFilter, LaplacianFilterType);
103 
104  itkSetMacro(TimeStep, double);
105  itkGetConstMacro(TimeStep, double);
106 
107  itkSetMacro(NoiseLevel, double);
108  itkGetConstMacro(NoiseLevel, double);
109 
110  itkSetMacro(IterationNum, int);
111  itkGetConstMacro(IterationNum, int);
112 
113 #ifdef ITK_USE_CONCEPT_CHECKING
114  // Begin concept checking
115  itkConceptMacro( SameDimensionCheck,
117  itkConceptMacro( InputHasNumericTraitsCheck,
119  itkConceptMacro( OutputHasNumericTraitsCheck,
121  // End concept checking
122 #endif
123 
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
128 
129  virtual void GenerateData() ITK_OVERRIDE;
130 
132  void InitInterImage();
133 
138  void UpdateInterImage();
139 
141  void UpdatePixels();
142 
143 private:
144  ITK_DISALLOW_COPY_AND_ASSIGN(GradientVectorFlowImageFilter);
145 
146  // parameters;
147  double m_TimeStep; // the timestep of each
148  // iteration
149  double m_Steps[Superclass::InputImageDimension]; // set to be 1 in all
150  // directions in most cases
151  double m_NoiseLevel; // the noise level of the
152  // image
153  int m_IterationNum; // the iteration number
154 
155  LaplacianFilterPointer m_LaplacianFilter;
156  typename Superclass::InputImagePointer m_IntermediateImage;
157 
158  InternalImagePointer m_InternalImages[Superclass::InputImageDimension];
159  InternalImagePointer m_BImage; // store the "b" value for every pixel
160 
161  typename Superclass::InputImagePointer m_CImage; // store the $c_i$ value for
162  // every pixel
163 };
164 } // end namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkGradientVectorFlowImageFilter.hxx"
168 #endif
169 
170 #endif
ImageRegionIterator< OutputImageType > OutputImageIterator
ImageRegionIterator< InternalImageType > InternalImageIterator
InputImageType::Pointer InputImagePointer
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 ...
ImageRegionConstIterator< InputImageType > InputImageConstIterator
Base class for all process objects that output image data.
A multi-dimensional iterator templated over image type that walks a region of pixels.
ImageRegionConstIterator< InternalImageType > InternalImageConstIterator
Base class for filters that take an image as input and produce an image as output.
itk::Image< InternalPixelType, itkGetStaticConstMacro(ImageDimension) > InternalImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
LaplacianImageFilter< InternalImageType, InternalImageType > LaplacianFilterType
#define itkConceptMacro(name, concept)
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Templated n-dimensional image class.
Definition: itkImage.h:75
A multi-dimensional iterator templated over image type that walks a region of pixels.
ImageRegionIterator< InputImageType > InputImageIterator