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: 2005/12/03 22:15:26 $
00007   Version:   $Revision: 1.23.2.1 $
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 
00041 template <typename TPointSet>
00042 struct GetPointSetDimension
00043 {
00044 itkStaticConstMacro(PointDimension, unsigned int,  TPointSet::PointDimension);
00045 }; 
00046   
00086 template <
00087   typename TPixelType,
00088   unsigned int VDimension = 3,
00089   typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
00090   >
00091 class ITK_EXPORT PointSet: public DataObject
00092 {
00093 public:
00095   typedef PointSet                Self;
00096   typedef DataObject  Superclass;
00097   typedef SmartPointer<Self>  Pointer;
00098   typedef SmartPointer<const Self>  ConstPointer;
00099     
00101   itkNewMacro(Self);
00102 
00104   itkTypeMacro(PointSet, Object);
00105 
00107   typedef TMeshTraits   MeshTraits;
00108   typedef typename MeshTraits::PixelType                PixelType;  
00109   
00111   typedef typename MeshTraits::CoordRepType             CoordRepType;  
00112   typedef typename MeshTraits::PointIdentifier          PointIdentifier;
00113   typedef typename MeshTraits::PointType                PointType;
00114   typedef typename MeshTraits::PointsContainer          PointsContainer;
00115   typedef typename MeshTraits::PointDataContainer       PointDataContainer;
00116   
00118   itkStaticConstMacro(PointDimension, unsigned int,
00119                       TMeshTraits::PointDimension);
00120 
00123   typedef PointLocator<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00124                        CoordRepType,PointsContainer>  PointLocatorType;
00125   typedef BoundingBox<PointIdentifier,itkGetStaticConstMacro(PointDimension),
00126                       CoordRepType,PointsContainer>   BoundingBoxType;
00127   
00129   typedef typename PointsContainer::Pointer          PointsContainerPointer;
00130   typedef typename PointsContainer::ConstPointer     PointsContainerConstPointer;
00131   typedef typename PointDataContainer::Pointer       PointDataContainerPointer;
00132   typedef typename PointDataContainer::ConstPointer  PointDataContainerConstPointer;
00133   typedef typename PointLocatorType::Pointer         PointLocatorPointer;
00134   typedef typename BoundingBoxType::Pointer          BoundingBoxPointer;
00135   
00137   typedef typename
00138           PointsContainer::ConstIterator        PointsContainerConstIterator;
00139   typedef typename
00140           PointsContainer::Iterator             PointsContainerIterator;
00141   typedef typename
00142           PointDataContainer::ConstIterator     PointDataContainerIterator;
00143     
00145   typedef long                                  RegionType;
00146 
00149   itkGetConstMacro( MaximumNumberOfRegions, RegionType );
00150       
00151 protected:
00154   PointsContainerPointer  m_PointsContainer;
00155 
00160   PointDataContainerPointer  m_PointDataContainer;
00161  
00164   PointLocatorPointer m_PointLocator;
00165   
00168   BoundingBoxPointer m_BoundingBox;
00169 
00170 public:
00172   void PassStructure(Self* inputPointSet);
00173   virtual void Initialize(void);
00174   unsigned long GetNumberOfPoints(void) const;
00175   
00179   void SetPoints(PointsContainer*);
00180   PointsContainer * GetPoints(void);
00181   const PointsContainer * GetPoints(void) const;
00182   void SetPointData(PointDataContainer*);
00183   PointDataContainer * GetPointData(void);
00184   const PointDataContainer * GetPointData(void) const;
00185   
00188   void SetPoint(PointIdentifier, PointType);
00189   bool GetPoint(PointIdentifier, PointType*) const;
00190   
00193   void SetPointData(PointIdentifier, PixelType);
00194   bool GetPointData(PointIdentifier, PixelType*) const;
00195   
00198   const BoundingBoxType * GetBoundingBox(void) const;
00199 
00202   bool FindClosestPoint(CoordRepType* /*coords[PointDimension]*/,
00203                         PointIdentifier* pointId);
00204 
00206   virtual void UpdateOutputInformation();
00207   virtual void SetRequestedRegionToLargestPossibleRegion();
00208   virtual void CopyInformation(const DataObject *data);
00209   virtual void Graft(const DataObject *data);
00210   virtual bool RequestedRegionIsOutsideOfTheBufferedRegion();
00211   virtual bool VerifyRequestedRegion();
00212   
00217   virtual void SetRequestedRegion(DataObject *data);
00218 
00220   virtual void SetRequestedRegion( const RegionType & region );
00221   itkGetMacro( RequestedRegion, RegionType );
00222 
00224   virtual void SetBufferedRegion( const RegionType & region );
00225   itkGetMacro( BufferedRegion, RegionType );
00226 
00227 
00228 protected:
00230   PointSet();
00231   ~PointSet() {}
00232   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00233   
00234   // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
00235   // variables represent the maximum number of region that the data
00236   // object can be broken into, which region out of how many is
00237   // currently in the buffered region, and the number of regions and
00238   // the specific region requested for the update. Data objects that
00239   // do not support any division of the data can simply leave the
00240   // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
00241   // RequestedRegion are used to define the currently requested
00242   // region. The LargestPossibleRegion is always requested region = 0
00243   // and number of regions = 1;
00244   RegionType m_MaximumNumberOfRegions;
00245   RegionType m_NumberOfRegions;
00246   RegionType m_RequestedNumberOfRegions;
00247   RegionType m_BufferedRegion;
00248   RegionType m_RequestedRegion;
00249 
00250 private:
00251   PointSet(const Self&); //purposely not implemented
00252   void operator=(const Self&); //purposely not implemented
00253 
00254 }; // End Class: PointSet
00255 
00256 } // end namespace itk
00257   
00258 #ifndef ITK_MANUAL_INSTANTIATION
00259 #include "itkPointSet.txx"
00260 #endif
00261   
00262 #endif

Generated at Wed May 24 23:51:53 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000