Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkShapePriorSegmentationLevelSetImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkShapePriorSegmentationLevelSetImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:53:37 $
00007   Version:   $Revision: 1.13 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkShapePriorSegmentationLevelSetImageFilter_h
00018 #define __itkShapePriorSegmentationLevelSetImageFilter_h
00019 
00020 #include "itkSegmentationLevelSetImageFilter.h"
00021 #include "itkShapePriorSegmentationLevelSetFunction.h"
00022 #include "itkSingleValuedNonLinearOptimizer.h"
00023 #include "itkShapePriorMAPCostFunctionBase.h"
00024 
00025 namespace itk {
00026 
00069 template <class TInputImage,
00070           class TFeatureImage,
00071           class TOutputPixelType = float >
00072 class ITK_EXPORT ShapePriorSegmentationLevelSetImageFilter
00073   : public SegmentationLevelSetImageFilter< TInputImage, TFeatureImage, 
00074                                             TOutputPixelType>
00075 {
00076 public:
00077 
00079   itkStaticConstMacro(ImageDimension, unsigned int,
00080                       TInputImage::ImageDimension);
00081 
00083   typedef ShapePriorSegmentationLevelSetImageFilter Self;
00084   typedef SegmentationLevelSetImageFilter<TInputImage, TFeatureImage, TOutputPixelType>
00085                                                     Superclass;
00086   typedef SmartPointer<Self>                        Pointer;
00087   typedef SmartPointer<const Self>                  ConstPointer;
00088 
00090   itkTypeMacro(ShapePriorSegmentationLevelSetImageFilter, SegmentationLevelSetImageFilter);
00091 
00093   typedef typename Superclass::ValueType        ValueType;
00094   typedef typename Superclass::OutputImageType  OutputImageType;
00095   typedef typename Superclass::FeatureImageType FeatureImageType;
00096 
00098   typedef TOutputPixelType OutputPixelType;
00099 
00101   typedef ShapePriorSegmentationLevelSetFunction<OutputImageType, FeatureImageType>
00102       ShapePriorSegmentationFunctionType;
00103 
00105   typedef typename ShapePriorSegmentationFunctionType::ShapeFunctionType 
00106                                                ShapeFunctionType;
00107   typedef typename ShapeFunctionType::Pointer  ShapeFunctionPointer;
00108 
00110   typedef  ShapePriorMAPCostFunctionBase<TFeatureImage,TOutputPixelType>  CostFunctionType;
00111   typedef  typename CostFunctionType::Pointer         CostFunctionPointer;
00112   typedef  typename CostFunctionType::ParametersType  ParametersType;
00113 
00115   typedef  typename CostFunctionType::NodeType              NodeType;
00116   typedef  typename CostFunctionType::NodeContainerType     NodeContainerType;
00117   typedef  typename NodeContainerType::Pointer              NodeContainerPointer;
00118 
00120   typedef   SingleValuedNonLinearOptimizer         OptimizerType;
00121   typedef   typename OptimizerType::Pointer        OptimizerPointer;
00122 
00124   virtual void SetShapeFunction(ShapeFunctionType *s);
00125   itkGetObjectMacro( ShapeFunction, ShapeFunctionType );
00127 
00129   itkSetObjectMacro( CostFunction, CostFunctionType );
00130   itkGetObjectMacro( CostFunction, CostFunctionType );
00132 
00134   itkSetObjectMacro( Optimizer, OptimizerType );
00135   itkGetObjectMacro( Optimizer, OptimizerType );
00137 
00142  itkSetMacro( InitialParameters, ParametersType );
00143  itkGetConstMacro( InitialParameters, ParametersType );
00145 
00147   void SetShapePriorScaling( ValueType v )
00148     {
00149     if ( v != m_ShapePriorSegmentationFunction->GetShapePriorWeight() )
00150       {
00151       m_ShapePriorSegmentationFunction->SetShapePriorWeight( v );
00152       this->Modified();
00153       }
00154     }
00155   ValueType GetShapePriorScaling() const
00156     {
00157     return m_ShapePriorSegmentationFunction->GetShapePriorWeight();
00158     }
00160 
00163   virtual void SetShapePriorSegmentationFunction( ShapePriorSegmentationFunctionType * s );
00164   virtual ShapePriorSegmentationFunctionType * GetShapePriorSegmentationFunction()
00165     { return m_ShapePriorSegmentationFunction; }
00167 
00169   itkGetConstReferenceMacro( CurrentParameters, ParametersType );
00170 
00171 protected:
00172   virtual ~ShapePriorSegmentationLevelSetImageFilter() {}
00173   ShapePriorSegmentationLevelSetImageFilter();
00174 
00175   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00176 
00179   virtual void InitializeIteration();
00180 
00183   void GenerateData();
00184 
00186   void ExtractActiveRegion( NodeContainerType * ptr );
00187 
00188 private:
00189   ShapePriorSegmentationLevelSetImageFilter(const Self&); //purposely not implemented
00190   void operator=(const Self&); //purposely not implemented
00191 
00192   ShapeFunctionPointer     m_ShapeFunction;
00193   CostFunctionPointer      m_CostFunction;
00194   OptimizerPointer         m_Optimizer;
00195   ParametersType           m_InitialParameters;
00196   ParametersType           m_CurrentParameters;
00197 
00198   ShapePriorSegmentationFunctionType * m_ShapePriorSegmentationFunction;
00199 
00200 };
00201 
00202 } // end namespace itk
00203 
00204 #ifndef ITK_MANUAL_INSTANTIATION
00205 #include "itkShapePriorSegmentationLevelSetImageFilter.txx"
00206 #endif
00207 
00208 #endif
00209 

Generated at Mon Jul 12 2010 19:51:47 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000