ITK  4.9.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 >
48  public LevelSetFunction< TImageType >
49 {
50 public:
56 
59 
61  typedef typename Superclass::ImageType ImageType;
64  typedef TFeatureImageType FeatureImageType;
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(); }
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 
160  const FloatOffsetType &, GlobalDataStruct *gd) const ITK_OVERRIDE;
161 
164  const FloatOffsetType &, GlobalDataStruct *gd) const ITK_OVERRIDE;
165 
168  {
169  m_SpeedImage = ImageType::New();
173  }
174 
176 
178 
179 private:
180  SegmentationLevelSetFunction(const Self &) ITK_DELETE_FUNCTION;
181  void operator=(const Self &) ITK_DELETE_FUNCTION;
182 };
183 } // end namespace
184 
185 #ifndef ITK_MANUAL_INSTANTIATION
186 #include "itkSegmentationLevelSetFunction.hxx"
187 #endif
188 
189 #endif
Superclass::RadiusType RadiusType
void SetSpeedImage(ImageType *s)
Light weight base class for most itk classes.
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::NeighborhoodType NeighborhoodType
Superclass::ContinuousIndexType ContinuousIndexType
Superclass::FloatOffsetType FloatOffsetType
InterpolatorType::ContinuousIndexType ContinuousIndexType
Superclass::ImageType ImageType
ObjectType * GetPointer() const
static Pointer New()
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
virtual void ReverseExpansionDirection()
Simulate a standard C array with copy semnatics.
Definition: itkFixedArray.h:50
VectorInterpolatorType::Pointer m_VectorInterpolator
virtual ScalarValueType PropagationSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
void SetAdvectionImage(VectorImageType *s)
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
VectorLinearInterpolateImageFunction< VectorImageType > VectorInterpolatorType
virtual VectorType AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
Superclass::PixelRealType PixelRealType
LinearInterpolateImageFunction< ImageType > InterpolatorType
Linearly interpolate an image at specified positions.
virtual void SetFeatureImage(const FeatureImageType *f)
FixedArray< ScalarValueType, itkGetStaticConstMacro(ImageDimension) > VectorType
virtual const FeatureImageType * GetFeatureImage() const
virtual void Initialize(const RadiusType &r) override
virtual VectorImageType * GetAdvectionImage() const
Image< VectorType, itkGetStaticConstMacro(ImageDimension) > VectorImageType
Templated n-dimensional image class.
Definition: itkImage.h:75
static const unsigned int ImageDimension
Linearly interpolate a vector image at specified positions.