ITK  4.13.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 
82  itkStaticConstMacro(ImageDimension, unsigned int,
83  TInputImage::ImageDimension);
84 
91 
94 
96  typedef typename Superclass::ValueType ValueType;
97  typedef typename Superclass::OutputImageType OutputImageType;
98  typedef typename Superclass::FeatureImageType FeatureImageType;
99 
101  typedef TOutputPixelType OutputPixelType;
102 
106 
110 
115 
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:
178 
179  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
180 
183  virtual void InitializeIteration() ITK_OVERRIDE;
184 
187  void GenerateData() ITK_OVERRIDE;
188 
190  void ExtractActiveRegion(NodeContainerType *ptr);
191 
192 private:
193  ITK_DISALLOW_COPY_AND_ASSIGN(ShapePriorSegmentationLevelSetImageFilter);
194 
195  ShapeFunctionPointer m_ShapeFunction;
196  CostFunctionPointer m_CostFunction;
197  OptimizerPointer m_Optimizer;
198  ParametersType m_InitialParameters;
199  ParametersType m_CurrentParameters;
200 
201  ShapePriorSegmentationFunctionType *m_ShapePriorSegmentationFunction;
202 };
203 } // end namespace itk
204 
205 #ifndef ITK_MANUAL_INSTANTIATION
206 #include "itkShapePriorSegmentationLevelSetImageFilter.hxx"
207 #endif
208 
209 #endif
This class is a base for the Optimization methods that optimize a single valued function.
ShapePriorSegmentationLevelSetFunction< OutputImageType, FeatureImageType > ShapePriorSegmentationFunctionType
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.
ShapePriorMAPCostFunctionBase< TFeatureImage, TOutputPixelType > CostFunctionType
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:721
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
ShapePriorSegmentationFunctionType::ShapeFunctionType ShapeFunctionType
SegmentationLevelSetImageFilter< TInputImage, TFeatureImage, TOutputPixelType > Superclass
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 ...