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
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
00204
00205
00206
00207
00208
00209
00210
00211
00212
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&);
00221 void operator=(const Self&);
00222
00223 };
00224
00225 }
00226
00227 #ifndef ITK_MANUAL_INSTANTIATION
00228 #include "itkPointSet.txx"
00229 #endif
00230
00231 #endif