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

itkScalarRegionBasedLevelSetFunction.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkScalarRegionBasedLevelSetFunction.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-06-12 09:44:02 $
00007   Version:   $Revision: 1.9 $
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 
00018 #ifndef __itkScalarRegionBasedLevelSetFunction_h
00019 #define __itkScalarRegionBasedLevelSetFunction_h
00020 
00021 #include "itkRegionBasedLevelSetFunction.h"
00022 #include "itkNeighborhoodIterator.h"
00023 #include "itkImageRegionConstIterator.h"
00024 
00025 namespace itk {
00026 
00027 
00064 template < class TInputImage, class TFeatureImage, class TSharedData >
00065 class ITK_EXPORT ScalarRegionBasedLevelSetFunction
00066 : public RegionBasedLevelSetFunction< TInputImage, TFeatureImage, TSharedData >
00067 {
00068 public:
00069   typedef ScalarRegionBasedLevelSetFunction         Self;
00070   typedef RegionBasedLevelSetFunction<
00071     TInputImage, TFeatureImage, TSharedData >       Superclass;
00072   typedef SmartPointer<Self>                        Pointer;
00073   typedef SmartPointer<const Self>                  ConstPointer;
00074 
00075   // itkNewMacro() is purposely not provided since this is an abstract class.
00076 
00078   itkTypeMacro( ScalarRegionBasedLevelSetFunction, RegionBasedLevelSetFunction );
00079 
00080   itkStaticConstMacro( ImageDimension, unsigned int, TFeatureImage::ImageDimension );
00081 
00082   typedef typename Superclass::InputImageType         InputImageType;
00083   typedef typename Superclass::InputImageConstPointer InputImageConstPointer;
00084   typedef typename Superclass::InputImagePointer      InputImagePointer;
00085   typedef typename Superclass::InputPixelType         InputPixelType;
00086   typedef typename Superclass::InputIndexType         InputIndexType;
00087   typedef typename Superclass::InputIndexValueType    InputIndexValueType;
00088   typedef typename Superclass::InputSizeType          InputSizeType;
00089   typedef typename Superclass::InputSizeValueType     InputSizeValueType;
00090   typedef typename Superclass::InputRegionType        InputRegionType;
00091   typedef typename Superclass::InputPointType         InputPointType;
00092 
00093   typedef typename Superclass::FeatureImageType       FeatureImageType;
00094   typedef typename FeatureImageType::ConstPointer     FeatureImageConstPointer;
00095   typedef typename Superclass::FeaturePixelType       FeaturePixelType;
00096   typedef typename Superclass::FeatureIndexType       FeatureIndexType;
00097   typedef typename Superclass::FeatureOffsetType      FeatureOffsetType;
00098 
00099   typedef typename Superclass::ScalarValueType        ScalarValueType;
00100   typedef typename Superclass::NeighborhoodType       NeighborhoodType;
00101   typedef typename Superclass::FloatOffsetType        FloatOffsetType;
00102   typedef typename Superclass::RadiusType             RadiusType;
00103   typedef typename Superclass::TimeStepType           TimeStepType;
00104   typedef typename Superclass::GlobalDataStruct       GlobalDataStruct;
00105   typedef typename Superclass::PixelType              PixelType;
00106   typedef typename Superclass::VectorType             VectorType;
00107 
00108   typedef typename Superclass::SharedDataType         SharedDataType;
00109   typedef typename Superclass::SharedDataPointer      SharedDataPointer;
00110 
00111   typedef ImageRegionIteratorWithIndex< InputImageType >      ImageIteratorType;
00112   typedef ImageRegionConstIteratorWithIndex< InputImageType > ConstImageIteratorType;
00113   typedef ImageRegionIteratorWithIndex< FeatureImageType >    FeatureImageIteratorType;
00114   typedef ImageRegionConstIterator< FeatureImageType >        ConstFeatureIteratorType;
00115 
00116   typedef std::list< unsigned int >                 ListPixelType;
00117   typedef typename ListPixelType::const_iterator    ListPixelConstIterator;
00118   typedef typename ListPixelType::iterator          ListPixelIterator;
00119   typedef Image< ListPixelType, itkGetStaticConstMacro(ImageDimension) >
00120                                                     ListImageType;
00121 
00126   void UpdatePixel( const unsigned int& idx,
00127     NeighborhoodIterator<TInputImage> &iterator,
00128     InputPixelType &newValue,
00129     bool &status );
00130 
00131 protected:
00132   ScalarRegionBasedLevelSetFunction() : Superclass(){}
00133   ~ScalarRegionBasedLevelSetFunction(){}
00134 
00135   ScalarValueType ComputeOverlapParameters( const FeatureIndexType& featIndex,
00136     ScalarValueType& product );
00137 
00138   // update the background and foreground constants for pixel updates
00139   // Called only when sparse filters are used to prevent iteration through the
00140   // entire image
00141   virtual void UpdateSharedDataInsideParameters( const unsigned int& iId,
00142     const FeaturePixelType& iVal, const ScalarValueType& iChange ) = 0;
00143   virtual void UpdateSharedDataOutsideParameters( const unsigned int& iId,
00144     const FeaturePixelType& iVal, const ScalarValueType& iChange ) = 0;
00145 
00146 
00147 private:
00148   ScalarRegionBasedLevelSetFunction(const Self&); //purposely not implemented
00149   void operator=(const Self&); //purposely not implemented
00150 };
00151 
00152 }
00153 
00154 #ifndef ITK_MANUAL_INSTANTIATION
00155 #include "itkScalarRegionBasedLevelSetFunction.txx"
00156 #endif
00157 
00158 #endif
00159 

Generated at Tue Sep 15 04:48:26 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000