ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkShapePriorMAPCostFunctionBase.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 __itkShapePriorMAPCostFunctionBase_h
19 #define __itkShapePriorMAPCostFunctionBase_h
20 
22 #include "itkLevelSet.h"
24 
25 namespace itk
26 {
47 template< class TFeatureImage, class TOutputPixel >
50 {
51 public:
57 
60 
63  typedef typename Superclass::MeasureType MeasureType;
64 
67  typedef typename Superclass::DerivativeType DerivativeType;
68 
71  typedef typename Superclass::ParametersType ParametersType;
72 
74  typedef TFeatureImage FeatureImageType;
75  typedef typename FeatureImageType::ConstPointer FeatureImagePointer;
76 
78  itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension);
79 
81  typedef TOutputPixel PixelType;
82 
85 
89 
91  typedef ShapeSignedDistanceFunction< double,
92  itkGetStaticConstMacro(ImageDimension) > ShapeFunctionType;
94 
96  itkSetObjectMacro(ShapeFunction, ShapeFunctionType);
97  itkGetModifiableObjectMacro(ShapeFunction, ShapeFunctionType);
99 
101  itkSetConstObjectMacro(ActiveRegion, NodeContainerType);
102  itkGetConstObjectMacro(ActiveRegion, NodeContainerType);
104 
106  itkSetConstObjectMacro(FeatureImage, FeatureImageType);
107  itkGetConstObjectMacro(FeatureImage, FeatureImageType);
109 
112  virtual MeasureType GetValue(const ParametersType & parameters) const;
113 
116  virtual void GetDerivative(const ParametersType &, DerivativeType &) const
117  { itkExceptionMacro(<< "This function is currently not supported."); }
118 
120  virtual unsigned int GetNumberOfParameters(void) const
121  { return m_ShapeFunction->GetNumberOfParameters(); }
122 
125  virtual MeasureType ComputeLogInsideTerm(const ParametersType &) const = 0;
126 
129  virtual MeasureType ComputeLogGradientTerm(const ParametersType &) const = 0;
130 
133  virtual MeasureType ComputeLogShapePriorTerm(const ParametersType &) const = 0;
134 
137  virtual MeasureType ComputeLogPosePriorTerm(const ParametersType &) const = 0;
138 
141  virtual void Initialize(void)
142  throw ( ExceptionObject );
143 
144 protected:
146  virtual ~ShapePriorMAPCostFunctionBase() {}
147 
148  void PrintSelf(std::ostream & os, Indent indent) const;
149 
152 
154 
155 private:
156  ShapePriorMAPCostFunctionBase(const Self &); //purposely not implemented
157  void operator=(const Self &); //purposely not implemented
158 };
159 } // end namespace itk
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkShapePriorMAPCostFunctionBase.hxx"
163 #endif
164 
165 #endif
166