ITK  5.0.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:
52  ITK_DISALLOW_COPY_AND_ASSIGN(ShapePriorMAPCostFunctionBase);
53 
59 
62 
65  using MeasureType = typename Superclass::MeasureType;
66 
69  using DerivativeType = typename Superclass::DerivativeType;
70 
73  using ParametersType = typename Superclass::ParametersType;
74 
76  using FeatureImageType = TFeatureImage;
77  using FeatureImagePointer = typename FeatureImageType::ConstPointer;
78 
80  static constexpr unsigned int ImageDimension = TFeatureImage::ImageDimension;
81 
83  using PixelType = TOutputPixel;
84 
87 
91 
94  Self::ImageDimension >;
96 
98  itkSetObjectMacro(ShapeFunction, ShapeFunctionType);
99  itkGetModifiableObjectMacro(ShapeFunction, ShapeFunctionType);
101 
103  itkSetConstObjectMacro(ActiveRegion, NodeContainerType);
104  itkGetConstObjectMacro(ActiveRegion, NodeContainerType);
106 
108  itkSetConstObjectMacro(FeatureImage, FeatureImageType);
109  itkGetConstObjectMacro(FeatureImage, FeatureImageType);
111 
114  MeasureType GetValue(const ParametersType & parameters) const override;
115 
118  void GetDerivative(const ParametersType &, DerivativeType &) const override
119  { itkExceptionMacro(<< "This function is currently not supported."); }
120 
122  unsigned int GetNumberOfParameters() const override
123  { return m_ShapeFunction->GetNumberOfParameters(); }
124 
127  virtual MeasureType ComputeLogInsideTerm(const ParametersType &) const = 0;
128 
131  virtual MeasureType ComputeLogGradientTerm(const ParametersType &) const = 0;
132 
135  virtual MeasureType ComputeLogShapePriorTerm(const ParametersType &) const = 0;
136 
139  virtual MeasureType ComputeLogPosePriorTerm(const ParametersType &) const = 0;
140 
143  virtual void Initialize();
144 
145 protected:
147  ~ShapePriorMAPCostFunctionBase() override = default;
148 
149  void PrintSelf(std::ostream & os, Indent indent) const override;
150 
153 
155 };
156 } // end namespace itk
157 
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "itkShapePriorMAPCostFunctionBase.hxx"
160 #endif
161 
162 #endif
Array class with size defined at construction time.
Definition: itkArray.h:46
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
Base class for functions which evaluates the signed distance from a shape.
typename FeatureImageType::ConstPointer FeatureImagePointer
Represent a node in a level set.
Represents the base class of maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetIm...
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
typename NodeContainerType::ConstPointer NodeContainerPointer
typename ShapeFunctionType::Pointer ShapeFunctionPointer
void GetDerivative(const ParametersType &, DerivativeType &) const override