ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkPointSet.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 /*=========================================================================
19  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef __itkPointSet_h
29 #define __itkPointSet_h
30 
31 #include "itkDataObject.h"
33 #include <vector>
34 #include <set>
35 
36 namespace itk
37 {
38 
79 template<
80  typename TPixelType,
81  unsigned int VDimension = 3,
82  typename TMeshTraits = DefaultStaticMeshTraits< TPixelType, VDimension, VDimension >
83  >
84 class PointSet:public DataObject
85 {
86 public:
88  typedef PointSet Self;
92 
94  itkNewMacro(Self);
95 
97  itkTypeMacro(PointSet, Object);
98 
100  typedef TMeshTraits MeshTraits;
102 
109 
111  itkStaticConstMacro(PointDimension, unsigned int,
112  TMeshTraits::PointDimension);
113 
119 
124 
126  typedef long RegionType;
127 
130  itkGetConstMacro(MaximumNumberOfRegions, RegionType);
131 
132 protected:
136 
142 
143 public:
145  void PassStructure(Self *inputPointSet);
146 
147  virtual void Initialize(void) ITK_OVERRIDE;
148 
150 
154  void SetPoints(PointsContainer *);
155 
156  PointsContainer * GetPoints(void);
157 
158  const PointsContainer * GetPoints(void) const;
159 
161 
162  PointDataContainer * GetPointData(void);
163 
164  const PointDataContainer * GetPointData(void) const;
165 
169  bool GetPoint(PointIdentifier, PointType *) const;
170  PointType GetPoint(PointIdentifier) const;
172 
175  void SetPointData(PointIdentifier, PixelType);
176  bool GetPointData(PointIdentifier, PixelType *) const;
178 
180  virtual void UpdateOutputInformation() ITK_OVERRIDE;
181 
182  virtual void SetRequestedRegionToLargestPossibleRegion() ITK_OVERRIDE;
183 
184  virtual void CopyInformation(const DataObject *data) ITK_OVERRIDE;
185 
186  virtual void Graft(const DataObject *data) ITK_OVERRIDE;
187 
188  virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() ITK_OVERRIDE;
189 
190  virtual bool VerifyRequestedRegion() ITK_OVERRIDE;
191 
196  virtual void SetRequestedRegion(const DataObject *data) ITK_OVERRIDE;
197 
199  virtual void SetRequestedRegion(const RegionType & region);
200 
201  itkGetConstMacro(RequestedRegion, RegionType);
202 
204  virtual void SetBufferedRegion(const RegionType & region);
205 
206  itkGetConstMacro(BufferedRegion, RegionType);
207 
208 protected:
210  PointSet();
211  ~PointSet() {}
212  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
214 
215  // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
216  // variables represent the maximum number of region that the data
217  // object can be broken into, which region out of how many is
218  // currently in the buffered region, and the number of regions and
219  // the specific region requested for the update. Data objects that
220  // do not support any division of the data can simply leave the
221  // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
222  // RequestedRegion are used to define the currently requested
223  // region. The LargestPossibleRegion is always requested region = 0
224  // and number of regions = 1;
230 
231 private:
232  PointSet(const Self &); //purposely not implemented
233  void operator=(const Self &); //purposely not implemented
234 }; // End Class: PointSet
235 } // end namespace itk
236 
237 #ifndef ITK_MANUAL_INSTANTIATION
238 #include "itkPointSet.hxx"
239 #endif
240 
241 /*
242 #ifndef ITK_MANUAL_INSTANTIATION
243 #include "itkPointSet.hxx"
244 #endif
245 */
246 
247 #endif
RegionType m_BufferedRegion
Definition: itkPointSet.h:228
virtual void SetRequestedRegion(const DataObject *data) ITK_OVERRIDE
MeshTraits::PointIdentifier PointIdentifier
Definition: itkPointSet.h:105
virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() ITK_OVERRIDE
virtual void Initialize(void) ITK_OVERRIDE
virtual bool VerifyRequestedRegion() ITK_OVERRIDE
A wrapper of the STL &quot;map&quot; container.
SmartPointer< const Self > ConstPointer
Definition: itkPointSet.h:91
void SetPoint(PointIdentifier, PointType)
RegionType m_RequestedRegion
Definition: itkPointSet.h:229
PointsContainerPointer m_PointsContainer
Definition: itkPointSet.h:130
PointsContainer::ConstPointer PointsContainerConstPointer
Definition: itkPointSet.h:116
virtual void SetRequestedRegionToLargestPossibleRegion() ITK_OVERRIDE
void SetPoints(PointsContainer *)
PointSet Self
Definition: itkPointSet.h:88
PointDataContainer::ConstIterator PointDataContainerIterator
Definition: itkPointSet.h:123
RegionType m_MaximumNumberOfRegions
Definition: itkPointSet.h:225
void PassStructure(Self *inputPointSet)
MeshTraits::PixelType PixelType
Definition: itkPointSet.h:101
PointsContainer * GetPoints(void)
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
bool GetPoint(PointIdentifier, PointType *) const
PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkPointSet.h:121
The non-const iterator type for the map.
virtual void CopyInformation(const DataObject *data) ITK_OVERRIDE
PointDataContainerPointer m_PointDataContainer
Definition: itkPointSet.h:141
virtual void UpdateOutputInformation() ITK_OVERRIDE
RegionType m_NumberOfRegions
Definition: itkPointSet.h:226
The const iterator type for the map.
MeshTraits::CoordRepType CoordRepType
Definition: itkPointSet.h:104
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:84
PointDataContainer * GetPointData(void)
MeshTraits::PointsContainer PointsContainer
Definition: itkPointSet.h:107
PointIdentifier GetNumberOfPoints(void) const
PointsContainer::Pointer PointsContainerPointer
Definition: itkPointSet.h:115
virtual void Graft(const DataObject *data) ITK_OVERRIDE
RegionType m_RequestedNumberOfRegions
Definition: itkPointSet.h:227
void operator=(const Self &)
MeshTraits::PointType PointType
Definition: itkPointSet.h:106
static const unsigned int PointDimension
Definition: itkPointSet.h:112
DataObject Superclass
Definition: itkPointSet.h:89
PointDataContainer::Pointer PointDataContainerPointer
Definition: itkPointSet.h:117
void SetPointData(PointDataContainer *)
TMeshTraits MeshTraits
Definition: itkPointSet.h:97
Control indentation during Print() invocation.
Definition: itkIndent.h:49
PointDataContainer::ConstPointer PointDataContainerConstPointer
Definition: itkPointSet.h:118
MeshTraits::PointDataContainer PointDataContainer
Definition: itkPointSet.h:108
virtual void SetBufferedRegion(const RegionType &region)
Base class for most ITK classes.
Definition: itkObject.h:57
PointsContainer::Iterator PointsContainerIterator
Definition: itkPointSet.h:122
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
Definition: itkPointSet.h:90