ITK  6.0.0
Insight Toolkit
itkShapePriorMAPCostFunctionBase.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
25namespace itk
26{
47template <typename TFeatureImage, typename TOutputPixel>
49{
50public:
51 ITK_DISALLOW_COPY_AND_MOVE(ShapePriorMAPCostFunctionBase);
52
58
60 itkOverrideGetNameOfClassMacro(ShapePriorMAPCostFunctionBase);
61
64 using typename Superclass::MeasureType;
65
68 using typename Superclass::DerivativeType;
69
72 using typename Superclass::ParametersType;
73
75 using FeatureImageType = TFeatureImage;
77
79 static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension;
80
82 using PixelType = TOutputPixel;
83
86
90
94
96 itkSetObjectMacro(ShapeFunction, ShapeFunctionType);
97 itkGetModifiableObjectMacro(ShapeFunction, ShapeFunctionType);
101 itkSetConstObjectMacro(ActiveRegion, NodeContainerType);
102 itkGetConstObjectMacro(ActiveRegion, NodeContainerType);
106 itkSetConstObjectMacro(FeatureImage, FeatureImageType);
107 itkGetConstObjectMacro(FeatureImage, FeatureImageType);
113 GetValue(const ParametersType & parameters) const override;
114
117 void
118 GetDerivative(const ParametersType &, DerivativeType &) const override
119 {
120 itkExceptionMacro("This function is currently not supported.");
121 }
122
124 unsigned int
125 GetNumberOfParameters() const override
126 {
127 return m_ShapeFunction->GetNumberOfParameters();
128 }
129
132 virtual MeasureType
134
137 virtual MeasureType
139
142 virtual MeasureType
144
147 virtual MeasureType
149
152 virtual void
154
155protected:
157 ~ShapePriorMAPCostFunctionBase() override = default;
158
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override;
161
162 ShapeFunctionPointer m_ShapeFunction{};
163 NodeContainerPointer m_ActiveRegion{};
164
165 FeatureImagePointer m_FeatureImage{};
166};
167} // end namespace itk
168
169#ifndef ITK_MANUAL_INSTANTIATION
170# include "itkShapePriorMAPCostFunctionBase.hxx"
171#endif
172
173#endif
Array class with size defined at construction time.
Definition: itkArray.h:48
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Represent a node in a level set.
Light weight base class for most itk classes.
Represents the base class of maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetIm...
void PrintSelf(std::ostream &os, Indent indent) const override
virtual MeasureType ComputeLogPosePriorTerm(const ParametersType &) const =0
typename ShapeFunctionType::Pointer ShapeFunctionPointer
typename NodeContainerType::ConstPointer NodeContainerPointer
void GetDerivative(const ParametersType &, DerivativeType &) const override
~ShapePriorMAPCostFunctionBase() override=default
typename FeatureImageType::ConstPointer FeatureImagePointer
virtual MeasureType ComputeLogInsideTerm(const ParametersType &) const =0
MeasureType GetValue(const ParametersType &parameters) const override
virtual MeasureType ComputeLogShapePriorTerm(const ParametersType &) const =0
virtual MeasureType ComputeLogGradientTerm(const ParametersType &) const =0
Base class for functions which evaluates the signed distance from a shape.
This class is a base for the CostFunctions returning a single value.
Superclass::ParametersType ParametersType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....