ITK  5.4.0
Insight Toolkit
itkGeodesicActiveContourLevelSetFunction.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 itkGeodesicActiveContourLevelSetFunction_h
19 #define itkGeodesicActiveContourLevelSetFunction_h
20 
22 
23 namespace itk
24 {
76 template <typename TImageType, typename TFeatureImageType = TImageType>
77 class ITK_TEMPLATE_EXPORT GeodesicActiveContourLevelSetFunction
78  : public SegmentationLevelSetFunction<TImageType, TFeatureImageType>
79 {
80 public:
81  ITK_DISALLOW_COPY_AND_MOVE(GeodesicActiveContourLevelSetFunction);
82 
88  using FeatureImageType = TFeatureImageType;
89 
91  itkNewMacro(Self);
92 
94  itkOverrideGetNameOfClassMacro(GeodesicActiveContourLevelSetFunction);
95 
97  using typename Superclass::ImageType;
98  using typename Superclass::NeighborhoodType;
99  using typename Superclass::ScalarValueType;
100  using typename Superclass::FeatureScalarType;
101  using typename Superclass::RadiusType;
102  using typename Superclass::FloatOffsetType;
103  using typename Superclass::VectorImageType;
104  using typename Superclass::GlobalDataStruct;
105 
107  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
108 
110  void
111  CalculateSpeedImage() override;
112 
114  void
115  CalculateAdvectionImage() override;
116 
119  CurvatureSpeed(const NeighborhoodType & neighborhood,
120  const FloatOffsetType & offset,
121  GlobalDataStruct * gd) const override
122  {
123  return this->PropagationSpeed(neighborhood, offset, gd);
124  }
125 
128  void
129  SetDerivativeSigma(const double v)
130  {
131  m_DerivativeSigma = v;
132  }
133  double
135  {
136  return m_DerivativeSigma;
137  }
140  void
141  Initialize(const RadiusType & r) override
142  {
143  Superclass::Initialize(r);
144 
145  this->SetAdvectionWeight(NumericTraits<ScalarValueType>::OneValue());
146  this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
147  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
148  }
149 
150 protected:
152  {
153  this->SetAdvectionWeight(NumericTraits<ScalarValueType>::OneValue());
154  this->SetPropagationWeight(NumericTraits<ScalarValueType>::OneValue());
155  this->SetCurvatureWeight(NumericTraits<ScalarValueType>::OneValue());
156 
157  m_DerivativeSigma = 1.0;
158  }
159 
160  ~GeodesicActiveContourLevelSetFunction() override = default;
161 
162  void
163  PrintSelf(std::ostream & os, Indent indent) const override;
164 
165 private:
166  double m_DerivativeSigma{};
167 };
168 } // end namespace itk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 # include "itkGeodesicActiveContourLevelSetFunction.hxx"
172 #endif
173 
174 #endif
itk::FiniteDifferenceFunction::RadiusType
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Definition: itkFiniteDifferenceFunction.h:97
itk::LevelSetFunction::GlobalDataStruct
Definition: itkLevelSetFunction.h:106
itk::Vector
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
itk::GeodesicActiveContourLevelSetFunction::GetDerivativeSigma
double GetDerivativeSigma()
Definition: itkGeodesicActiveContourLevelSetFunction.h:134
itk::GeodesicActiveContourLevelSetFunction::GeodesicActiveContourLevelSetFunction
GeodesicActiveContourLevelSetFunction()
Definition: itkGeodesicActiveContourLevelSetFunction.h:151
itk::GeodesicActiveContourLevelSetFunction::CurvatureSpeed
ScalarValueType CurvatureSpeed(const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override
Definition: itkGeodesicActiveContourLevelSetFunction.h:119
itk::GeodesicActiveContourLevelSetFunction
This function is used in GeodesicActiveContourLevelSetImageFilter to segment structures in an image b...
Definition: itkGeodesicActiveContourLevelSetFunction.h:77
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkSegmentationLevelSetFunction.h
itk::NumericTraits
Define additional traits for native types such as int or float.
Definition: itkNumericTraits.h:59
itk::GeodesicActiveContourLevelSetFunction::FeatureImageType
TFeatureImageType FeatureImageType
Definition: itkGeodesicActiveContourLevelSetFunction.h:88
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::GeodesicActiveContourLevelSetFunction::SetDerivativeSigma
void SetDerivativeSigma(const double v)
Definition: itkGeodesicActiveContourLevelSetFunction.h:129
itk::GeodesicActiveContourLevelSetFunction::Initialize
void Initialize(const RadiusType &r) override
Definition: itkGeodesicActiveContourLevelSetFunction.h:141