RTK  2.5.0
Reconstruction Toolkit
rtkReorderProjectionsImageFilter.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 rtkReorderProjectionsImageFilter_h
20 #define rtkReorderProjectionsImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
24 #include "rtkConfiguration.h"
25 
26 namespace rtk
27 {
28 
44 template <class TInputImage, class TOutputImage = TInputImage>
45 class ITK_TEMPLATE_EXPORT ReorderProjectionsImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(ReorderProjectionsImageFilter);
49 
52 
56 
58  using InputImageType = TInputImage;
59  using OutputImageType = TOutputImage;
60  using OutputImageRegionType = typename OutputImageType::RegionType;
61  using PermutationType = enum { NONE = 0, SORT = 1, SHUFFLE = 2 };
62 
65 
67  itkNewMacro(Self);
68 
70 #ifdef itkOverrideGetNameOfClassMacro
71  itkOverrideGetNameOfClassMacro(ReorderProjectionsImageFilter);
72 #else
74 #endif
75 
76 
78  itkGetModifiableObjectMacro(OutputGeometry, GeometryType);
79  itkSetObjectMacro(InputGeometry, GeometryType);
81 
83  itkGetMacro(Permutation, PermutationType);
84  itkSetMacro(Permutation, PermutationType);
86 
88  void
89  SetInputSignal(const std::vector<double> signal);
90  std::vector<double>
91  GetOutputSignal();
93 
94 protected:
96 
97  ~ReorderProjectionsImageFilter() override = default;
98 
100  void
101  VerifyPreconditions() ITKv5_CONST override;
102 
103  void
104  GenerateData() override;
105 
106 private:
108  GeometryPointer m_InputGeometry;
109  GeometryPointer m_OutputGeometry;
110 
112  std::vector<double> m_InputSignal;
113  std::vector<double> m_OutputSignal;
114 
116  PermutationType m_Permutation;
117 
118 }; // end of class
119 
120 } // end namespace rtk
121 
122 #ifndef ITK_MANUAL_INSTANTIATION
123 # include "rtkReorderProjectionsImageFilter.hxx"
124 #endif
125 
126 #endif
STL namespace.
TInputImage InputImageType
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)
enum { NONE=0, SORT=1, SHUFFLE=2 } PermutationType
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Sorts or shuffle projections and geometry inputs.