ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkLaplacianSegmentationLevelSetFunction.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 __itkLaplacianSegmentationLevelSetFunction_h
00019 #define __itkLaplacianSegmentationLevelSetFunction_h
00020 
00021 #include "itkSegmentationLevelSetFunction.h"
00022 
00023 namespace itk
00024 {
00033 template< class TImageType, class TFeatureImageType = TImageType >
00034 class ITK_EXPORT LaplacianSegmentationLevelSetFunction:
00035   public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
00036 {
00037 public:
00039   typedef LaplacianSegmentationLevelSetFunction Self;
00040   typedef SegmentationLevelSetFunction< TImageType, TFeatureImageType >
00041   Superclass;
00042   typedef SmartPointer< Self >       Pointer;
00043   typedef SmartPointer< const Self > ConstPointer;
00044   typedef TFeatureImageType          FeatureImageType;
00045 
00047   itkNewMacro(Self);
00048 
00050   itkTypeMacro(LaplacianSegmentationLevelSetFunction, SegmentationLevelSetFunction);
00051 
00053   typedef typename Superclass::ImageType         ImageType;
00054   typedef typename Superclass::ScalarValueType   ScalarValueType;
00055   typedef typename Superclass::FeatureScalarType FeatureScalarType;
00056   typedef typename Superclass::RadiusType        RadiusType;
00057 
00059   itkStaticConstMacro(ImageDimension, unsigned int,
00060                       Superclass::ImageDimension);
00061 
00062   virtual void CalculateSpeedImage();
00063 
00064   virtual void Initialize(const RadiusType & r)
00065   {
00066     Superclass::Initialize(r);
00067 
00068     this->SetAdvectionWeight(NumericTraits< ScalarValueType >::Zero);
00069     this->SetPropagationWeight(-1.0 * NumericTraits< ScalarValueType >::One);
00070     this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
00071   }
00072 
00079   void SetAdvectionWeight(const ScalarValueType value)
00080   {
00081     if ( value == NumericTraits< ScalarValueType >::Zero )
00082       {
00083       Superclass::SetAdvectionWeight(value);
00084       }
00085   }
00087 
00088 protected:
00089 
00090   LaplacianSegmentationLevelSetFunction()
00091   {
00092     this->SetAdvectionWeight(0.0);
00093     this->SetPropagationWeight(1.0);
00094     this->SetCurvatureWeight(1.0);
00095   }
00096 
00097   virtual ~LaplacianSegmentationLevelSetFunction() {}
00098 
00099   LaplacianSegmentationLevelSetFunction(const Self &); //purposely not
00100                                                        // implemented
00101   void operator=(const Self &);                        //purposely not
00102                                                        // implemented
00103 };
00104 } // end namespace itk
00105 
00106 #ifndef ITK_MANUAL_INSTANTIATION
00107 #include "itkLaplacianSegmentationLevelSetFunction.hxx"
00108 #endif
00109 
00110 #endif
00111