ITK  5.2.0
Insight Toolkit
itkPointSet.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 <typename TPixelType,
80  unsigned int VDimension = 3,
81  typename TMeshTraits = DefaultStaticMeshTraits<TPixelType, VDimension, VDimension>>
82 class ITK_TEMPLATE_EXPORT PointSet : public DataObject
83 {
84 public:
85  ITK_DISALLOW_COPY_AND_MOVE(PointSet);
86 
88  using Self = PointSet;
92 
94  itkNewMacro(Self);
95 
97  itkTypeMacro(PointSet, Object);
98 
100  using MeshTraits = TMeshTraits;
102 
109 
111  static constexpr unsigned int PointDimension = TMeshTraits::PointDimension;
112 
114  using PointsContainerPointer = typename PointsContainer::Pointer;
115  using PointsContainerConstPointer = typename PointsContainer::ConstPointer;
116  using PointDataContainerPointer = typename PointDataContainer::Pointer;
117  using PointDataContainerConstPointer = typename PointDataContainer::ConstPointer;
118 
120  using PointsContainerConstIterator = typename PointsContainer::ConstIterator;
121  using PointsContainerIterator = typename PointsContainer::Iterator;
122  using PointDataContainerIterator = typename PointDataContainer::ConstIterator;
123 
125  using RegionType = long;
126 
129  itkGetConstMacro(MaximumNumberOfRegions, RegionType);
130 
131 protected:
135 
141 
142 public:
144  void
145  PassStructure(Self * inputPointSet);
146 
147  void
148  Initialize() override;
149 
151  GetNumberOfPoints() const;
152 
156  void
157  SetPoints(PointsContainer *);
158 
160  GetPoints();
161 
162  const PointsContainer *
163  GetPoints() const;
164 
165  void
166  SetPointData(PointDataContainer *);
167 
169  GetPointData();
170 
171  const PointDataContainer *
172  GetPointData() const;
173 
176  void SetPoint(PointIdentifier, PointType);
177  bool
178  GetPoint(PointIdentifier, PointType *) const;
179  PointType GetPoint(PointIdentifier) const;
181 
184  void SetPointData(PointIdentifier, PixelType);
185  bool
186  GetPointData(PointIdentifier, PixelType *) const;
188 
190  void
191  UpdateOutputInformation() override;
192 
193  void
194  SetRequestedRegionToLargestPossibleRegion() override;
195 
196  void
197  CopyInformation(const DataObject * data) override;
198 
199  void
200  Graft(const DataObject * data) override;
201 
202  bool
203  RequestedRegionIsOutsideOfTheBufferedRegion() override;
204 
205  bool
206  VerifyRequestedRegion() override;
207 
212  void
213  SetRequestedRegion(const DataObject * data) override;
214 
216  virtual void
217  SetRequestedRegion(const RegionType & region);
218 
219  itkGetConstMacro(RequestedRegion, RegionType);
220 
222  virtual void
223  SetBufferedRegion(const RegionType & region);
224 
225  itkGetConstMacro(BufferedRegion, RegionType);
226 
227 protected:
229  PointSet();
230  ~PointSet() override = default;
231  void
232  PrintSelf(std::ostream & os, Indent indent) const override;
234 
235  // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
236  // variables represent the maximum number of region that the data
237  // object can be broken into, which region out of how many is
238  // currently in the buffered region, and the number of regions and
239  // the specific region requested for the update. Data objects that
240  // do not support any division of the data can simply leave the
241  // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
242  // RequestedRegion are used to define the currently requested
243  // region. The LargestPossibleRegion is always requested region = 0
244  // and number of regions = 1;
250 }; // End Class: PointSet
251 } // end namespace itk
252 
253 #ifndef ITK_MANUAL_INSTANTIATION
254 # include "itkPointSet.hxx"
255 #endif
256 
257 /*
258 #ifndef ITK_MANUAL_INSTANTIATION
259 #include "itkPointSet.hxx"
260 #endif
261 */
262 
263 #endif
itk::PointSet::m_BufferedRegion
RegionType m_BufferedRegion
Definition: itkPointSet.h:248
itk::PointSet::m_MaximumNumberOfRegions
RegionType m_MaximumNumberOfRegions
Definition: itkPointSet.h:245
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerIterator
typename PointsContainer::Iterator PointsContainerIterator
Definition: itkPointSet.h:121
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainerPointer
typename PointDataContainer::Pointer PointDataContainerPointer
Definition: itkPointSet.h:116
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainerConstPointer
typename PointDataContainer::ConstPointer PointDataContainerConstPointer
Definition: itkPointSet.h:117
itk::PointSet::m_NumberOfRegions
RegionType m_NumberOfRegions
Definition: itkPointSet.h:246
itk::PointSet
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:82
itk::PointSet::m_PointsContainer
PointsContainerPointer m_PointsContainer
Definition: itkPointSet.h:129
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerConstPointer
typename PointsContainer::ConstPointer PointsContainerConstPointer
Definition: itkPointSet.h:115
itk::DefaultDynamicMeshTraits::PointIdentifier
IdentifierType PointIdentifier
Definition: itkDefaultDynamicMeshTraits.h:81
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::PointSet::m_RequestedRegion
RegionType m_RequestedRegion
Definition: itkPointSet.h:249
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkDataObject.h
itk::DefaultDynamicMeshTraits::CoordRepType
TCoordRep CoordRepType
Definition: itkDefaultDynamicMeshTraits.h:72
itk::MapContainer
A wrapper of the STL "map" container.
Definition: itkMapContainer.h:45
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointIdentifier
typename MeshTraits::PointIdentifier PointIdentifier
Definition: itkPointSet.h:105
itk::PointSet::m_RequestedNumberOfRegions
RegionType m_RequestedNumberOfRegions
Definition: itkPointSet.h:247
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PixelType
typename MeshTraits::PixelType PixelType
Definition: itkPointSet.h:101
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerPointer
typename PointsContainer::Pointer PointsContainerPointer
Definition: itkPointSet.h:114
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::CoordRepType
typename MeshTraits::CoordRepType CoordRepType
Definition: itkPointSet.h:104
itk::DataObject
class ITK_FORWARD_EXPORT DataObject
Definition: itkDataObject.h:42
itk::DefaultDynamicMeshTraits::PixelType
TPixelType PixelType
Definition: itkDefaultDynamicMeshTraits.h:70
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainerIterator
typename PointDataContainer::ConstIterator PointDataContainerIterator
Definition: itkPointSet.h:122
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainer
typename MeshTraits::PointsContainer PointsContainer
Definition: itkPointSet.h:107
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::RegionType
long RegionType
Definition: itkPointSet.h:125
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkDefaultStaticMeshTraits.h
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainer
typename MeshTraits::PointDataContainer PointDataContainer
Definition: itkPointSet.h:108
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::PointSet::m_PointDataContainer
PointDataContainerPointer m_PointDataContainer
Definition: itkPointSet.h:140
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointType
typename MeshTraits::PointType PointType
Definition: itkPointSet.h:106
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerConstIterator
typename PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkPointSet.h:120
itk::DefaultDynamicMeshTraits
A simple structure that holds type information for a mesh and its cells.
Definition: itkDefaultDynamicMeshTraits.h:63
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293