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: 2003/09/10 14:28:33 $
00007   Version:   $Revision: 1.25 $
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 _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 );
00115 
00118   void SetInputNarrowBand( NodeContainer * ptr );
00119   itkGetObjectMacro( InputNarrowBand, NodeContainer );
00121 
00124   NodeContainerPointer GetInsidePoints()
00125   { return m_InsidePoints; }
00126 
00129   NodeContainerPointer GetOutsidePoints(void)
00130   { return m_OutsidePoints; }
00131 
00134   void Locate();
00135 
00136 protected:
00137   LevelSetNeighborhoodExtractor();
00138   ~LevelSetNeighborhoodExtractor(){};
00139   void PrintSelf( std::ostream& os, Indent indent ) const;
00140 
00141   typename LevelSetImageType::PixelType GetLargeValue() const
00142   { return m_LargeValue; }
00143 
00144   const NodeType& GetNodeUsedInCalculation(unsigned int idx) const
00145   { return m_NodesUsed[idx]; }
00146 
00147   virtual void Initialize();
00148   virtual double CalculateDistance( IndexType& index );
00149 
00150   void GenerateData();
00151 
00152   bool GetLastPointIsInside() const
00153   { return m_LastPointIsInside; }
00154 
00155 private:
00156   LevelSetNeighborhoodExtractor(const Self&); //purposely not implemented
00157   void operator=(const Self&); //purposely not implemented
00158   
00159   void      GenerateDataFull();
00160   void      GenerateDataNarrowBand();
00161 
00162   double                                        m_LevelSetValue;
00163 
00164   NodeContainerPointer                          m_InsidePoints;
00165   NodeContainerPointer                          m_OutsidePoints;
00166 
00167   LevelSetConstPointer                          m_InputLevelSet;
00168 
00169   bool                                          m_NarrowBanding;
00170   double                                        m_NarrowBandwidth;
00171   NodeContainerPointer                          m_InputNarrowBand;
00172 
00173   signed long                                   m_ImageSize[SetDimension];
00174   typename LevelSetImageType::PixelType         m_LargeValue;
00175 
00176   std::vector<NodeType>                         m_NodesUsed;
00177 
00178   bool                                          m_LastPointIsInside;
00179 
00180 };
00181 
00182 
00183 } // namespace itk
00184 
00185 #ifndef ITK_MANUAL_INSTANTIATION
00186 #include "itkLevelSetNeighborhoodExtractor.txx"
00187 #endif
00188 
00189 #endif
00190 

Generated at Wed Nov 5 22:39:49 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000