ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkShapePriorSegmentationLevelSetFunction.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 __itkShapePriorSegmentationLevelSetFunction_h
19 #define __itkShapePriorSegmentationLevelSetFunction_h
20 
23 
24 namespace itk
25 {
54 template< class TImageType, class TFeatureImageType = TImageType >
56  public SegmentationLevelSetFunction< TImageType, TFeatureImageType >
57 {
58 public:
65  typedef TFeatureImageType FeatureImageType;
66 
68  itkNewMacro(Self);
69 
72 
74  typedef typename Superclass::ImageType ImageType;
75  typedef typename Superclass::NeighborhoodType NeighborhoodType;
76  typedef typename Superclass::ScalarValueType ScalarValueType;
77  typedef typename Superclass::FeatureScalarType FeatureScalarType;
78  typedef typename Superclass::RadiusType RadiusType;
79  typedef typename Superclass::FloatOffsetType FloatOffsetType;
80  typedef typename Superclass::VectorImageType VectorImageType;
81  typedef typename Superclass::PixelType PixelType;
82  typedef typename Superclass::TimeStepType TimeStepType;
83  typedef typename Superclass::IndexType IndexType;
84  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
85 
87  itkStaticConstMacro(ImageDimension, unsigned int,
88  Superclass::ImageDimension);
89 
91  typedef ShapeSignedDistanceFunction< double,
92  itkGetStaticConstMacro(ImageDimension) > ShapeFunctionType;
94 
96  void SetShapePriorWeight(const ScalarValueType p)
97  { m_ShapePriorWeight = p; }
98  ScalarValueType GetShapePriorWeight() const
99  { return m_ShapePriorWeight; }
101 
104  void SetShapeFunction(const ShapeFunctionType *ptr)
105  { m_ShapeFunction = ptr; }
106  const ShapeFunctionType * GetShapeFunction() const
107  { return m_ShapeFunction; }
109 
111  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
112  void *globalData,
113  const FloatOffsetType & = FloatOffsetType(0.0) );
114 
116  virtual TimeStepType ComputeGlobalTimeStep(void *globalData) const;
117 
120  typedef typename Superclass::GlobalDataStruct GlobalDataStruct;
123  };
124 
126  virtual void * GetGlobalDataPointer() const
127  {
129 
134  return ans;
135  }
136 
138  virtual void ReleaseGlobalDataPointer(void *GlobalData) const
139  { delete (ShapePriorGlobalDataStruct *)GlobalData; }
140 
141 protected:
144 
145  ShapePriorSegmentationLevelSetFunction(const Self &); //purposely not
146  // implemented
147  void operator=(const Self &); //purposely not
148  // implemented
149 
150  void PrintSelf(std::ostream & os, Indent indent) const;
151 
152 private:
153 
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkShapePriorSegmentationLevelSetFunction.hxx"
161 #endif
162 
163 #endif
164