RTK  2.6.0
Reconstruction Toolkit
rtkPhaseGatingImageFilter.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 #ifndef rtkPhaseGatingImageFilter_h
19 #define rtkPhaseGatingImageFilter_h
20 
22 #include "rtkConstantImageSource.h"
23 #include "rtkPhaseReader.h"
24 
25 namespace rtk
26 {
33 template <typename ProjectionStackType>
34 class ITK_TEMPLATE_EXPORT PhaseGatingImageFilter : public SubSelectImageFilter<ProjectionStackType>
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_MOVE(PhaseGatingImageFilter);
38 
43 
45  itkNewMacro(Self);
46 
48 #ifdef itkOverrideGetNameOfClassMacro
49  itkOverrideGetNameOfClassMacro(PhaseGatingImageFilter);
50 #else
52 #endif
53 
54 
55  itkSetMacro(PhasesFileName, std::string);
56  itkGetMacro(PhasesFileName, std::string);
57 
58  itkSetMacro(GatingWindowWidth, float);
59  itkGetMacro(GatingWindowWidth, float);
60 
61  itkSetMacro(GatingWindowCenter, float);
62  itkGetMacro(GatingWindowCenter, float);
63 
64  itkSetMacro(GatingWindowShape, int);
65  itkGetMacro(GatingWindowShape, int);
66 
67  std::vector<float>
68  GetGatingWeights();
69  std::vector<float>
70  GetGatingWeightsOnSelectedProjections();
71 
72 protected:
74  ~PhaseGatingImageFilter() override = default;
75 
76  void
77  GenerateOutputInformation() override;
78 
79  void
80  SelectProjections();
81 
82  void
83  ComputeWeights();
84 
85  void
86  SetPhases(std::vector<float> phases);
87 
90 
92  std::vector<float> m_GatingWeights;
94  std::vector<float> m_Phases;
98  std::string m_PhasesFileName;
99 };
100 } // namespace rtk
101 
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 # include "rtkPhaseGatingImageFilter.hxx"
105 #endif
106 
107 #endif
Subselects projections from a stack of projections.
#define itkSetMacro(name, type)
std::vector< float > m_GatingWeightsOnSelectedProjections
rtk::PhaseReader::Pointer m_PhaseReader