ITK  4.13.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< typename TFeatureImage, typename TOutputPixel >
48 class ITK_TEMPLATE_EXPORT ShapePriorMAPCostFunctionBase:
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 ITK_OVERRIDE;
113 
116  virtual void GetDerivative(const ParametersType &, DerivativeType &) const ITK_OVERRIDE
117  { itkExceptionMacro(<< "This function is currently not supported."); }
118 
120  virtual unsigned int GetNumberOfParameters(void) const ITK_OVERRIDE
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 
143 protected:
145  virtual ~ShapePriorMAPCostFunctionBase() ITK_OVERRIDE {}
146 
147  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
148 
151 
153 
154 private:
155  ITK_DISALLOW_COPY_AND_ASSIGN(ShapePriorMAPCostFunctionBase);
156 };
157 } // end namespace itk
158 
159 #ifndef ITK_MANUAL_INSTANTIATION
160 #include "itkShapePriorMAPCostFunctionBase.hxx"
161 #endif
162 
163 #endif
Array class with size defined at construction time.
Definition: itkArray.h:50
NodeContainerType::ConstPointer NodeContainerPointer
This class is a base for the CostFunctions returning a single value.
VectorContainer< unsigned int, NodeType > NodeContainerType
Base class for functions which evaluates the signed distance from a shape.
Represent a node in a level set.
Represents the base class of maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetIm...
FeatureImageType::ConstPointer FeatureImagePointer
virtual void GetDerivative(const ParametersType &, DerivativeType &) const override
virtual unsigned int GetNumberOfParameters(void) const override
Define a front-end to the STL &quot;vector&quot; container that conforms to the IndexedContainerInterface.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
LevelSetNode< PixelType, itkGetStaticConstMacro(ImageDimension) > NodeType
ShapeSignedDistanceFunction< double, itkGetStaticConstMacro(ImageDimension) > ShapeFunctionType