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/11/20 22:17:13 $
00007   Version:   $Revision: 1.17 $
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 
00074 template <
00075   typename TPixelType,
00076   unsigned int VDimension = 3,
00077   typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
00078   >
00079 class 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     
00134   int GetMaximumNumberOfRegions() const
00135     {return m_MaximumNumberOfRegions;}
00136       
00137 protected:
00140   PointsContainerPointer  m_PointsContainer;
00141 
00146   PointDataContainerPointer  m_PointDataContainer;
00147  
00150   PointLocatorPointer m_PointLocator;
00151   
00154   BoundingBoxPointer m_BoundingBox;
00155 
00156 public:
00158   void PassStructure(Self* inputPointSet);
00159   virtual void Initialize(void);
00160   unsigned long GetNumberOfPoints(void) const;
00161   
00165   void SetPoints(PointsContainer*);
00166   PointsContainer * GetPoints(void);
00167   const PointsContainer * GetPoints(void) const;
00168   void SetPointData(PointDataContainer*);
00169   PointDataContainer * GetPointData(void);
00170   const PointDataContainer * GetPointData(void) const;
00171   
00174   void SetPoint(PointIdentifier, PointType);
00175   bool GetPoint(PointIdentifier, PointType*) const;
00176   
00179   void SetPointData(PointIdentifier, PixelType);
00180   bool GetPointData(PointIdentifier, PixelType*) const;
00181   
00184   const BoundingBoxType * GetBoundingBox(void) const;
00185 
00188   bool FindClosestPoint(CoordRepType coords[PointDimension],
00189                         PointIdentifier* pointId);
00190 
00192   virtual void UpdateOutputInformation();
00193   virtual void SetRequestedRegionToLargestPossibleRegion();
00194   virtual void CopyInformation(const DataObject *data);
00195   virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
00196   virtual bool VerifyRequestedRegion();
00197   
00202   virtual void SetRequestedRegion(DataObject *data);
00203 
00204 protected:
00206   PointSet();
00207   ~PointSet() {}
00208   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00209   
00210   // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
00211   // variables represent the maximum number of region that the data
00212   // object can be broken into, which region out of how many is
00213   // currently in the buffered region, and the number of regions and
00214   // the specific region requested for the update. Data objects that
00215   // do not support any division of the data can simply leave the
00216   // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
00217   // RequestedRegion are used to define the currently requested
00218   // region. The LargestPossibleRegion is always requested region = 0
00219   // and number of regions = 1;
00220   int m_MaximumNumberOfRegions;
00221   int m_NumberOfRegions;
00222   int m_BufferedRegion;
00223   int m_RequestedNumberOfRegions;
00224   int m_RequestedRegion;
00225 
00226 private:
00227   PointSet(const Self&); //purposely not implemented
00228   void operator=(const Self&); //purposely not implemented
00229 
00230 }; // End Class: PointSet
00231 
00232 } // end namespace itk
00233   
00234 #ifndef ITK_MANUAL_INSTANTIATION
00235 #include "itkPointSet.txx"
00236 #endif
00237   
00238 #endif

Generated at Fri May 21 01:15:12 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000