ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkShapeDetectionLevelSetFunction.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 __itkShapeDetectionLevelSetFunction_h
19 #define __itkShapeDetectionLevelSetFunction_h
20 
22 
23 namespace itk
24 {
71 template< class TImageType, class TFeatureImageType = TImageType >
73  public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
74 {
75 public:
81  typedef TFeatureImageType FeatureImageType;
82 
84  itkNewMacro(Self);
85 
88 
90  typedef typename Superclass::ImageType ImageType;
91  typedef typename Superclass::NeighborhoodType NeighborhoodType;
92  typedef typename Superclass::ScalarValueType ScalarValueType;
93  typedef typename Superclass::FeatureScalarType FeatureScalarType;
94  typedef typename Superclass::RadiusType RadiusType;
95  typedef typename Superclass::FloatOffsetType FloatOffsetType;
96  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
97 
99  itkStaticConstMacro(ImageDimension, unsigned int,
100  Superclass::ImageDimension);
101 
102  virtual void CalculateSpeedImage();
103 
105  virtual ScalarValueType CurvatureSpeed(const NeighborhoodType & neighborhood,
106  const FloatOffsetType & offset, GlobalDataStruct *gd) const
107  { return this->PropagationSpeed(neighborhood, offset, gd); }
108 
109  virtual void Initialize(const RadiusType & r)
110  {
111  Superclass::Initialize(r);
112 
113  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::Zero);
114  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
115  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
116  }
117 
118 protected:
120  {
121  this->SetAdvectionWeight(NumericTraits< ScalarValueType >::Zero);
122  this->SetPropagationWeight(NumericTraits< ScalarValueType >::One);
123  this->SetCurvatureWeight(NumericTraits< ScalarValueType >::One);
124  }
125 
127 
128  ShapeDetectionLevelSetFunction(const Self &); //purposely not implemented
129  void operator=(const Self &); //purposely not implemented
130 };
131 } // end namespace itk
132 
133 #ifndef ITK_MANUAL_INSTANTIATION
134 #include "itkShapeDetectionLevelSetFunction.hxx"
135 #endif
136 
137 #endif
138