ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGeodesicActiveContourShapePriorLevelSetFunction.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkGeodesicActiveContourShapePriorLevelSetFunction_h
00019 #define __itkGeodesicActiveContourShapePriorLevelSetFunction_h
00020 
00021 #include "itkShapePriorSegmentationLevelSetFunction.h"
00022 
00023 namespace itk
00024 {
00092 template< class TImageType, class TFeatureImageType = TImageType >
00093 class ITK_EXPORT GeodesicActiveContourShapePriorLevelSetFunction:
00094   public ShapePriorSegmentationLevelSetFunction< TImageType, TFeatureImageType >
00095 {
00096 public:
00098   typedef GeodesicActiveContourShapePriorLevelSetFunction
00099   Self;
00100   typedef ShapePriorSegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass;
00101   typedef SmartPointer< Self >                                                    Pointer;
00102   typedef SmartPointer< const Self >                                              ConstPointer;
00103   typedef TFeatureImageType                                                       FeatureImageType;
00104 
00106   itkNewMacro(Self);
00107 
00109   itkTypeMacro(GeodesicActiveContourShapePriorLevelSetFunction,
00110                ShapePriorSegmentationLevelSetFunction);
00111 
00113   typedef typename Superclass::ImageType         ImageType;
00114   typedef typename Superclass::NeighborhoodType  NeighborhoodType;
00115   typedef typename Superclass::ScalarValueType   ScalarValueType;
00116   typedef typename Superclass::FeatureScalarType FeatureScalarType;
00117   typedef typename Superclass::RadiusType        RadiusType;
00118   typedef typename Superclass::FloatOffsetType   FloatOffsetType;
00119   typedef typename Superclass::VectorImageType   VectorImageType;
00120   typedef typename Superclass::GlobalDataStruct  GlobalDataStruct;
00121 
00123   itkStaticConstMacro(ImageDimension, unsigned int,
00124                       Superclass::ImageDimension);
00125 
00127   virtual void CalculateSpeedImage();
00128 
00130   virtual void CalculateAdvectionImage();
00131 
00133   virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
00134                                          const FloatOffsetType & offset, GlobalDataStruct *gd) const
00135   { return this->PropagationSpeed(neighborhood, offset, gd); }
00136 
00139   void SetDerivativeSigma(const double v)
00140   { m_DerivativeSigma = v; }
00141   double GetDerivativeSigma()
00142   { return m_DerivativeSigma; }
00144 
00145   virtual void Initialize(const RadiusType & r)
00146   {
00147     Superclass::Initialize(r);
00148 
00149     this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
00150     this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
00151     this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
00152     this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
00153   }
00154 
00155 protected:
00156   GeodesicActiveContourShapePriorLevelSetFunction()
00157   {
00158     this->SetAdvectionWeight(NumericTraits< ScalarValueType >::One);
00159     this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
00160     this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
00161     this->SetShapePriorWeight(NumericTraits< ScalarValueType >::One);
00162 
00163     m_DerivativeSigma = 1.0;
00164   }
00165 
00166   virtual ~GeodesicActiveContourShapePriorLevelSetFunction() {}
00167 
00168   GeodesicActiveContourShapePriorLevelSetFunction(const Self &); //purposely not
00169                                                                  // implemented
00170   void operator=(const Self &);                                  //purposely not
00171                                                                  // implemented
00172 
00173   void PrintSelf(std::ostream & os, Indent indent) const
00174   {
00175     Superclass::PrintSelf(os, indent);
00176     os << indent << "DerivativeSigma: " << m_DerivativeSigma << std::endl;
00177   }
00178 
00179 private:
00180   double m_DerivativeSigma;
00181 };
00182 } // end namespace itk
00183 
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "itkGeodesicActiveContourShapePriorLevelSetFunction.hxx"
00186 #endif
00187 
00188 #endif
00189