ITK  4.13.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:
87  typedef TFeatureImageType FeatureImageType;
88 
90  itkNewMacro(Self);
91 
94 
96  typedef typename Superclass::ImageType ImageType;
97  typedef typename Superclass::NeighborhoodType NeighborhoodType;
98  typedef typename Superclass::ScalarValueType ScalarValueType;
99  typedef typename Superclass::FeatureScalarType FeatureScalarType;
100  typedef typename Superclass::RadiusType RadiusType;
101  typedef typename Superclass::FloatOffsetType FloatOffsetType;
102  typedef typename Superclass::VectorImageType VectorImageType;
103  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
104 
106  itkStaticConstMacro(ImageDimension, unsigned int,
107  Superclass::ImageDimension);
108 
110  virtual void CalculateSpeedImage() ITK_OVERRIDE;
111 
113  virtual void CalculateAdvectionImage() ITK_OVERRIDE;
114 
116  virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
117  const FloatOffsetType & offset, GlobalDataStruct *gd) const ITK_OVERRIDE
118  {
119  return this->PropagationSpeed(neighborhood, offset, gd);
120  }
121 
124  void SetDerivativeSigma(const double v)
125  { m_DerivativeSigma = v; }
127  { return m_DerivativeSigma; }
129 
130  virtual void Initialize(const RadiusType & r) ITK_OVERRIDE
131  {
132  Superclass::Initialize(r);
133 
134  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::OneValue());
135  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
136  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
137  }
138 
139 protected:
141  {
142  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::OneValue());
143  this->SetPropagationWeight(NumericTraits< ScalarValueType >::OneValue());
144  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::OneValue());
145 
146  m_DerivativeSigma = 1.0;
147  }
148 
149  virtual ~GeodesicActiveContourLevelSetFunction() ITK_OVERRIDE {}
150 
151  ITK_DISALLOW_COPY_AND_ASSIGN(GeodesicActiveContourLevelSetFunction);
152 
153  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
154 
155 private:
157 };
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkGeodesicActiveContourLevelSetFunction.hxx"
162 #endif
163 
164 #endif
Light weight base class for most itk classes.
ConstNeighborhoodIterator< TImageType >::RadiusType RadiusType
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
This function is used in GeodesicActiveContourLevelSetImageFilter to segment structures in an image b...
Define additional traits for native types such as int or float.