ITK  4.9.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 >
50 {
51 public:
57 
60 
63  typedef typename Superclass::MeasureType MeasureType;
64 
68 
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  throw ( ExceptionObject );
143 
144 protected:
146  virtual ~ShapePriorMAPCostFunctionBase() {}
147 
148  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
149 
152 
154 
155 private:
156  ShapePriorMAPCostFunctionBase(const Self &) ITK_DELETE_FUNCTION;
157  void operator=(const Self &) ITK_DELETE_FUNCTION;
158 };
159 } // end namespace itk
160 
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkShapePriorMAPCostFunctionBase.hxx"
163 #endif
164 
165 #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.
Light weight base class for most itk classes.
VectorContainer< unsigned int, NodeType > NodeContainerType
virtual MeasureType GetValue(const ParametersType &parameters) const override
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Base class for functions which evaluates the signed distance from a shape.
virtual MeasureType ComputeLogPosePriorTerm(const ParametersType &) const =0
Array< ParametersValueType > DerivativeType
Represent a node in a level set.
virtual MeasureType ComputeLogInsideTerm(const ParametersType &) const =0
Standard exception handling object.
Represents the base class of maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetIm...
Superclass::ParametersType ParametersType
virtual MeasureType ComputeLogShapePriorTerm(const ParametersType &) const =0
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
virtual MeasureType ComputeLogGradientTerm(const ParametersType &) const =0
ShapeSignedDistanceFunction< double, itkGetStaticConstMacro(ImageDimension) > ShapeFunctionType