ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkShapePriorSegmentationLevelSetImageFilter.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 itkShapePriorSegmentationLevelSetImageFilter_h
19 #define itkShapePriorSegmentationLevelSetImageFilter_h
20 
25 #include "itkMath.h"
26 
27 namespace itk
28 {
72 template< typename TInputImage,
73  typename TFeatureImage,
74  typename TOutputPixelType = float >
76  public SegmentationLevelSetImageFilter< TInputImage, TFeatureImage,
77  TOutputPixelType >
78 {
79 public:
80  ITK_DISALLOW_COPY_AND_ASSIGN(ShapePriorSegmentationLevelSetImageFilter);
81 
83  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
84 
87  using Superclass =
91 
94 
96  using ValueType = typename Superclass::ValueType;
97  using OutputImageType = typename Superclass::OutputImageType;
98  using FeatureImageType = typename Superclass::FeatureImageType;
99 
101  using OutputPixelType = TOutputPixelType;
102 
106 
109  using ShapeFunctionPointer = typename ShapeFunctionType::Pointer;
110 
115 
119  using NodeContainerPointer = typename NodeContainerType::Pointer;
120 
125 
127  virtual void SetShapeFunction(ShapeFunctionType *s);
128  itkGetModifiableObjectMacro(ShapeFunction, ShapeFunctionType);
130 
132  itkSetObjectMacro(CostFunction, CostFunctionType);
133  itkGetModifiableObjectMacro(CostFunction, CostFunctionType);
135 
137  itkSetObjectMacro(Optimizer, OptimizerType);
138  itkGetModifiableObjectMacro(Optimizer, OptimizerType);
140 
145  itkSetMacro(InitialParameters, ParametersType);
146  itkGetConstMacro(InitialParameters, ParametersType);
148 
151  {
152  if ( Math::NotExactlyEquals(v, m_ShapePriorSegmentationFunction->GetShapePriorWeight()) )
153  {
154  m_ShapePriorSegmentationFunction->SetShapePriorWeight(v);
155  this->Modified();
156  }
157  }
159 
161  {
162  return m_ShapePriorSegmentationFunction->GetShapePriorWeight();
163  }
164 
167  virtual void SetShapePriorSegmentationFunction(ShapePriorSegmentationFunctionType *s);
168 
170  { return m_ShapePriorSegmentationFunction; }
171 
173  itkGetConstReferenceMacro(CurrentParameters, ParametersType);
174 
175 protected:
176  ~ShapePriorSegmentationLevelSetImageFilter() override = default;
178 
179  void PrintSelf(std::ostream & os, Indent indent) const override;
180 
183  void InitializeIteration() override;
184 
187  void GenerateData() override;
188 
190  void ExtractActiveRegion(NodeContainerType *ptr);
191 
192 private:
198 
200 };
201 } // end namespace itk
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "itkShapePriorSegmentationLevelSetImageFilter.hxx"
205 #endif
206 
207 #endif
Light weight base class for most itk classes.
This class is a base for the Optimization methods that optimize a single valued function.
typename Superclass::ParametersType ParametersType
This function is used in ShapePriorSegmentationLevelSetFilter to segment structures in an image based...
Base class for functions which evaluates the signed distance from a shape.
Represent a node in a level set.
Generic representation for an optimization method.
Definition: itkOptimizer.h:38
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Definition: itkMath.h:718
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.
virtual ShapePriorSegmentationFunctionType * GetShapePriorSegmentationFunction()
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename ShapePriorSegmentationFunctionType::ShapeFunctionType ShapeFunctionType
A base class which defines the API for implementing a special class of image segmentation filters usi...
Templated n-dimensional image class.
Definition: itkImage.h:75
A base class which defines the API for implementing a level set segmentation filter with statistical ...