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