RTK  2.6.0
Reconstruction Toolkit
rtkForbildPhantomFileReader.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 rtkForbildPhantomFileReader_h
20 #define rtkForbildPhantomFileReader_h
21 
22 #include "RTKExport.h"
23 #include <itkLightProcessObject.h>
24 #include "rtkGeometricPhantom.h"
25 
26 namespace rtk
27 {
28 
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(ForbildPhantomFileReader);
46 
52 
54  static constexpr unsigned int Dimension = ConvexShape::Dimension;
61 
63  itkNewMacro(Self);
64 
66  itkOverrideGetNameOfClassMacro(ForbildPhantomFileReader);
67 
69  itkGetModifiableObjectMacro(GeometricPhantom, GeometricPhantom);
70  itkSetObjectMacro(GeometricPhantom, GeometricPhantom);
72 
74  itkGetStringMacro(Filename);
75  itkSetStringMacro(Filename);
77 
79  virtual void
80  GenerateOutputInformation();
81 
82 protected:
84  ForbildPhantomFileReader() = default;
85 
87  ~ForbildPhantomFileReader() override = default;
88 
89  void
90  CreateForbildSphere(const std::string & s);
91  void
92  CreateForbildBox(const std::string & s);
93  void
94  CreateForbildCylinder(const std::string & s, const std::string & fig);
95  void
96  CreateForbildElliptCyl(const std::string & s, const std::string & fig);
97  void
98  CreateForbildEllipsoid(const std::string & s, const std::string & fig);
99  void
100  CreateForbildCone(const std::string & s, const std::string & fig);
101  void
102  CreateForbildTetrahedron(const std::string & s);
104  ComputeRotationMatrixBetweenVectors(const VectorType & source, const VectorType & dest) const;
105 
106  bool
107  FindParameterInString(const std::string & name, const std::string & s, ScalarType & param);
108  bool
109  FindVectorInString(const std::string & name, const std::string & s, VectorType & vec);
110  void
111  FindClipPlanes(const std::string & s);
112  void
113  FindUnions(const std::string & s);
114 
115 private:
117  std::string m_Filename;
121  std::vector<int> m_UnionWith;
122 };
123 
124 } // end namespace rtk
125 
126 #endif
Container for a geometric phantom, i.e., a set of ConvexShapes.
itk::Vector< ScalarType, Dimension > VectorType
static constexpr unsigned int Dimension
constexpr unsigned int Dimension
itk::SmartPointer< Self > Pointer
std::vector< ConvexShapePointer > ConvexShapeVector
GeometricPhantom::ConvexShapeVector ConvexShapeVectorType
Reads GeometricPhantom from a Forbild file.
itk::Vector< ScalarType, Dimension > PointType
itk::Matrix< ScalarType, Dimension, Dimension > RotationMatrixType