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: 2004/01/12 19:46:06 $
00007   Version:   $Revision: 1.5 $
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, Image<TOutputPixelType, 
00075                                             ::itk::GetImageDimension<TInputImage>::ImageDimension> >
00076 {
00077 public:
00078 
00080   itkStaticConstMacro(ImageDimension, unsigned int,
00081                       TInputImage::ImageDimension);
00082 
00084   typedef ShapePriorSegmentationLevelSetImageFilter Self;
00085   typedef SegmentationLevelSetImageFilter<TInputImage, TFeatureImage, TOutputPixelType, 
00086         Image<TOutputPixelType, itkGetStaticConstMacro(ImageDimension)> > Superclass;
00087   typedef SmartPointer<Self>  Pointer;
00088   typedef SmartPointer<const Self>  ConstPointer;
00089   
00091   itkTypeMacro(ShapePriorSegmentationLevelSetImageFilter, SegmentationLevelSetImageFilter);
00092 
00094   typedef typename Superclass::ValueType ValueType;
00095   typedef typename Superclass::OutputImageType OutputImageType;
00096   typedef typename Superclass::FeatureImageType FeatureImageType;
00097   
00099   typedef TOutputPixelType OutputPixelType;
00100 
00102   typedef ShapePriorSegmentationLevelSetFunction<OutputImageType, FeatureImageType>
00103       ShapePriorSegmentationFunctionType;
00104 
00106   typedef typename ShapePriorSegmentationFunctionType::ShapeFunctionType 
00107       ShapeFunctionType;
00108   typedef typename ShapeFunctionType::Pointer  ShapeFunctionPointer;
00109 
00111   typedef  ShapePriorMAPCostFunctionBase<TFeatureImage,TOutputPixelType>  CostFunctionType;
00112   typedef  typename CostFunctionType::Pointer         CostFunctionPointer;
00113   typedef  typename CostFunctionType::ParametersType  ParametersType;
00114 
00116   typedef  typename CostFunctionType::NodeType              NodeType;
00117   typedef  typename CostFunctionType::NodeContainerType     NodeContainerType;
00118   typedef  typename NodeContainerType::Pointer              NodeContainerPointer;
00119 
00121   typedef   SingleValuedNonLinearOptimizer         OptimizerType;
00122   typedef   typename OptimizerType::Pointer        OptimizerPointer;
00123 
00125   virtual void SetShapeFunction(ShapeFunctionType *s);
00126   itkGetObjectMacro( ShapeFunction, ShapeFunctionType );
00127 
00129   itkSetObjectMacro( CostFunction, CostFunctionType );
00130   itkGetObjectMacro( CostFunction, CostFunctionType );
00131 
00133   itkSetObjectMacro( Optimizer, OptimizerType );
00134   itkGetObjectMacro( Optimizer, OptimizerType );
00135 
00140  itkSetMacro( InitialParameters, ParametersType );
00141  itkGetMacro( InitialParameters, ParametersType );
00142 
00144   void SetShapePriorScaling( ValueType v )
00145   {
00146     if ( v != m_ShapePriorSegmentationFunction->GetShapePriorWeight() )
00147     {
00148     m_ShapePriorSegmentationFunction->SetShapePriorWeight( v );
00149     this->Modified();
00150     }
00151   }
00152   ValueType GetShapePriorScaling() const
00153   {
00154     return m_ShapePriorSegmentationFunction->GetShapePriorWeight();
00155   }
00156   
00159   virtual void SetShapePriorSegmentationFunction( ShapePriorSegmentationFunctionType * s );
00160   virtual ShapePriorSegmentationFunctionType * GetShapePriorSegmentationFunction()
00161     { return m_ShapePriorSegmentationFunction; }
00162 
00164   itkGetMacro( CurrentParameters, ParametersType );
00165 
00166 protected:
00167   virtual ~ShapePriorSegmentationLevelSetImageFilter() {}
00168   ShapePriorSegmentationLevelSetImageFilter();
00169 
00170   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00171 
00174   virtual void InitializeIteration();
00175   
00178   void GenerateData();
00179 
00181   void ExtractActiveRegion( NodeContainerType * ptr );
00182   
00183 private:
00184 
00185    ShapeFunctionPointer     m_ShapeFunction;
00186    CostFunctionPointer      m_CostFunction;
00187    OptimizerPointer         m_Optimizer;
00188    ParametersType           m_InitialParameters;
00189    ParametersType           m_CurrentParameters;
00190 
00191    ShapePriorSegmentationFunctionType * m_ShapePriorSegmentationFunction;
00192 
00193 };
00194 
00195 } // end namespace itk
00196 
00197 #ifndef ITK_MANUAL_INSTANTIATION
00198 #include "itkShapePriorSegmentationLevelSetImageFilter.txx"
00199 #endif
00200 
00201 #endif
00202 

Generated at Sun Jan 25 13:19:45 2004 for ITK by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-2000