00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkShapePriorMAPCostFunction_h
00018 #define __itkShapePriorMAPCostFunction_h
00019
00020 #include "itkShapePriorMAPCostFunctionBase.h"
00021 #include "itkGaussianKernelFunction.h"
00022
00023 namespace itk
00024 {
00025
00048 template <class TFeatureImage, class TOutputPixel>
00049 class ITK_EXPORT ShapePriorMAPCostFunction :
00050 public ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel>
00051 {
00052 public:
00054 typedef ShapePriorMAPCostFunction Self;
00055 typedef ShapePriorMAPCostFunctionBase<TFeatureImage,TOutputPixel> Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 itkNewMacro(Self);
00061
00063 itkTypeMacro( ShapePriorMAPCostFunction, ShapePriorMAPCostFunctionBase );
00064
00067 typedef typename Superclass::ParametersType ParametersType;
00068
00070 typedef typename Superclass::FeatureImageType FeatureImageType;
00071 typedef typename Superclass::FeatureImagePointer FeatureImagePointer;
00072
00074 typedef typename Superclass::MeasureType MeasureType;
00075
00077 itkStaticConstMacro( ImageDimension, unsigned int, TFeatureImage::ImageDimension);
00078
00080 typedef typename Superclass::PixelType PixelType;
00081
00083 typedef typename Superclass::NodeType NodeType;
00084
00086 typedef typename Superclass::NodeContainerType NodeContainerType;
00087
00089 typedef typename Superclass::ShapeFunctionType ShapeFunctionType;
00090
00092 typedef Array<double> ArrayType;
00093
00095 itkSetMacro( ShapeParameterMeans, ArrayType );
00096 itkGetMacro( ShapeParameterMeans, ArrayType );
00098
00100 itkSetMacro( ShapeParameterStandardDeviations, ArrayType );
00101 itkGetMacro( ShapeParameterStandardDeviations, ArrayType );
00103
00107 typedef FixedArray<double,4> WeightsType;
00108 itkSetMacro( Weights, WeightsType );
00109 itkGetConstReferenceMacro( Weights, WeightsType );
00111
00117 virtual MeasureType ComputeLogInsideTerm( const ParametersType & parameters ) const;
00118
00124 virtual MeasureType ComputeLogGradientTerm( const ParametersType & parameters ) const;
00125
00130 virtual MeasureType ComputeLogShapePriorTerm( const ParametersType & parameters ) const;
00131
00135 virtual MeasureType ComputeLogPosePriorTerm( const ParametersType & parameters ) const;
00136
00139 virtual void Initialize(void) throw ( ExceptionObject );
00140
00141 protected:
00142 ShapePriorMAPCostFunction();
00143 virtual ~ShapePriorMAPCostFunction() {};
00144
00145 void PrintSelf(std::ostream& os, Indent indent) const;
00146
00147 private:
00148 ShapePriorMAPCostFunction(const Self&);
00149 void operator=(const Self&);
00150
00151 ArrayType m_ShapeParameterMeans;
00152 ArrayType m_ShapeParameterStandardDeviations;
00153 WeightsType m_Weights;
00154
00155 typename GaussianKernelFunction::Pointer m_GaussianFunction;
00156
00157 };
00158
00159
00160 }
00161
00162
00163 #ifndef ITK_MANUAL_INSTANTIATION
00164 #include "itkShapePriorMAPCostFunction.txx"
00165 #endif
00166
00167 #endif
00168
00169
00170
00171