ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGeodesicActiveContourLevelSetFunction.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 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_ASSIGN(GeodesicActiveContourLevelSetFunction);
82 
85  using Superclass =
89  using FeatureImageType = TFeatureImageType;
90 
92  itkNewMacro(Self);
93 
96 
98  using ImageType = typename Superclass::ImageType;
99  using NeighborhoodType = typename Superclass::NeighborhoodType;
100  using ScalarValueType = typename Superclass::ScalarValueType;
101  using FeatureScalarType = typename Superclass::FeatureScalarType;
102  using RadiusType = typename Superclass::RadiusType;
103  using FloatOffsetType = typename Superclass::FloatOffsetType;
104  using VectorImageType = typename Superclass::VectorImageType;
105  using GlobalDataStruct = typename Superclass::GlobalDataStruct;
106 
108  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
109 
111  void CalculateSpeedImage() override;
112 
114  void CalculateAdvectionImage() override;
115 
118  const FloatOffsetType & offset, GlobalDataStruct *gd) const override
119  {
120  return this->PropagationSpeed(neighborhood, offset, gd);
121  }
122 
125  void SetDerivativeSigma(const double v)
126  { m_DerivativeSigma = v; }
128  { return m_DerivativeSigma; }
130 
131  void Initialize(const RadiusType & r) override
132  {
133  Superclass::Initialize(r);
134 
135  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::OneValue());
136  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
137  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
138  }
139 
140 protected:
142  {
143  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::OneValue());
144  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
145  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
146 
147  m_DerivativeSigma = 1.0;
148  }
149 
150  ~GeodesicActiveContourLevelSetFunction() override = default;
151 
152  void PrintSelf(std::ostream & os, Indent indent) const override;
153 
154 private:
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkGeodesicActiveContourLevelSetFunction.hxx"
161 #endif
162 
163 #endif
Light weight base class for most itk classes.
Define numeric traits for std::vector.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
ScalarValueType CurvatureSpeed(const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
This function is used in GeodesicActiveContourLevelSetImageFilter to segment structures in an image b...