ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkLinearAnisotropicDiffusionLBRImageFilter.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 //
19 // Created by Jean-Marie Mirebeau on 28/02/2014.
20 //
21 //
22 
23 #ifndef itkLinearAnisotropicDiffusionLBRImageFilter_h
24 #define itkLinearAnisotropicDiffusionLBRImageFilter_h
25 
26 
27 #include "itkImageToImageFilter.h"
29 
30 namespace itk
31 {
46 template< typename TImage, typename TScalar = typename TImage::PixelType >
48  public ImageToImageFilter< TImage, TImage >
49 {
50 public:
51 
57 
59  itkNewMacro(Self);
60 
63 
64  typedef TImage ImageType;
65  typedef typename ImageType::PixelType PixelType;
66 
67  static const int Dimension = ImageType::ImageDimension;
68 
69  typedef TScalar ScalarType;
73 
74  void SetInputImage(const ImageType* image);
75  void SetInputTensor(const TensorImageType* tensorImage);
76 
78  itkGetConstMacro(DiffusionTime, ScalarType);
79 
80  void SetMaxNumberOfTimeSteps(int n);
81  itkGetConstMacro(MaxNumberOfTimeSteps, int);
82 
84  itkGetConstMacro(RatioToMaxStableTimeStep, ScalarType);
85 
86  itkGetConstMacro(EffectiveDiffusionTime, ScalarType);
87  itkGetConstMacro(EffectiveNumberOfTimeSteps, int);
88 
89 protected:
92 
93  typename ImageType::ConstPointer GetInputImage();
95 
97 
98  // ******* Containers for the stencils used in the discretization
99  static const unsigned int HalfStencilSize = (Dimension == 2) ? 3 : 6;
100  static const unsigned int StencilSize = 2 * HalfStencilSize;
101 
105 
106  typedef int InternalSizeT;
108 
109 
110  // *************** Computation *****************
111  virtual void GenerateData() ITK_OVERRIDE;
112  virtual void GenerateStencils();
113  virtual void ImageUpdateLoop();
114 
116  typedef Image< StencilType, Dimension > StencilImageType;
117  typename StencilImageType::Pointer m_StencilImage;
118 
120  typename ScalarImageType::Pointer m_DiagonalCoefficients;
121 
122  virtual ScalarType MaxStableTimeStep();
123 
124  ScalarType m_DiffusionTime;
127 
130 
131  virtual void ImageUpdate(ScalarType delta);
134 
135  virtual RegionType GetRequestedRegion(){return GetInputImage()->GetRequestedRegion();}
136 
138 
139  struct StencilFunctor;
140  struct FunctorType;
141 
143  static ScalarType ScalarProduct(const TensorType &, const VectorType &, const VectorType &);
144 
145 private:
146  LinearAnisotropicDiffusionLBRImageFilter(const Self &); //purposely not implemented
147  void operator=(const Self &); //purposely not implemented
148 };
149 } // end namespace itk
150 
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "itkLinearAnisotropicDiffusionLBRImageFilter.hxx"
154 #endif
155 
156 #endif
virtual void ImageUpdateLoop()
Automatically called by GenerateData.
Light weight base class for most itk classes.
virtual void ImageUpdate(ScalarType delta)
Represent the offset between two n-dimensional indexes in a n-dimensional image.
Definition: itkOffset.h:55
void SetRatioToMaxStableTimeStep(ScalarType ratio)
Represent a symmetric tensor of second rank.
An image region represents a structured region of data.
void SetInputImage(const ImageType *image)
SmartPointer< const Self > ConstPointer
Definition: itkImage.h:82
SymmetricSecondRankTensor< ScalarType, Dimension > TensorType
std::pair< StencilBufferIndicesType, StencilCoefficientsType > StencilType
Automatically called by GenerateData.
Anisotropic diffusion using lattice basis reduction.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
TensorImageType::ConstPointer GetInputTensor()
static T max(const T &)
Base class for filters that take an image as input and produce an image as output.
void SetInputTensor(const TensorImageType *tensorImage)
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:71
static ScalarType ScalarProduct(const TensorType &, const VectorType &, const VectorType &)
Templated n-dimensional image class.
Definition: itkImage.h:75