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 
24 namespace itk
25 {
54 template <typename TImageType, typename TFeatureImageType = TImageType>
55 class ITK_TEMPLATE_EXPORT ShapePriorSegmentationLevelSetFunction
56  : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
57 {
58 public:
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
96  SetShapePriorWeight(const ScalarValueType p)
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 
128  TimeStepType
129  ComputeGlobalTimeStep(void * gd) const override;
130 
134  {
135  ScalarValueType m_MaxShapePriorChange;
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 
158 protected:
160  ~ShapePriorSegmentationLevelSetFunction() override = default;
161 
162  void
163  PrintSelf(std::ostream & os, Indent indent) const override;
164 
165 private:
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
itk::ShapePriorSegmentationLevelSetFunction::GetShapePriorWeight
ScalarValueType GetShapePriorWeight() const
Definition: itkShapePriorSegmentationLevelSetFunction.h:101
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ShapePriorSegmentationLevelSetFunction::ShapePriorGlobalDataStruct::m_MaxShapePriorChange
ScalarValueType m_MaxShapePriorChange
Definition: itkShapePriorSegmentationLevelSetFunction.h:135
itk::ShapePriorSegmentationLevelSetFunction::ShapeFunctionPointer
typename ShapeFunctionType::ConstPointer ShapeFunctionPointer
Definition: itkShapePriorSegmentationLevelSetFunction.h:92
itkShapeSignedDistanceFunction.h
itk::ShapePriorSegmentationLevelSetFunction::SetShapeFunction
void SetShapeFunction(const ShapeFunctionType *ptr)
Definition: itkShapePriorSegmentationLevelSetFunction.h:110
itk::LevelSetFunction::GlobalDataStruct
Definition: itkLevelSetFunction.h:106
itk::ShapePriorSegmentationLevelSetFunction
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
Definition: itkShapePriorSegmentationLevelSetFunction.h:55
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapePriorSegmentationLevelSetFunction::GetShapeFunction
const ShapeFunctionType * GetShapeFunction() const
Definition: itkShapePriorSegmentationLevelSetFunction.h:115
itk::SegmentationLevelSetFunction::FeatureImageType
TFeatureImageType FeatureImageType
Definition: itkSegmentationLevelSetFunction.h:65
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ShapePriorSegmentationLevelSetFunction::ShapePriorGlobalDataStruct
Definition: itkShapePriorSegmentationLevelSetFunction.h:133
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkSegmentationLevelSetFunction.h
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:53
itk::ShapePriorSegmentationLevelSetFunction::GetGlobalDataPointer
void * GetGlobalDataPointer() const override
Definition: itkShapePriorSegmentationLevelSetFunction.h:140
itk::ShapePriorSegmentationLevelSetFunction::ReleaseGlobalDataPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
Definition: itkShapePriorSegmentationLevelSetFunction.h:153
itk::ShapePriorSegmentationLevelSetFunction::SetShapePriorWeight
void SetShapePriorWeight(const ScalarValueType p)
Definition: itkShapePriorSegmentationLevelSetFunction.h:96
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::SegmentationLevelSetFunction
Definition: itkSegmentationLevelSetFunction.h:47