ITK  4.9.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 "vnl/vnl_math.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 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 
72  typedef typename TInputImage::IndexType IndexType;
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  itkSetMacro(LaplacianFilter, LaplacianFilterPointer);
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:
126  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
127 
128  virtual void GenerateData() ITK_OVERRIDE;
129 
131  void InitInterImage();
132 
137  void UpdateInterImage();
138 
140  void UpdatePixels();
141 
142 private:
143  GradientVectorFlowImageFilter(const Self &) ITK_DELETE_FUNCTION;
144  void operator=(const Self &) ITK_DELETE_FUNCTION;
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 
157 
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
virtual void GenerateData() override
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.
static const unsigned int InputImageDimension
InternalImagePointer m_InternalImages[Superclass::InputImageDimension]
double m_Steps[Superclass::InputImageDimension]
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
void PrintSelf(std::ostream &os, Indent indent) const override
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