ITK  4.4.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< class TInputImage, class TOutputImage, class TInternalPixel = double >
49 class ITK_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 
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 
114  itkConceptMacro( SameDimensionCheck,
116  itkConceptMacro( InputHasNumericTraitsCheck,
118  itkConceptMacro( OutputHasNumericTraitsCheck,
120 
122 #endif
123 
124 protected:
127  void PrintSelf(std::ostream & os, Indent indent) const;
128 
129  virtual void GenerateData();
130 
132  void InitInterImage();
133 
138  void UpdateInterImage();
139 
141  void UpdatePixels();
142 
143 private:
144  GradientVectorFlowImageFilter(const Self &); //purposely not implemented
145  void operator=(const Self &); //purposely not implemented
146 
147  // parameters;
148  double m_TimeStep; // the timestep of each
149  // iteration
150  double m_Steps[Superclass::InputImageDimension]; // set to be 1 in all
151  // directions in most cases
152  double m_NoiseLevel; // the noise level of the
153  // image
154  int m_IterationNum; // the iteration number
155 
158 
159  InternalImagePointer m_InternalImages[Superclass::InputImageDimension];
160  InternalImagePointer m_BImage; // store the "b" value for every pixel
161 
162  typename Superclass::InputImagePointer m_CImage; // store the $c_i$ value for
163  // every pixel
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkGradientVectorFlowImageFilter.hxx"
169 #endif
170 
171 #endif
172