ITK  5.4.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  * https://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  itkOverrideGetNameOfClassMacro(PointSet);
98 
100  using MeshTraits = TMeshTraits;
102 
109 
113 
115  static constexpr unsigned int PointDimension = TMeshTraits::PointDimension;
116 
122 
124  using PointsContainerConstIterator = typename PointsContainer::ConstIterator;
125  using PointsContainerIterator = typename PointsContainer::Iterator;
126  using PointDataContainerIterator = typename PointDataContainer::ConstIterator;
127 
129  using RegionType = long;
130 
133  itkGetConstMacro(MaximumNumberOfRegions, RegionType);
134 
135 protected:
138  PointsContainerPointer m_PointsContainer{};
139 
144  PointDataContainerPointer m_PointDataContainer{};
145 
146 public:
150  void
151  PassStructure(Self * inputPointSet);
152 
156  void
157  Initialize() override;
158 
160  PointIdentifier
161  GetNumberOfPoints() const;
162 
164  void
165  SetPoints(PointsContainer *);
166 
168  void
169  SetPoints(PointsVectorContainer *);
170 
172  PointsContainer *
173  GetPoints();
174 
176  const PointsContainer *
177  GetPoints() const;
178 
180  void
181  SetPointData(PointDataContainer *);
182 
184  PointDataContainer *
185  GetPointData();
186 
188  const PointDataContainer *
189  GetPointData() const;
190 
194  void SetPoint(PointIdentifier, PointType);
195 
202  bool
203  GetPoint(PointIdentifier, PointType *) const;
204 
206  PointType GetPoint(PointIdentifier) const;
207 
212  void SetPointData(PointIdentifier, PixelType);
213 
220  bool
221  GetPointData(PointIdentifier, PixelType *) const;
222 
224  void
225  UpdateOutputInformation() override;
226 
227  void
228  SetRequestedRegionToLargestPossibleRegion() override;
229 
230  void
231  CopyInformation(const DataObject * data) override;
232 
233  void
234  Graft(const DataObject * data) override;
235 
236  bool
237  RequestedRegionIsOutsideOfTheBufferedRegion() override;
238 
239  bool
240  VerifyRequestedRegion() override;
241 
246  void
247  SetRequestedRegion(const DataObject * data) override;
248 
250  virtual void
251  SetRequestedRegion(const RegionType & region);
252 
253  itkGetConstMacro(RequestedRegion, RegionType);
254 
256  virtual void
257  SetBufferedRegion(const RegionType & region);
258 
259  itkGetConstMacro(BufferedRegion, RegionType);
260 
261 protected:
263  PointSet() = default;
264  ~PointSet() override = default;
265  void
266  PrintSelf(std::ostream & os, Indent indent) const override;
269  // If the RegionType is ITK_UNSTRUCTURED_REGION, then the following
270  // variables represent the maximum number of region that the data
271  // object can be broken into, which region out of how many is
272  // currently in the buffered region, and the number of regions and
273  // the specific region requested for the update. Data objects that
274  // do not support any division of the data can simply leave the
275  // MaximumNumberOfRegions as 1. The RequestedNumberOfRegions and
276  // RequestedRegion are used to define the currently requested
277  // region. The LargestPossibleRegion is always requested region = 0
278  // and number of regions = 1;
279  RegionType m_MaximumNumberOfRegions{ 1 };
280  RegionType m_NumberOfRegions{ 1 };
281  RegionType m_RequestedNumberOfRegions{};
282  RegionType m_BufferedRegion{ -1 };
283  RegionType m_RequestedRegion{ -1 };
284 }; // End Class: PointSet
285 } // end namespace itk
286 
287 #ifndef ITK_MANUAL_INSTANTIATION
288 # include "itkPointSet.hxx"
289 #endif
290 
291 #endif
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsVectorContainer
typename itk::VectorContainer< PointIdentifier, CoordRepType > PointsVectorContainer
Definition: itkPointSet.h:111
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerIterator
typename PointsContainer::Iterator PointsContainerIterator
Definition: itkPointSet.h:125
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainerPointer
typename PointDataContainer::Pointer PointDataContainerPointer
Definition: itkPointSet.h:120
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointDataContainerConstPointer
typename PointDataContainer::ConstPointer PointDataContainerConstPointer
Definition: itkPointSet.h:121
itk::PointSet
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Definition: itkPointSet.h:82
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerConstPointer
typename PointsContainer::ConstPointer PointsContainerConstPointer
Definition: itkPointSet.h:119
itk::DefaultDynamicMeshTraits::PointIdentifier
IdentifierType PointIdentifier
Definition: itkDefaultDynamicMeshTraits.h:81
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
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::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
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:118
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:126
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:129
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:61
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointType
typename MeshTraits::PointType PointType
Definition: itkPointSet.h:106
AddImageFilter
Definition: itkAddImageFilter.h:81
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsContainerConstIterator
typename PointsContainer::ConstIterator PointsContainerConstIterator
Definition: itkPointSet.h:124
itk::DefaultDynamicMeshTraits
A simple structure that holds type information for a mesh and its cells.
Definition: itkDefaultDynamicMeshTraits.h:63
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293
itk::PointSet< TCoordType, VDimension, DefaultDynamicMeshTraits< TCoordType, 2, 2, TCoordType > >::PointsVectorContainerPointer
typename PointsVectorContainer::Pointer PointsVectorContainerPointer
Definition: itkPointSet.h:112