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 #ifdef itkOverrideGetNameOfClassMacro
86  itkOverrideGetNameOfClassMacro(DisplacedDetectorImageFilter);
87 #else
89 #endif
90 
91 
93  itkGetConstObjectMacro(Geometry, GeometryType);
94  itkSetConstObjectMacro(Geometry, GeometryType);
96 
99  itkGetMacro(PadOnTruncatedSide, bool);
100  itkSetMacro(PadOnTruncatedSide, bool);
102 
107  void
108  SetOffsets(double minOffset, double maxOffset);
109  itkGetMacro(MinimumOffset, double);
110  itkGetMacro(MaximumOffset, double);
112 
115  itkGetMacro(Disable, bool);
116  itkSetMacro(Disable, bool);
118 
119 protected:
121 
122  ~DisplacedDetectorImageFilter() override = default;
123 
125  itkGetMacro(InferiorCorner, double);
126  itkGetMacro(SuperiorCorner, double);
128 
130  void
131  VerifyPreconditions() const override;
132 
133  void
134  GenerateInputRequestedRegion() override;
135 
136  void
137  GenerateOutputInformation() override;
138 
139  void
140  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
141 
142  // Iterative filters do not need padding
143  bool m_PadOnTruncatedSide{ true };
144 
145 private:
148 
154  double m_MinimumOffset{ 0. };
155  double m_MaximumOffset{ 0. };
156 
160  bool m_OffsetsSet{ false };
161 
165  double m_InferiorCorner{ 0. };
166  double m_SuperiorCorner{ 0. };
167 
171  bool m_Disable{ false };
172 
173 }; // end of class
174 
175 } // end namespace rtk
176 
177 #ifndef ITK_MANUAL_INSTANTIATION
178 # include "rtkDisplacedDetectorImageFilter.hxx"
179 #endif
180 
181 #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