ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSegmentationLevelSetFunction.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 itkSegmentationLevelSetFunction_h
19 #define itkSegmentationLevelSetFunction_h
20 
21 #include "itkLevelSetFunction.h"
25 
26 namespace itk
27 {
46 template< typename TImageType, typename TFeatureImageType = TImageType >
47 class ITK_TEMPLATE_EXPORT SegmentationLevelSetFunction:
48  public LevelSetFunction< TImageType >
49 {
50 public:
56 
59 
61  typedef typename Superclass::ImageType ImageType;
62  typedef typename Superclass::RadiusType RadiusType;
63  typedef typename Superclass::PixelRealType PixelRealType;
64  typedef TFeatureImageType FeatureImageType;
65  typedef typename Superclass::FloatOffsetType FloatOffsetType;
66  typedef typename Superclass::ScalarValueType ScalarValueType;
67  typedef typename Superclass::NeighborhoodType NeighborhoodType;
68  typedef typename FeatureImageType::PixelType FeatureScalarType;
69  typedef typename ImageType::IndexType IndexType;
71  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
72 
74  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
75 
78 
81 
84 
87 
89  virtual const FeatureImageType * GetFeatureImage() const
90  { return m_FeatureImage.GetPointer(); }
91  virtual void SetFeatureImage(const FeatureImageType *f)
92  { m_FeatureImage = f; }
94 
97  { return m_SpeedImage.GetPointer(); }
98  void SetSpeedImage(ImageType *s);
100 
103  { return m_AdvectionImage.GetPointer(); }
104  void SetAdvectionImage(VectorImageType *s);
106 
110  virtual void Initialize(const RadiusType & r) ITK_OVERRIDE;
111 
116  virtual void CalculateSpeedImage() {}
117 
122  virtual void CalculateAdvectionImage() {}
123 
126  virtual void AllocateSpeedImage();
127 
130  virtual void AllocateAdvectionImage();
131 
142  virtual void ReverseExpansionDirection();
143 
144 protected:
146  typename FeatureImageType::ConstPointer m_FeatureImage;
147 
149  typename ImageType::Pointer m_SpeedImage;
150 
153 
157 
159  virtual ScalarValueType PropagationSpeed(const NeighborhoodType &,
160  const FloatOffsetType &, GlobalDataStruct *gd) const ITK_OVERRIDE;
161 
163  virtual VectorType AdvectionField(const NeighborhoodType &,
164  const FloatOffsetType &, GlobalDataStruct *gd) const ITK_OVERRIDE;
165 
166  virtual ~SegmentationLevelSetFunction() ITK_OVERRIDE {}
168  {
169  m_SpeedImage = ImageType::New();
170  m_AdvectionImage = VectorImageType::New();
171  m_Interpolator = InterpolatorType::New();
172  m_VectorInterpolator = VectorInterpolatorType::New();
173  }
174 
176 
178 
179 private:
180  ITK_DISALLOW_COPY_AND_ASSIGN(SegmentationLevelSetFunction);
181 };
182 } // end namespace
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkSegmentationLevelSetFunction.hxx"
186 #endif
187 
188 #endif
Functor::VectorCast< typename VectorInterpolatorType::OutputType, VectorType > m_VectorCast
The LevelSetFunction class is a generic function object which can be used to create a level set metho...
Superclass::ContinuousIndexType ContinuousIndexType
InterpolatorType::ContinuousIndexType ContinuousIndexType
Superclass::ImageType ImageType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:50
VectorInterpolatorType::Pointer m_VectorInterpolator
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
VectorLinearInterpolateImageFunction< VectorImageType > VectorInterpolatorType
LinearInterpolateImageFunction< ImageType > InterpolatorType
Linearly interpolate an image at specified positions.
virtual void SetFeatureImage(const FeatureImageType *f)
virtual const FeatureImageType * GetFeatureImage() const
virtual VectorImageType * GetAdvectionImage() const
Image< VectorType, itkGetStaticConstMacro(ImageDimension) > VectorImageType
Templated n-dimensional image class.
Definition: itkImage.h:75
Linearly interpolate a vector image at specified positions.