ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkGeodesicActiveContourShapePriorLevelSetFunction.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 __itkGeodesicActiveContourShapePriorLevelSetFunction_h
19 #define __itkGeodesicActiveContourShapePriorLevelSetFunction_h
20 
22 
23 namespace itk
24 {
92 template< class TImageType, class TFeatureImageType = TImageType >
94  public ShapePriorSegmentationLevelSetFunction< TImageType, TFeatureImageType >
95 {
96 public:
103  typedef TFeatureImageType FeatureImageType;
104 
106  itkNewMacro(Self);
107 
111 
113  typedef typename Superclass::ImageType ImageType;
114  typedef typename Superclass::NeighborhoodType NeighborhoodType;
115  typedef typename Superclass::ScalarValueType ScalarValueType;
116  typedef typename Superclass::FeatureScalarType FeatureScalarType;
117  typedef typename Superclass::RadiusType RadiusType;
118  typedef typename Superclass::FloatOffsetType FloatOffsetType;
119  typedef typename Superclass::VectorImageType VectorImageType;
120  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
121 
123  itkStaticConstMacro(ImageDimension, unsigned int,
124  Superclass::ImageDimension);
125 
127  virtual void CalculateSpeedImage();
128 
130  virtual void CalculateAdvectionImage();
131 
133  virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
134  const FloatOffsetType & offset, GlobalDataStruct *gd) const
135  { return this->PropagationSpeed(neighborhood, offset, gd); }
136 
139  void SetDerivativeSigma(const double v)
140  { m_DerivativeSigma = v; }
141  double GetDerivativeSigma()
142  { return m_DerivativeSigma; }
144 
145  virtual void Initialize(const RadiusType & r)
146  {
147  Superclass::Initialize(r);
148 
149  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
150  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
151  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
152  this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
153  }
154 
155 protected:
157  {
158  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
159  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
160  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
161  this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
162 
163  m_DerivativeSigma = 1.0;
164  }
165 
167 
168  GeodesicActiveContourShapePriorLevelSetFunction(const Self &); //purposely not
169  // implemented
170  void operator=(const Self &); //purposely not
171  // implemented
172 
173  void PrintSelf(std::ostream & os, Indent indent) const
174  {
175  Superclass::PrintSelf(os, indent);
176  os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
177  }
178 
179 private:
181 };
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkGeodesicActiveContourShapePriorLevelSetFunction.hxx"
186 #endif
187 
188 #endif
189