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

itkLevelSetNeighborhoodExtractor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLevelSetNeighborhoodExtractor.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/10/03 23:33:53 $
00007   Version:   $Revision: 1.22 $
00008 
00009   Copyright (c) 2002 Insight 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 _itkLevelSetNeighborhoodExtractor_h
00018 #define _itkLevelSetNeighborhoodExtractor_h
00019 
00020 #include "itkLightProcessObject.h"
00021 #include "itkLevelSet.h"
00022 #include "itkIndex.h"
00023 
00024 namespace itk
00025 {
00026 
00055 template <class TLevelSet>
00056 class ITK_EXPORT LevelSetNeighborhoodExtractor :
00057   public LightProcessObject
00058 {
00059 public:
00061   typedef LevelSetNeighborhoodExtractor Self;
00062   typedef LightProcessObject Superclass;
00063   typedef SmartPointer<Self> Pointer;
00064   typedef SmartPointer<const Self>  ConstPointer;
00065 
00067   itkNewMacro(Self);
00068 
00070   itkTypeMacro(LevelSetNeighborhoodExtractor, Object);
00071 
00073   typedef LevelSetTypeDefault<TLevelSet>  LevelSetType;
00074   typedef typename LevelSetType::LevelSetImageType  LevelSetImageType;
00075   typedef typename LevelSetType::LevelSetPointer  LevelSetPointer;
00076   typedef typename LevelSetType::LevelSetConstPointer  LevelSetConstPointer;
00077   typedef typename LevelSetType::PixelType  PixelType;
00078   typedef typename LevelSetType::NodeType NodeType;
00079   typedef typename LevelSetType::NodeContainer NodeContainer;
00080   typedef typename LevelSetType::NodeContainerPointer NodeContainerPointer;
00081 
00083   itkStaticConstMacro(SetDimension, unsigned int,
00084                       LevelSetType::SetDimension);
00085 
00087   typedef Index<itkGetStaticConstMacro(SetDimension)> IndexType;
00088 
00090   itkSetConstObjectMacro( InputLevelSet, LevelSetImageType );
00091 
00093   itkGetConstObjectMacro( InputLevelSet, LevelSetImageType );
00094 
00096   itkSetMacro( LevelSetValue, double );
00097 
00099   itkGetMacro( LevelSetValue, double );
00100 
00102   itkSetClampMacro( NarrowBandwidth, double, 0.0, 
00103     NumericTraits<double>::max());
00104 
00106   itkGetMacro( NarrowBandwidth, double );
00107 
00109   itkSetMacro( NarrowBanding, bool );
00110 
00112   itkGetMacro( NarrowBanding, bool );
00113   itkBooleanMacro( NarrowBanding );
00114 
00117   void SetInputNarrowBand( NodeContainer * ptr );
00118   itkGetObjectMacro( InputNarrowBand, NodeContainer );
00119 
00122   NodeContainerPointer GetInsidePoints()
00123     { return m_InsidePoints; }
00124 
00127   NodeContainerPointer GetOutsidePoints(void)
00128     { return m_OutsidePoints; }
00129 
00132   void Locate();
00133 
00134 protected:
00135   LevelSetNeighborhoodExtractor();
00136   ~LevelSetNeighborhoodExtractor(){};
00137   void PrintSelf( std::ostream& os, Indent indent ) const;
00138 
00139   typename LevelSetImageType::PixelType GetLargeValue() const
00140     { return m_LargeValue; }
00141 
00142   const NodeType& GetNodeUsedInCalculation(unsigned int idx) const
00143     { return m_NodesUsed[idx]; }
00144 
00145   virtual void Initialize();
00146   virtual double CalculateDistance( IndexType& index );
00147 
00148   void GenerateData();
00149 
00150   bool GetLastPointIsInside() const
00151           { return m_LastPointIsInside; }
00152 
00153 private:
00154   LevelSetNeighborhoodExtractor(const Self&); //purposely not implemented
00155   void operator=(const Self&); //purposely not implemented
00156   
00157   void      GenerateDataFull();
00158   void      GenerateDataNarrowBand();
00159 
00160   double                                        m_LevelSetValue;
00161 
00162   NodeContainerPointer                          m_InsidePoints;
00163   NodeContainerPointer                          m_OutsidePoints;
00164 
00165   LevelSetConstPointer                          m_InputLevelSet;
00166 
00167   bool                                          m_NarrowBanding;
00168   double                                        m_NarrowBandwidth;
00169   NodeContainerPointer                          m_InputNarrowBand;
00170 
00171   signed long                                   m_ImageSize[SetDimension];
00172   typename LevelSetImageType::PixelType         m_LargeValue;
00173 
00174   std::vector<NodeType>                         m_NodesUsed;
00175 
00176   bool                                          m_LastPointIsInside;
00177 
00178 };
00179 
00180 
00181 } // namespace itk
00182 
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkLevelSetNeighborhoodExtractor.txx"
00185 #endif
00186 
00187 #endif

Generated at Wed Mar 12 01:13:04 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000