ITK  4.4.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< class TImageType, class TFeatureImageType = TImageType >
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();
111 
113  virtual void CalculateAdvectionImage();
114 
116  virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
117  const FloatOffsetType & offset, GlobalDataStruct *gd) const
118  {
119  return this->PropagationSpeed(neighborhood, offset, gd);
120  }
121 
124  void SetDerivativeSigma(const double v)
125  { m_DerivativeSigma = v; }
126  double GetDerivativeSigma()
127  { return m_DerivativeSigma; }
129 
130  virtual void Initialize(const RadiusType & r)
131  {
132  Superclass::Initialize(r);
133 
134  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
135  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
136  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
137  }
138 
139 protected:
141  {
142  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
143  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
144  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
145 
146  m_DerivativeSigma = 1.0;
147  }
148 
150 
151  GeodesicActiveContourLevelSetFunction(const Self &); //purposely not
152  // implemented
153  void operator=(const Self &); //purposely not
154  // implemented
155 
156  void PrintSelf(std::ostream & os, Indent indent) const
157  {
158  Superclass::PrintSelf(os, indent);
159  os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
160  }
161 
162 private:
164 };
165 } // end namespace itk
166 
167 #ifndef ITK_MANUAL_INSTANTIATION
168 #include "itkGeodesicActiveContourLevelSetFunction.hxx"
169 #endif
170 
171 #endif
172