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: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.16 $
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   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 
00067 template <
00068   typename TPixelType,
00069   unsigned int VDimension = 3,
00070   typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
00071   >
00072 class PointSet: public DataObject
00073 {
00074 public:
00076   typedef PointSet                Self;
00077   typedef DataObject  Superclass;
00078   typedef SmartPointer<Self>  Pointer;
00079   typedef SmartPointer<const Self>  ConstPointer;
00080     
00082   itkNewMacro(Self);
00083 
00085   itkTypeMacro(PointSet, Object);
00086 
00088   typedef TMeshTraits   MeshTraits;
00089   typedef typename MeshTraits::PixelType                PixelType;  
00090   
00092   typedef typename MeshTraits::CoordRepType             CoordRepType;  
00093   typedef typename MeshTraits::PointIdentifier          PointIdentifier;
00094   typedef typename MeshTraits::PointType                PointType;
00095   typedef typename MeshTraits::PointsContainer          PointsContainer;
00096   typedef typename MeshTraits::PointDataContainer       PointDataContainer;
00097   
00099   itkStaticConstMacro(PointDimension, unsigned int,
00100                       TMeshTraits::PointDimension);
00101 
00104   typedef PointLocator<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00105                        CoordRepType,PointsContainer>  PointLocatorType;
00106   typedef BoundingBox<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00107                       CoordRepType,PointsContainer>   BoundingBoxType;
00108   
00110   typedef typename PointsContainer::Pointer          PointsContainerPointer;
00111   typedef typename PointsContainer::ConstPointer     PointsContainerConstPointer;
00112   typedef typename PointDataContainer::Pointer       PointDataContainerPointer;
00113   typedef typename PointDataContainer::ConstPointer  PointDataContainerConstPointer;
00114   typedef typename PointLocatorType::Pointer         PointLocatorPointer;
00115   typedef typename BoundingBoxType::Pointer          BoundingBoxPointer;
00116   
00118   typedef typename
00119           PointsContainer::ConstIterator        PointsContainerConstIterator;
00120   typedef typename
00121           PointsContainer::Iterator             PointsContainerIterator;
00122   typedef typename
00123           PointDataContainer::ConstIterator     PointDataContainerIterator;
00124     
00127   int GetMaximumNumberOfRegions() const
00128     {return m_MaximumNumberOfRegions;}
00129       
00130 protected:
00133   PointsContainerPointer  m_PointsContainer;
00134 
00139   PointDataContainerPointer  m_PointDataContainer;
00140  
00143   PointLocatorPointer m_PointLocator;
00144   
00147   BoundingBoxPointer m_BoundingBox;
00148 
00149 public:
00151   void PassStructure(Self* inputPointSet);
00152   virtual void Initialize(void);
00153   unsigned long GetNumberOfPoints(void) const;
00154   
00158   void SetPoints(PointsContainer*);
00159   PointsContainer * GetPoints(void);
00160   const PointsContainer * GetPoints(void) const;
00161   void SetPointData(PointDataContainer*);
00162   PointDataContainer * GetPointData(void);
00163   const PointDataContainer * GetPointData(void) const;
00164   
00167   void SetPoint(PointIdentifier, PointType);
00168   bool GetPoint(PointIdentifier, PointType*) const;
00169   
00172   void SetPointData(PointIdentifier, PixelType);
00173   bool GetPointData(PointIdentifier, PixelType*) const;
00174   
00177   const BoundingBoxType * GetBoundingBox(void) const;
00178 
00181   bool FindClosestPoint(CoordRepType coords[PointDimension],
00182                         PointIdentifier* pointId);
00183 
00185   virtual void UpdateOutputInformation();
00186   virtual void SetRequestedRegionToLargestPossibleRegion();
00187   virtual void CopyInformation(const DataObject *data);
00188   virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
00189   virtual bool VerifyRequestedRegion();
00190   
00195   virtual void SetRequestedRegion(DataObject *data);
00196 
00197 protected:
00199   PointSet();
00200   ~PointSet() {}
00201   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00202   
00203   // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
00204   // variables represent the maximum number of region that the data
00205   // object can be broken into, which region out of how many is
00206   // currently in the buffered region, and the number of regions and
00207   // the specific region requested for the update. Data objects that
00208   // do not support any division of the data can simply leave the
00209   // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
00210   // RequestedRegion are used to define the currently requested
00211   // region. The LargestPossibleRegion is always requested region = 0
00212   // and number of regions = 1;
00213   int m_MaximumNumberOfRegions;
00214   int m_NumberOfRegions;
00215   int m_BufferedRegion;
00216   int m_RequestedNumberOfRegions;
00217   int m_RequestedRegion;
00218 
00219 private:
00220   PointSet(const Self&); //purposely not implemented
00221   void operator=(const Self&); //purposely not implemented
00222 
00223 }; // End Class: PointSet
00224 
00225 } // end namespace itk
00226   
00227 #ifndef ITK_MANUAL_INSTANTIATION
00228 #include "itkPointSet.txx"
00229 #endif
00230   
00231 #endif

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