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