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

itkPointSet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPointSet.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/09/10 14:29:23 $
00007   Version:   $Revision: 1.20 $
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   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkPointSet_h
00021 #define __itkPointSet_h
00022 
00023 #include "itkDataObject.h"
00024 #include "itkPoint.h"
00025 #include "itkDefaultStaticMeshTraits.h"
00026 #include "itkPointLocator.h"
00027 #include "itkBoundingBox.h"
00028 #include <vector>
00029 #include <set>
00030 
00031 
00032 namespace itk
00033 {
00034 
00074 template <
00075   typename TPixelType,
00076   unsigned int VDimension = 3,
00077   typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
00078   >
00079 class ITK_EXPORT PointSet: public DataObject
00080 {
00081 public:
00083   typedef PointSet                Self;
00084   typedef DataObject  Superclass;
00085   typedef SmartPointer<Self>  Pointer;
00086   typedef SmartPointer<const Self>  ConstPointer;
00087     
00089   itkNewMacro(Self);
00090 
00092   itkTypeMacro(PointSet, Object);
00093 
00095   typedef TMeshTraits   MeshTraits;
00096   typedef typename MeshTraits::PixelType                PixelType;  
00097   
00099   typedef typename MeshTraits::CoordRepType             CoordRepType;  
00100   typedef typename MeshTraits::PointIdentifier          PointIdentifier;
00101   typedef typename MeshTraits::PointType                PointType;
00102   typedef typename MeshTraits::PointsContainer          PointsContainer;
00103   typedef typename MeshTraits::PointDataContainer       PointDataContainer;
00104   
00106   itkStaticConstMacro(PointDimension, unsigned int,
00107                       TMeshTraits::PointDimension);
00108 
00111   typedef PointLocator<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00112                        CoordRepType,PointsContainer>  PointLocatorType;
00113   typedef BoundingBox<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00114                       CoordRepType,PointsContainer>   BoundingBoxType;
00115   
00117   typedef typename PointsContainer::Pointer          PointsContainerPointer;
00118   typedef typename PointsContainer::ConstPointer     PointsContainerConstPointer;
00119   typedef typename PointDataContainer::Pointer       PointDataContainerPointer;
00120   typedef typename PointDataContainer::ConstPointer  PointDataContainerConstPointer;
00121   typedef typename PointLocatorType::Pointer         PointLocatorPointer;
00122   typedef typename BoundingBoxType::Pointer          BoundingBoxPointer;
00123   
00125   typedef typename
00126           PointsContainer::ConstIterator        PointsContainerConstIterator;
00127   typedef typename
00128           PointsContainer::Iterator             PointsContainerIterator;
00129   typedef typename
00130           PointDataContainer::ConstIterator     PointDataContainerIterator;
00131     
00133   typedef int                                   RegionType;
00134 
00137   int GetMaximumNumberOfRegions() const
00138     {return m_MaximumNumberOfRegions;}
00139       
00140 protected:
00143   PointsContainerPointer  m_PointsContainer;
00144 
00149   PointDataContainerPointer  m_PointDataContainer;
00150  
00153   PointLocatorPointer m_PointLocator;
00154   
00157   BoundingBoxPointer m_BoundingBox;
00158 
00159 public:
00161   void PassStructure(Self* inputPointSet);
00162   virtual void Initialize(void);
00163   unsigned long GetNumberOfPoints(void) const;
00164   
00168   void SetPoints(PointsContainer*);
00169   PointsContainer * GetPoints(void);
00170   const PointsContainer * GetPoints(void) const;
00171   void SetPointData(PointDataContainer*);
00172   PointDataContainer * GetPointData(void);
00173   const PointDataContainer * GetPointData(void) const;
00174   
00177   void SetPoint(PointIdentifier, PointType);
00178   bool GetPoint(PointIdentifier, PointType*) const;
00179   
00182   void SetPointData(PointIdentifier, PixelType);
00183   bool GetPointData(PointIdentifier, PixelType*) const;
00184   
00187   const BoundingBoxType * GetBoundingBox(void) const;
00188 
00191   bool FindClosestPoint(CoordRepType coords[PointDimension],
00192                         PointIdentifier* pointId);
00193 
00195   virtual void UpdateOutputInformation();
00196   virtual void SetRequestedRegionToLargestPossibleRegion();
00197   virtual void CopyInformation(const DataObject *data);
00198   virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
00199   virtual bool VerifyRequestedRegion();
00200   
00205   virtual void SetRequestedRegion(DataObject *data);
00206 
00208   virtual void SetRequestedRegion( const RegionType & region );
00209   itkGetMacro( RequestedRegion, RegionType );
00210 
00212   virtual void SetBufferedRegion( const RegionType & region );
00213   itkGetMacro( BufferedRegion, RegionType );
00214 
00215 
00216 protected:
00218   PointSet();
00219   ~PointSet() {}
00220   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00221   
00222   // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
00223   // variables represent the maximum number of region that the data
00224   // object can be broken into, which region out of how many is
00225   // currently in the buffered region, and the number of regions and
00226   // the specific region requested for the update. Data objects that
00227   // do not support any division of the data can simply leave the
00228   // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
00229   // RequestedRegion are used to define the currently requested
00230   // region. The LargestPossibleRegion is always requested region = 0
00231   // and number of regions = 1;
00232   int m_MaximumNumberOfRegions;
00233   int m_NumberOfRegions;
00234   int m_RequestedNumberOfRegions;
00235   RegionType m_BufferedRegion;
00236   RegionType m_RequestedRegion;
00237 
00238 private:
00239   PointSet(const Self&); //purposely not implemented
00240   void operator=(const Self&); //purposely not implemented
00241 
00242 }; // End Class: PointSet
00243 
00244 } // end namespace itk
00245   
00246 #ifndef ITK_MANUAL_INSTANTIATION
00247 #include "itkPointSet.txx"
00248 #endif
00249   
00250 #endif

Generated at Tue Sep 16 11:32:07 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000