ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkShapePriorMAPCostFunction.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 __itkShapePriorMAPCostFunction_h
00019 #define __itkShapePriorMAPCostFunction_h
00020 
00021 #include "itkShapePriorMAPCostFunctionBase.h"
00022 #include "itkGaussianKernelFunction.h"
00023 
00024 namespace itk
00025 {
00049 template< class TFeatureImage, class TOutputPixel >
00050 class ITK_EXPORT ShapePriorMAPCostFunction:
00051   public ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel >
00052 {
00053 public:
00055   typedef ShapePriorMAPCostFunction                                    Self;
00056   typedef ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixel > Superclass;
00057   typedef SmartPointer< Self >                                         Pointer;
00058   typedef SmartPointer< const Self >                                   ConstPointer;
00059 
00061   itkNewMacro(Self);
00062 
00064   itkTypeMacro(ShapePriorMAPCostFunction, ShapePriorMAPCostFunctionBase);
00065 
00068   typedef typename Superclass::ParametersType ParametersType;
00069 
00071   typedef typename Superclass::FeatureImageType    FeatureImageType;
00072   typedef typename Superclass::FeatureImagePointer FeatureImagePointer;
00073 
00075   typedef typename Superclass::MeasureType MeasureType;
00076 
00078   itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImage::ImageDimension);
00079 
00081   typedef typename Superclass::PixelType PixelType;
00082 
00084   typedef typename Superclass::NodeType NodeType;
00085 
00087   typedef typename Superclass::NodeContainerType NodeContainerType;
00088 
00090   typedef typename Superclass::ShapeFunctionType ShapeFunctionType;
00091 
00095   typedef Array< double > ArrayType;
00096 
00098   itkSetMacro(ShapeParameterMeans, ArrayType);
00099   itkGetConstMacro(ShapeParameterMeans, ArrayType);
00101 
00103   itkSetMacro(ShapeParameterStandardDeviations, ArrayType);
00104   itkGetConstMacro(ShapeParameterStandardDeviations, ArrayType);
00106 
00111   typedef FixedArray< double, 4 > WeightsType;
00112   itkSetMacro(Weights, WeightsType);
00113   itkGetConstReferenceMacro(Weights, WeightsType);
00115 
00121   virtual MeasureType ComputeLogInsideTerm(const ParametersType & parameters) const;
00122 
00128   virtual MeasureType ComputeLogGradientTerm(const ParametersType & parameters) const;
00129 
00134   virtual MeasureType ComputeLogShapePriorTerm(const ParametersType & parameters) const;
00135 
00139   virtual MeasureType ComputeLogPosePriorTerm(const ParametersType & parameters) const;
00140 
00143   virtual void Initialize(void)
00144   throw ( ExceptionObject );
00145 
00146 protected:
00147   ShapePriorMAPCostFunction();
00148   virtual ~ShapePriorMAPCostFunction() {}
00149 
00150   void PrintSelf(std::ostream & os, Indent indent) const;
00151 
00152 private:
00153   ShapePriorMAPCostFunction(const Self &); //purposely not implemented
00154   void operator=(const Self &);            //purposely not implemented
00155 
00156   ArrayType   m_ShapeParameterMeans;
00157   ArrayType   m_ShapeParameterStandardDeviations;
00158   WeightsType m_Weights;
00159 
00160   typename GaussianKernelFunction<double>::Pointer m_GaussianFunction;
00161 };
00162 } // end namespace itk
00163 
00164 #ifndef ITK_MANUAL_INSTANTIATION
00165 #include "itkShapePriorMAPCostFunction.hxx"
00166 #endif
00167 
00168 #endif
00169