RTK  2.6.0
Reconstruction Toolkit
rtkDrawGeometricPhantomImageFilter.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 rtkDrawGeometricPhantomImageFilter_h
20 #define rtkDrawGeometricPhantomImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 #include <itkAddImageFilter.h>
24 #include "rtkGeometricPhantom.h"
25 
26 namespace rtk
27 {
28 
38 template <class TInputImage, class TOutputImage>
39 class ITK_TEMPLATE_EXPORT DrawGeometricPhantomImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_MOVE(DrawGeometricPhantomImageFilter);
43 
49 
52  using StringType = std::string;
56 
58  itkNewMacro(Self);
59 
61 #ifdef itkOverrideGetNameOfClassMacro
62  itkOverrideGetNameOfClassMacro(DrawGeometricPhantomImageFilter);
63 #else
65 #endif
66 
67 
69  itkGetConstObjectMacro(GeometricPhantom, GeometricPhantom);
70  itkSetConstObjectMacro(GeometricPhantom, GeometricPhantom);
72 
74  itkSetMacro(ConfigFile, StringType);
75  itkGetMacro(ConfigFile, StringType);
77 
79  itkSetMacro(PhantomScale, VectorType);
80  itkGetMacro(PhantomScale, VectorType);
82 
84  virtual void
86  {
87  SetPhantomScale(VectorType(_arg));
88  }
89 
92  itkSetMacro(OriginOffset, VectorType);
93  itkGetMacro(OriginOffset, VectorType);
95 
98  itkSetMacro(IsForbildConfigFile, bool);
99  itkGetConstMacro(IsForbildConfigFile, bool);
100  itkBooleanMacro(IsForbildConfigFile);
102 
104  itkSetMacro(RotationMatrix, RotationMatrixType);
105  itkGetMacro(RotationMatrix, RotationMatrixType);
107 
110  void
111  AddClipPlane(const VectorType & dir, const ScalarType & pos);
112  void
113  SetClipPlanes(const std::vector<VectorType> & dir, const std::vector<ScalarType> & pos);
115 
116 protected:
118  ~DrawGeometricPhantomImageFilter() override = default;
119 
120  void
121  GenerateData() override;
122 
123 private:
126  VectorType m_PhantomScale{ 1. };
127  VectorType m_OriginOffset{ 0. };
128  bool m_IsForbildConfigFile{ false };
130  std::vector<VectorType> m_PlaneDirections;
131  std::vector<ScalarType> m_PlanePositions;
132 };
133 
134 } // end namespace rtk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 # include "rtkDrawGeometricPhantomImageFilter.hxx"
138 #endif
139 
140 #endif
Container for a geometric phantom, i.e., a set of ConvexShapes.
itk::Vector< ScalarType, Dimension > VectorType
virtual void SetPhantomScale(const ScalarType _arg)
itk::SmartPointer< const Self > ConstPointer
Draws a GeometricPhantom in a 3D image.
#define itkSetMacro(name, type)
itk::Matrix< ScalarType, Dimension, Dimension > RotationMatrixType