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 
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 
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
123  SetShapeFunction(ShapeFunctionType * s);
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
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:
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
itk::SegmentationLevelSetImageFilter
A base class which defines the API for implementing a special class of image segmentation filters usi...
Definition: itkSegmentationLevelSetImageFilter.h:144
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::OptimizerParameters< TInternalComputationValueType >
itk::SingleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearOptimizer.h:35
itk::detail::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:51
itk::Optimizer
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
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::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::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:55
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::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: itkAnatomicalOrientation.h:29
itk::ShapePriorSegmentationLevelSetImageFilter::ShapeFunctionPointer
typename ShapeFunctionType::Pointer ShapeFunctionPointer
Definition: itkShapePriorSegmentationLevelSetImageFilter.h:104
itkShapePriorMAPCostFunctionBase.h
itk::SparseFieldLevelSetImageFilter< TInputImage, Image< TOutputPixelType, TInputImage::ImageDimension > >::ValueType
typename OutputImageType::ValueType ValueType
Definition: itkSparseFieldLevelSetImageFilter.h:274
itkSingleValuedNonLinearOptimizer.h
itkMath.h
itk::ShapePriorSegmentationLevelSetImageFilter::CostFunctionPointer
typename CostFunctionType::Pointer CostFunctionPointer
Definition: itkShapePriorSegmentationLevelSetImageFilter.h:108