ITK  5.2.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  * 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 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 
73 
75  using ImageType = typename Superclass::ImageType;
76  using NeighborhoodType = typename Superclass::NeighborhoodType;
78  using FeatureScalarType = typename Superclass::FeatureScalarType;
79  using RadiusType = typename Superclass::RadiusType;
80  using FloatOffsetType = typename Superclass::FloatOffsetType;
81  using VectorImageType = typename Superclass::VectorImageType;
82  using PixelType = typename Superclass::PixelType;
83  using TimeStepType = typename Superclass::TimeStepType;
84  using IndexType = typename Superclass::IndexType;
85  using ContinuousIndexType = 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  }
106 
109  void
111  {
112  m_ShapeFunction = ptr;
113  }
114  const ShapeFunctionType *
116  {
117  return m_ShapeFunction;
118  }
120 
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 
133  using GlobalDataStruct = typename Superclass::GlobalDataStruct;
135  {
137  };
138 
140  void *
141  GetGlobalDataPointer() const override
142  {
143  auto * ans = new ShapePriorGlobalDataStruct();
144 
145  ans->m_MaxAdvectionChange = NumericTraits<ScalarValueType>::ZeroValue();
146  ans->m_MaxPropagationChange = NumericTraits<ScalarValueType>::ZeroValue();
147  ans->m_MaxCurvatureChange = NumericTraits<ScalarValueType>::ZeroValue();
148  ans->m_MaxShapePriorChange = NumericTraits<ScalarValueType>::ZeroValue();
149  return ans;
150  }
151 
153  void
154  ReleaseGlobalDataPointer(void * GlobalData) const override
155  {
156  delete (ShapePriorGlobalDataStruct *)GlobalData;
157  }
158 
159 protected:
161  ~ShapePriorSegmentationLevelSetFunction() override = default;
162 
163  void
164  PrintSelf(std::ostream & os, Indent indent) const override;
165 
166 private:
169 };
170 } // end namespace itk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 # include "itkShapePriorSegmentationLevelSetFunction.hxx"
174 #endif
175 
176 #endif
itk::ShapePriorSegmentationLevelSetFunction::GetShapePriorWeight
ScalarValueType GetShapePriorWeight() const
Definition: itkShapePriorSegmentationLevelSetFunction.h:101
itk::FiniteDifferenceFunction::RadiusType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::ShapePriorSegmentationLevelSetFunction::m_ShapePriorWeight
ScalarValueType m_ShapePriorWeight
Definition: itkShapePriorSegmentationLevelSetFunction.h:168
itk::ShapePriorSegmentationLevelSetFunction::ShapePriorGlobalDataStruct::m_MaxShapePriorChange
ScalarValueType m_MaxShapePriorChange
Definition: itkShapePriorSegmentationLevelSetFunction.h:136
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::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::ShapePriorSegmentationLevelSetFunction
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
Definition: itkShapePriorSegmentationLevelSetFunction.h:55
itk::SegmentationLevelSetFunction::GlobalDataStruct
typename Superclass::GlobalDataStruct GlobalDataStruct
Definition: itkSegmentationLevelSetFunction.h:72
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FiniteDifferenceFunction::ImageType
TImageType ImageType
Definition: itkFiniteDifferenceFunction.h:82
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::GlobalDataStruct
typename Superclass::GlobalDataStruct GlobalDataStruct
Definition: itkShapePriorSegmentationLevelSetFunction.h:133
itk::ShapePriorSegmentationLevelSetFunction::ShapePriorGlobalDataStruct
Definition: itkShapePriorSegmentationLevelSetFunction.h:134
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkSegmentationLevelSetFunction.h
itk::SegmentationLevelSetFunction::FeatureScalarType
typename FeatureImageType::PixelType FeatureScalarType
Definition: itkSegmentationLevelSetFunction.h:69
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:141
itk::ShapePriorSegmentationLevelSetFunction::ReleaseGlobalDataPointer
void ReleaseGlobalDataPointer(void *GlobalData) const override
Definition: itkShapePriorSegmentationLevelSetFunction.h:154
itk::SegmentationLevelSetFunction::ScalarValueType
typename Superclass::ScalarValueType ScalarValueType
Definition: itkSegmentationLevelSetFunction.h:67
itk::ShapePriorSegmentationLevelSetFunction::SetShapePriorWeight
void SetShapePriorWeight(const ScalarValueType p)
Definition: itkShapePriorSegmentationLevelSetFunction.h:96
itk::FiniteDifferenceFunction::PixelType
typename ImageType::PixelType PixelType
Definition: itkFiniteDifferenceFunction.h:83
itk::ShapePriorSegmentationLevelSetFunction::m_ShapeFunction
ShapeFunctionPointer m_ShapeFunction
Definition: itkShapePriorSegmentationLevelSetFunction.h:167
itk::NumericTraits::ZeroValue
static T ZeroValue()
Definition: itkNumericTraits.h:148
itk::LevelSetFunction::ScalarValueType
PixelType ScalarValueType
Definition: itkLevelSetFunction.h:90
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ConstNeighborhoodIterator
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
Definition: itkConstNeighborhoodIterator.h:51
itk::SegmentationLevelSetFunction
Definition: itkSegmentationLevelSetFunction.h:47
itk::SegmentationLevelSetFunction::IndexType
typename ImageType::IndexType IndexType
Definition: itkSegmentationLevelSetFunction.h:70
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:86
itk::SegmentationLevelSetFunction::ContinuousIndexType
typename InterpolatorType::ContinuousIndexType ContinuousIndexType
Definition: itkSegmentationLevelSetFunction.h:87
itk::FiniteDifferenceFunction::TimeStepType
double TimeStepType
Definition: itkFiniteDifferenceFunction.h:90