ITK  6.0.0
Insight Toolkit
itkShapePriorSegmentationLevelSetFunction.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 itkShapePriorSegmentationLevelSetFunction_h
19#define itkShapePriorSegmentationLevelSetFunction_h
20
23
24namespace itk
25{
54template <typename TImageType, typename TFeatureImageType = TImageType>
56 : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
57{
58public:
59 ITK_DISALLOW_COPY_AND_MOVE(ShapePriorSegmentationLevelSetFunction);
60
66 using FeatureImageType = TFeatureImageType;
67
69 itkNewMacro(Self);
70
72 itkOverrideGetNameOfClassMacro(ShapePriorSegmentationLevelSetFunction);
73
75 using typename Superclass::ImageType;
76 using typename Superclass::NeighborhoodType;
77 using typename Superclass::ScalarValueType;
78 using typename Superclass::FeatureScalarType;
79 using typename Superclass::RadiusType;
80 using typename Superclass::FloatOffsetType;
81 using typename Superclass::VectorImageType;
82 using typename Superclass::PixelType;
83 using typename Superclass::TimeStepType;
84 using typename Superclass::IndexType;
85 using typename Superclass::ContinuousIndexType;
86
88 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
89
93
95 void
97 {
98 m_ShapePriorWeight = p;
99 }
100 ScalarValueType
102 {
103 return m_ShapePriorWeight;
104 }
109 void
111 {
112 m_ShapeFunction = ptr;
113 }
114 const ShapeFunctionType *
116 {
117 return m_ShapeFunction;
118 }
122 PixelType
123 ComputeUpdate(const NeighborhoodType & neighborhood,
124 void * gd,
125 const FloatOffsetType & = FloatOffsetType(0.0)) override;
126
129 ComputeGlobalTimeStep(void * gd) const override;
130
133 struct ShapePriorGlobalDataStruct : public Superclass::GlobalDataStruct
134 {
136 };
137
139 void *
140 GetGlobalDataPointer() const override
141 {
142 auto * ans = new ShapePriorGlobalDataStruct();
143
144 ans->m_MaxAdvectionChange = ScalarValueType{};
145 ans->m_MaxPropagationChange = ScalarValueType{};
146 ans->m_MaxCurvatureChange = ScalarValueType{};
147 ans->m_MaxShapePriorChange = ScalarValueType{};
148 return ans;
149 }
150
152 void
153 ReleaseGlobalDataPointer(void * GlobalData) const override
154 {
155 delete (ShapePriorGlobalDataStruct *)GlobalData;
156 }
157
158protected:
161
162 void
163 PrintSelf(std::ostream & os, Indent indent) const override;
164
165private:
166 ShapeFunctionPointer m_ShapeFunction{};
167 ScalarValueType m_ShapePriorWeight{};
168};
169} // end namespace itk
170
171#ifndef ITK_MANUAL_INSTANTIATION
172# include "itkShapePriorSegmentationLevelSetFunction.hxx"
173#endif
174
175#endif
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *gd, const FloatOffsetType &=FloatOffsetType(0.0)) override
void PrintSelf(std::ostream &os, Indent indent) const override
~ShapePriorSegmentationLevelSetFunction() override=default
TimeStepType ComputeGlobalTimeStep(void *gd) const override
Base class for functions which evaluates the signed distance from a shape.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
SmartPointer< const Self > ConstPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....