ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkShapeDetectionLevelSetFunction.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 __itkShapeDetectionLevelSetFunction_h
00019 #define __itkShapeDetectionLevelSetFunction_h
00020 
00021 #include "itkSegmentationLevelSetFunction.h"
00022 
00023 namespace itk
00024 {
00071 template< class TImageType, class TFeatureImageType = TImageType >
00072 class ITK_EXPORT ShapeDetectionLevelSetFunction:
00073   public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
00074 {
00075 public:
00077   typedef ShapeDetectionLevelSetFunction                                Self;
00078   typedef SegmentationLevelSetFunction< TImageType, TFeatureImageType > Superclass;
00079   typedef SmartPointer< Self >                                          Pointer;
00080   typedef SmartPointer< const Self >                                    ConstPointer;
00081   typedef TFeatureImageType                                             FeatureImageType;
00082 
00084   itkNewMacro(Self);
00085 
00087   itkTypeMacro(ShapeDetectionLevelSetFunction, SegmentationLevelSetFunction);
00088 
00090   typedef typename Superclass::ImageType         ImageType;
00091   typedef typename Superclass::NeighborhoodType  NeighborhoodType;
00092   typedef typename Superclass::ScalarValueType   ScalarValueType;
00093   typedef typename Superclass::FeatureScalarType FeatureScalarType;
00094   typedef typename Superclass::RadiusType        RadiusType;
00095   typedef typename Superclass::FloatOffsetType   FloatOffsetType;
00096   typedef typename Superclass::GlobalDataStruct  GlobalDataStruct;
00097 
00099   itkStaticConstMacro(ImageDimension, unsigned int,
00100                       Superclass::ImageDimension);
00101 
00102   virtual void CalculateSpeedImage();
00103 
00105   virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
00106                                          const FloatOffsetType & offset, GlobalDataStruct *gd) const
00107   { return this->PropagationSpeed(neighborhood, offset, gd); }
00108 
00109   virtual void Initialize(const RadiusType & r)
00110   {
00111     Superclass::Initialize(r);
00112 
00113     this->SetAdvectionWeight(NumericTraits< ScalarValueType >::Zero);
00114     this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
00115     this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
00116   }
00117 
00118 protected:
00119   ShapeDetectionLevelSetFunction()
00120   {
00121     this->SetAdvectionWeight(NumericTraits< ScalarValueType >::Zero);
00122     this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
00123     this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
00124   }
00125 
00126   virtual ~ShapeDetectionLevelSetFunction() {}
00127 
00128   ShapeDetectionLevelSetFunction(const Self &); //purposely not implemented
00129   void operator=(const Self &);                 //purposely not implemented
00130 };
00131 } // end namespace itk
00132 
00133 #ifndef ITK_MANUAL_INSTANTIATION
00134 #include "itkShapeDetectionLevelSetFunction.hxx"
00135 #endif
00136 
00137 #endif
00138