ITK  4.3.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 {
42 template< class TInputImage, class TOutputImage, class TInternalPixel = double >
43 class ITK_EXPORT GradientVectorFlowImageFilter:public ImageToImageFilter< TInputImage, TOutputImage >
44 {
45 public:
48 
51 
55 
57  itkNewMacro(Self);
58 
61 
63  typedef TInputImage InputImageType;
64  typedef TOutputImage OutputImageType;
65 
66  typedef typename TInputImage::IndexType IndexType;
67  typedef typename TInputImage::SizeType SizeType;
68  typedef typename TInputImage::PixelType PixelType;
69  typedef typename OutputImageType::Pointer OutputImagePointer;
70  typedef typename OutputImageType::RegionType RegionType;
71 
73 // typedef ImageRegionConstIterator<InputImageType> InputImageConstIterator;
77 
79  itkStaticConstMacro(ImageDimension, unsigned int,
80  TInputImage::ImageDimension);
81  itkStaticConstMacro(OutputImageDimension, unsigned int,
82  TOutputImage::ImageDimension);
84 
85  typedef TInternalPixel InternalPixelType;
89 
92 
95  itkSetMacro(LaplacianFilter, LaplacianFilterPointer);
96 
97  itkSetMacro(TimeStep, double);
98  itkGetConstMacro(TimeStep, double);
99 
100  itkSetMacro(NoiseLevel, double);
101  itkGetConstMacro(NoiseLevel, double);
102 
103  itkSetMacro(IterationNum, int);
104  itkGetConstMacro(IterationNum, int);
105 
106 #ifdef ITK_USE_CONCEPT_CHECKING
107 
108  itkConceptMacro( SameDimensionCheck,
110  itkConceptMacro( InputHasNumericTraitsCheck,
112  itkConceptMacro( OutputHasNumericTraitsCheck,
114 
116 #endif
117 
118 protected:
121  void PrintSelf(std::ostream & os, Indent indent) const;
122 
123  virtual void GenerateData();
124 
125  void InitInterImage();
126 
127  void UpdateInterImage();
128 
129  void UpdatePixels();
130 
131 private:
132  GradientVectorFlowImageFilter(const Self &); //purposely not implemented
133  void operator=(const Self &); //purposely not implemented
134 
135  // parameters;
136  double m_TimeStep; //the timestep of each
137  // iteration
138  double m_Steps[Superclass::InputImageDimension]; // set to be 1 in all
139  // directions in most cases
140  double m_NoiseLevel; // the noise level of the
141  // image
142  int m_IterationNum; // the iteration number
143 
146 
147  InternalImagePointer m_InternalImages[Superclass::InputImageDimension];
148  InternalImagePointer m_BImage; // store the "b" value for every pixel
149 
150  typename Superclass::InputImagePointer m_CImage; // store the $c_i$ value for
151  // every pixel
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkGradientVectorFlowImageFilter.hxx"
157 #endif
158 
159 #endif
160