ITK  5.4.0
Insight Toolkit
itkSegmentationLevelSetFunction.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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"
24#include "itkCastImageFilter.h"
25
26namespace itk
27{
46template <typename TImageType, typename TFeatureImageType = TImageType>
47class ITK_TEMPLATE_EXPORT SegmentationLevelSetFunction : public LevelSetFunction<TImageType>
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(SegmentationLevelSetFunction);
51
57
59 itkOverrideGetNameOfClassMacro(SegmentationLevelSetFunction);
60
62 using typename Superclass::ImageType;
63 using typename Superclass::RadiusType;
64 using typename Superclass::PixelRealType;
65 using FeatureImageType = TFeatureImageType;
66 using typename Superclass::FloatOffsetType;
67 using typename Superclass::ScalarValueType;
68 using typename Superclass::NeighborhoodType;
69 using FeatureScalarType = typename FeatureImageType::PixelType;
71 using typename Superclass::VectorType;
72 using typename Superclass::GlobalDataStruct;
73
75 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
76
79
82
85
88
90 virtual const FeatureImageType *
92 {
93 return m_FeatureImage.GetPointer();
94 }
95 virtual void
97 {
98 m_FeatureImage = f;
99 }
103 virtual ImageType *
105 {
106 return m_SpeedImage.GetPointer();
107 }
108 void
113 virtual VectorImageType *
115 {
116 return m_AdvectionImage.GetPointer();
117 }
118 void
125 void
126 Initialize(const RadiusType & r) override;
127
132 virtual void
134 {}
135
140 virtual void
142 {}
143
146 virtual void
148
151 virtual void
153
164 virtual void
166
167protected:
169 typename FeatureImageType::ConstPointer m_FeatureImage{};
170
172 typename ImageType::Pointer m_SpeedImage{};
173
175 typename VectorImageType::Pointer m_AdvectionImage{};
176
178 ScalarValueType
180
183 AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct * gd) const override;
184
185 ~SegmentationLevelSetFunction() override = default;
187 {
188 m_SpeedImage = ImageType::New();
189 m_AdvectionImage = VectorImageType::New();
190 m_Interpolator = InterpolatorType::New();
191 m_VectorInterpolator = VectorInterpolatorType::New();
192 }
193
194 typename InterpolatorType::Pointer m_Interpolator{};
195
196 typename VectorInterpolatorType::Pointer m_VectorInterpolator{};
197};
198} // namespace itk
199
200#ifndef ITK_MANUAL_INSTANTIATION
201# include "itkSegmentationLevelSetFunction.hxx"
202#endif
203
204#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:54
Templated n-dimensional image class.
Definition: itkImage.h:89
The LevelSetFunction class is a generic function object which can be used to create a level set metho...
Light weight base class for most itk classes.
Linearly interpolate an image at specified positions.
~SegmentationLevelSetFunction() override=default
typename FeatureImageType::PixelType FeatureScalarType
void SetAdvectionImage(VectorImageType *s)
void Initialize(const RadiusType &r) override
ScalarValueType PropagationSpeed(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
virtual void SetFeatureImage(const FeatureImageType *f)
virtual const FeatureImageType * GetFeatureImage() const
virtual VectorImageType * GetAdvectionImage() const
VectorType AdvectionField(const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
virtual void ReverseExpansionDirection()
typename InterpolatorType::ContinuousIndexType ContinuousIndexType
void SetSpeedImage(ImageType *s)
Linearly interpolate a vector image at specified positions.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
SmartPointer< const Self > ConstPointer
static Pointer New()
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....