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

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