RTK  2.0.1
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  * 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 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_EXPORT DisplacedDetectorImageFilter :
61  public itk::InPlaceImageFilter<TInputImage, TOutputImage>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_ASSIGN(DisplacedDetectorImageFilter);
65 
68 
70 
73 
75  using InputImageType = TInputImage;
76  using OutputImageType = TOutputImage;
77  using OutputImageRegionType = typename OutputImageType::RegionType;
79 
82 
84  itkNewMacro(Self);
85 
88 
90  itkGetConstObjectMacro(Geometry, GeometryType);
91  itkSetConstObjectMacro(Geometry, GeometryType);
93 
96  itkGetMacro(PadOnTruncatedSide, bool);
97  itkSetMacro(PadOnTruncatedSide, bool);
99 
104  void SetOffsets(double minOffset, double maxOffset);
105  itkGetMacro(MinimumOffset, double);
106  itkGetMacro(MaximumOffset, double);
108 
111  itkGetMacro(Disable, bool);
112  itkSetMacro(Disable, bool);
114 
115 protected:
117 
118  ~DisplacedDetectorImageFilter() override = default;
119 
121  itkGetMacro(InferiorCorner, double);
122  itkGetMacro(SuperiorCorner, double);
124 
125  void GenerateInputRequestedRegion() override;
126 
127  void GenerateOutputInformation() override;
128 
129 #if ITK_VERSION_MAJOR<5
130  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, ThreadIdType threadId ) override;
131 #else
132  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
133 #endif
134 
135  // Iterative filters do not need padding
136  bool m_PadOnTruncatedSide{true};
137 
138 private:
141 
147  double m_MinimumOffset{0.};
148  double m_MaximumOffset{0.};
149 
153  bool m_OffsetsSet{false};
154 
158  double m_InferiorCorner{0.};
159  double m_SuperiorCorner{0.};
160 
164  bool m_Disable{false};
165 
166 }; // end of class
167 
168 } // end namespace rtk
169 
170 #ifndef ITK_MANUAL_INSTANTIATION
171 #include "rtkDisplacedDetectorImageFilter.hxx"
172 #endif
173 
174 #endif
Weigting for displaced detectors.
Projection geometry for a source and a 2-D flat panel.
unsigned int ThreadIdType
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType