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  itkOverrideGetNameOfClassMacro(PhaseGatingImageFilter);
49 
50  itkSetMacro(PhasesFileName, std::string);
51  itkGetMacro(PhasesFileName, std::string);
52 
53  itkSetMacro(GatingWindowWidth, float);
54  itkGetMacro(GatingWindowWidth, float);
55 
56  itkSetMacro(GatingWindowCenter, float);
57  itkGetMacro(GatingWindowCenter, float);
58 
59  itkSetMacro(GatingWindowShape, int);
60  itkGetMacro(GatingWindowShape, int);
61 
62  std::vector<float>
63  GetGatingWeights();
64  std::vector<float>
65  GetGatingWeightsOnSelectedProjections();
66 
67 protected:
69  ~PhaseGatingImageFilter() override = default;
70 
71  void
72  GenerateOutputInformation() override;
73 
74  void
75  SelectProjections();
76 
77  void
78  ComputeWeights();
79 
80  void
81  SetPhases(std::vector<float> phases);
82 
85 
87  std::vector<float> m_GatingWeights;
89  std::vector<float> m_Phases;
93  std::string m_PhasesFileName;
94 };
95 } // namespace rtk
96 
97 
98 #ifndef ITK_MANUAL_INSTANTIATION
99 # include "rtkPhaseGatingImageFilter.hxx"
100 #endif
101 
102 #endif
Subselects projections from a stack of projections.
#define itkSetMacro(name, type)
std::vector< float > m_GatingWeightsOnSelectedProjections
rtk::PhaseReader::Pointer m_PhaseReader