ITK  6.0.0
Insight Toolkit
itkShapePriorSegmentationLevelSetImageFilter.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 itkShapePriorSegmentationLevelSetImageFilter_h
19#define itkShapePriorSegmentationLevelSetImageFilter_h
20
25#include "itkMath.h"
26
27namespace itk
28{
72template <typename TInputImage, typename TFeatureImage, typename TOutputPixelType = float>
74 : public SegmentationLevelSetImageFilter<TInputImage, TFeatureImage, TOutputPixelType>
75{
76public:
77 ITK_DISALLOW_COPY_AND_MOVE(ShapePriorSegmentationLevelSetImageFilter);
78
80 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
81
87
89 itkOverrideGetNameOfClassMacro(ShapePriorSegmentationLevelSetImageFilter);
90
92 using typename Superclass::ValueType;
93 using typename Superclass::OutputImageType;
94 using typename Superclass::FeatureImageType;
95
97 using OutputPixelType = TOutputPixelType;
98
101
105
110
115
120
122 virtual void
124 itkGetModifiableObjectMacro(ShapeFunction, ShapeFunctionType);
128 itkSetObjectMacro(CostFunction, CostFunctionType);
129 itkGetModifiableObjectMacro(CostFunction, CostFunctionType);
133 itkSetObjectMacro(Optimizer, OptimizerType);
134 itkGetModifiableObjectMacro(Optimizer, OptimizerType);
141 itkSetMacro(InitialParameters, ParametersType);
142 itkGetConstMacro(InitialParameters, ParametersType);
146 void
148 {
149 if (Math::NotExactlyEquals(v, m_ShapePriorSegmentationFunction->GetShapePriorWeight()))
150 {
151 m_ShapePriorSegmentationFunction->SetShapePriorWeight(v);
152 this->Modified();
153 }
154 }
157 ValueType
159 {
160 return m_ShapePriorSegmentationFunction->GetShapePriorWeight();
161 }
162
165 virtual void
167
170 {
171 return m_ShapePriorSegmentationFunction;
172 }
173
175 itkGetConstReferenceMacro(CurrentParameters, ParametersType);
176
177protected:
180
181 void
182 PrintSelf(std::ostream & os, Indent indent) const override;
183
186 void
188
191 void
192 GenerateData() override;
193
195 void
197
198private:
199 ShapeFunctionPointer m_ShapeFunction{};
200 CostFunctionPointer m_CostFunction{};
201 OptimizerPointer m_Optimizer{};
202 ParametersType m_InitialParameters{};
203 ParametersType m_CurrentParameters{};
204
205 ShapePriorSegmentationFunctionType * m_ShapePriorSegmentationFunction{};
206};
207} // end namespace itk
208
209#ifndef ITK_MANUAL_INSTANTIATION
210# include "itkShapePriorSegmentationLevelSetImageFilter.hxx"
211#endif
212
213#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Represent a node in a level set.
Light weight base class for most itk classes.
Generic representation for an optimization method.
Definition: itkOptimizer.h:39
A base class which defines the API for implementing a special class of image segmentation filters usi...
Represents the base class of maximum aprior (MAP) cost function used ShapePriorSegmentationLevelSetIm...
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
A base class which defines the API for implementing a level set segmentation filter with statistical ...
virtual void SetShapePriorSegmentationFunction(ShapePriorSegmentationFunctionType *s)
virtual void SetShapeFunction(ShapeFunctionType *s)
~ShapePriorSegmentationLevelSetImageFilter() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
void ExtractActiveRegion(NodeContainerType *ptr)
virtual ShapePriorSegmentationFunctionType * GetShapePriorSegmentationFunction()
typename ShapePriorSegmentationFunctionType::ShapeFunctionType ShapeFunctionType
Base class for functions which evaluates the signed distance from a shape.
Superclass::ParametersType ParametersType
This class is a base for the Optimization methods that optimize a single valued function.
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< Self > Pointer
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Definition: itkMath.h:733
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....