RTK  1.4.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  * 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 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>
40 public RayConvexIntersectionImageFilter< TInputImage, TOutputImage >
41 {
42 public:
48 
55 
57  itkNewMacro(Self);
58 
61 
63  itkGetMacro(Density, ScalarType);
64  itkSetMacro(Density, ScalarType);
66 
68  itkGetConstReferenceMacro(PlaneDirections, std::vector<VectorType>);
69  itkGetConstReferenceMacro(PlanePositions, std::vector<ScalarType>);
71 
73  void AddClipPlane(const VectorType & dir, const ScalarType & pos);
74 
76  void SetBoxFromImage(const ImageBaseType * img, bool bWithExternalHalfPixelBorder=true);
77 
79  itkGetMacro(BoxMin, PointType);
80  itkSetMacro(BoxMin, PointType);
81  itkGetMacro(BoxMax, PointType);
82  itkSetMacro(BoxMax, PointType);
83  itkGetMacro(Direction, RotationMatrixType);
84  itkSetMacro(Direction, RotationMatrixType);
86 
87 protected:
90 
91  void BeforeThreadedGenerateData ( ) ITK_OVERRIDE;
92 
93 private:
94  RayBoxIntersectionImageFilter(const Self&); //purposely not implemented
95  void operator=(const Self&); //purposely not implemented
96 
97  ScalarType m_Density;
98  std::vector<VectorType> m_PlaneDirections;
99  std::vector<ScalarType> m_PlanePositions;
100 
101  PointType m_BoxMin;
102  PointType m_BoxMax;
103  RotationMatrixType m_Direction;
104 };
105 
106 } // end namespace rtk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 #include "rtkRayBoxIntersectionImageFilter.hxx"
110 #endif
111 
112 #endif
Superclass::ScalarType ScalarType
Definition: rtkBoxShape.h:56
void BeforeThreadedGenerateData() override
Analytical projection of a BoxShape.
void AddClipPlane(const VectorType &dir, const ScalarType &pos)
void SetBoxFromImage(const ImageBaseType *img, bool bWithExternalHalfPixelBorder=true)
RayConvexIntersectionImageFilter< TInputImage, TOutputImage > Superclass
#define itkSetMacro(name, type)