00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00211
00212
00213
00214
00215
00216
00217
00218
00219
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&);
00228 void operator=(const Self&);
00229
00230 };
00231
00232 }
00233
00234 #ifndef ITK_MANUAL_INSTANTIATION
00235 #include "itkPointSet.txx"
00236 #endif
00237
00238 #endif