ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkShapePriorSegmentationLevelSetFunction.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 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_ASSIGN(ShapePriorSegmentationLevelSetFunction);
60 
63  using Superclass =
67  using FeatureImageType = TFeatureImageType;
68 
70  itkNewMacro(Self);
71 
74 
76  using ImageType = typename Superclass::ImageType;
77  using NeighborhoodType = typename Superclass::NeighborhoodType;
79  using FeatureScalarType = typename Superclass::FeatureScalarType;
80  using RadiusType = typename Superclass::RadiusType;
81  using FloatOffsetType = typename Superclass::FloatOffsetType;
82  using VectorImageType = typename Superclass::VectorImageType;
83  using PixelType = typename Superclass::PixelType;
84  using TimeStepType = typename Superclass::TimeStepType;
85  using IndexType = typename Superclass::IndexType;
86  using ContinuousIndexType = typename Superclass::ContinuousIndexType;
87 
89  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
90 
93  Self::ImageDimension >;
95 
98  { m_ShapePriorWeight = p; }
100  { return m_ShapePriorWeight; }
102 
106  { m_ShapeFunction = ptr; }
108  { return m_ShapeFunction; }
110 
112  PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
113  void *globalData,
114  const FloatOffsetType & = FloatOffsetType(0.0) ) override;
115 
117  TimeStepType ComputeGlobalTimeStep(void *globalData) const override;
118 
121  using GlobalDataStruct = typename Superclass::GlobalDataStruct;
124  };
125 
127  void * GetGlobalDataPointer() const override
128  {
129  auto * ans = new ShapePriorGlobalDataStruct();
130 
131  ans->m_MaxAdvectionChange = NumericTraits< ScalarValueType >::ZeroValue();
132  ans->m_MaxPropagationChange = NumericTraits< ScalarValueType >::ZeroValue();
133  ans->m_MaxCurvatureChange = NumericTraits< ScalarValueType >::ZeroValue();
134  ans->m_MaxShapePriorChange = NumericTraits< ScalarValueType >::ZeroValue();
135  return ans;
136  }
137 
139  void ReleaseGlobalDataPointer(void *GlobalData) const override
140  { delete (ShapePriorGlobalDataStruct *)GlobalData; }
141 
142 protected:
144  ~ShapePriorSegmentationLevelSetFunction() override = default;
145 
146  void PrintSelf(std::ostream & os, Indent indent) const override;
147 
148 private:
149 
152 };
153 } // end namespace itk
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkShapePriorSegmentationLevelSetFunction.hxx"
157 #endif
158 
159 #endif
typename Superclass::GlobalDataStruct GlobalDataStruct
Light weight base class for most itk classes.
typename FeatureImageType::PixelType FeatureScalarType
Define numeric traits for std::vector.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
Base class for functions which evaluates the signed distance from a shape.
typename ImageType::PixelType PixelType
typename InterpolatorType::ContinuousIndexType ContinuousIndexType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::ScalarValueType ScalarValueType
Templated n-dimensional image class.
Definition: itkImage.h:75