RTK  2.6.0
Reconstruction Toolkit
rtkDisplacedDetectorImageFilter.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 rtkDisplacedDetectorImageFilter_h
20 #define rtkDisplacedDetectorImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
24 #include "rtkConfiguration.h"
25 
26 namespace rtk
27 {
28 
59 template <class TInputImage, class TOutputImage = TInputImage>
60 class ITK_TEMPLATE_EXPORT DisplacedDetectorImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
61 {
62 public:
63  ITK_DISALLOW_COPY_AND_MOVE(DisplacedDetectorImageFilter);
64 
70 
72  using InputImageType = TInputImage;
73  using OutputImageType = TOutputImage;
74  static constexpr unsigned int NDimension = TInputImage::ImageDimension;
75  using OutputImageRegionType = typename OutputImageType::RegionType;
77 
80 
82  itkNewMacro(Self);
83 
85  itkOverrideGetNameOfClassMacro(DisplacedDetectorImageFilter);
86 
88  itkGetConstObjectMacro(Geometry, GeometryType);
89  itkSetConstObjectMacro(Geometry, GeometryType);
91 
94  itkGetMacro(PadOnTruncatedSide, bool);
95  itkSetMacro(PadOnTruncatedSide, bool);
97 
102  void
103  SetOffsets(double minOffset, double maxOffset);
104  itkGetMacro(MinimumOffset, double);
105  itkGetMacro(MaximumOffset, double);
107 
110  itkGetMacro(Disable, bool);
111  itkSetMacro(Disable, bool);
113 
114 protected:
116 
117  ~DisplacedDetectorImageFilter() override = default;
118 
120  itkGetMacro(InferiorCorner, double);
121  itkGetMacro(SuperiorCorner, double);
123 
125  void
126  VerifyPreconditions() const override;
127 
128  void
129  GenerateInputRequestedRegion() override;
130 
131  void
132  GenerateOutputInformation() override;
133 
134  void
135  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
136 
137  // Iterative filters do not need padding
138  bool m_PadOnTruncatedSide{ true };
139 
140 private:
143 
149  double m_MinimumOffset{ 0. };
150  double m_MaximumOffset{ 0. };
151 
155  bool m_OffsetsSet{ false };
156 
160  double m_InferiorCorner{ 0. };
161  double m_SuperiorCorner{ 0. };
162 
166  bool m_Disable{ false };
167 
168 }; // end of class
169 
170 } // end namespace rtk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 # include "rtkDisplacedDetectorImageFilter.hxx"
174 #endif
175 
176 #endif
Weigting for displaced detectors.
TInputImage InputImageType
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType