RTK  2.6.0
Reconstruction Toolkit
rtkGeometricPhantom.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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  * 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 #ifndef rtkGeometricPhantom_h
20 #define rtkGeometricPhantom_h
21 
22 #include "RTKExport.h"
23 #include "rtkConvexShape.h"
24 
25 namespace rtk
26 {
37 class RTK_EXPORT GeometricPhantom : public itk::DataObject
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(GeometricPhantom);
41 
47 
50  using ConvexShapeVector = std::vector<ConvexShapePointer>;
55 
56 
58  itkNewMacro(Self);
59 
61 #ifdef itkOverrideGetNameOfClassMacro
62  itkOverrideGetNameOfClassMacro(GeometricPhantom);
63 #else
64  itkTypeMacro(GeometricPhantom, itk::DataObject);
65 #endif
66 
67 
69  virtual void
70  Rescale(const VectorType & r);
71 
73  virtual void
74  Translate(const VectorType & t);
75 
77  virtual void
78  Rotate(const RotationMatrixType & r);
79 
81  itkGetConstReferenceMacro(ConvexShapes, ConvexShapeVector);
82 
84  void
85  AddConvexShape(const ConvexShape * co);
86 
89  void
90  AddClipPlane(const VectorType & dir, const ScalarType & pos);
91 
92 protected:
93  GeometricPhantom() = default;
94  ~GeometricPhantom() override = default;
95 
96 private:
98  std::vector<VectorType> m_PlaneDirections;
99  std::vector<ScalarType> m_PlanePositions;
100 };
101 
102 } // namespace rtk
103 #endif // rtkGeometricPhantom_h
Container for a geometric phantom, i.e., a set of ConvexShapes.
itk::Vector< ScalarType, Dimension > VectorType
class ITK_FORWARD_EXPORT DataObject
itk::SmartPointer< Self > Pointer
std::vector< ScalarType > m_PlanePositions
ConvexShape::ScalarType ScalarType
std::vector< ConvexShapePointer > ConvexShapeVector
std::vector< VectorType > m_PlaneDirections
ConvexShapeVector m_ConvexShapes
Base class for a 3D convex shape.
itk::Vector< ScalarType, Dimension > PointType
itk::Matrix< ScalarType, Dimension, Dimension > RotationMatrixType