RTK  2.5.0
Reconstruction Toolkit
rtkRayBoxIntersectionImageFilter.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 rtkRayBoxIntersectionImageFilter_h
20 #define rtkRayBoxIntersectionImageFilter_h
21 
23 #include "rtkConfiguration.h"
24 #include "rtkBoxShape.h"
25 
26 namespace rtk
27 {
28 
38 template <class TInputImage, class TOutputImage>
39 class ITK_TEMPLATE_EXPORT RayBoxIntersectionImageFilter
40  : public RayConvexIntersectionImageFilter<TInputImage, TOutputImage>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(RayBoxIntersectionImageFilter);
44 
50 
57 
59  itkNewMacro(Self);
60 
62 #ifdef itkOverrideGetNameOfClassMacro
63  itkOverrideGetNameOfClassMacro(RayBoxIntersectionImageFilter);
64 #else
66 #endif
67 
68 
70  itkGetMacro(Density, ScalarType);
71  itkSetMacro(Density, ScalarType);
73 
75  itkGetConstReferenceMacro(PlaneDirections, std::vector<VectorType>);
76  itkGetConstReferenceMacro(PlanePositions, std::vector<ScalarType>);
78 
80  void
81  AddClipPlane(const VectorType & dir, const ScalarType & pos);
82 
84  void
85  SetBoxFromImage(const ImageBaseType * _arg, bool bWithExternalHalfPixelBorder = true);
86 
88  itkGetMacro(BoxMin, PointType);
89  itkSetMacro(BoxMin, PointType);
90  itkGetMacro(BoxMax, PointType);
91  itkSetMacro(BoxMax, PointType);
92  itkGetMacro(Direction, RotationMatrixType);
93  itkSetMacro(Direction, RotationMatrixType);
95 
96 protected:
98  ~RayBoxIntersectionImageFilter() override = default;
99 
100  void
101  BeforeThreadedGenerateData() override;
102 
103 private:
104  ScalarType m_Density{ 1. };
105  std::vector<VectorType> m_PlaneDirections;
106  std::vector<ScalarType> m_PlanePositions;
107 
108  PointType m_BoxMin{ 0. };
109  PointType m_BoxMax{ 0. };
111 };
112 
113 } // end namespace rtk
114 
115 #ifndef ITK_MANUAL_INSTANTIATION
116 # include "rtkRayBoxIntersectionImageFilter.hxx"
117 #endif
118 
119 #endif
Superclass::VectorType VectorType
Definition: rtkBoxShape.h:57
Analytical projection of a BoxShape.
itk::ImageBase< Dimension > ImageBaseType
Definition: rtkBoxShape.h:59
#define itkSetMacro(name, type)
Superclass::PointType PointType
Definition: rtkBoxShape.h:56
Superclass::ScalarType ScalarType
Definition: rtkBoxShape.h:55
Superclass::RotationMatrixType RotationMatrixType
Definition: rtkBoxShape.h:58