RTK  2.0.1
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  * 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 #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 PhaseGatingImageFilter : public SubSelectImageFilter<ProjectionStackType>
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_ASSIGN(PhaseGatingImageFilter);
38 
43 
45  itkNewMacro(Self)
46 
47 
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> GetGatingWeights();
64 
65 protected:
66  PhaseGatingImageFilter();
67  ~PhaseGatingImageFilter() override = default;
68 
69  void GenerateOutputInformation() override;
70 
71  void SelectProjections();
72 
73  void ComputeWeights();
74 
75  void SetPhases(std::vector<float> phases);
76 
79 
81  std::vector<float> m_GatingWeights;
83  std::vector<float> m_Phases;
88 
89 };
90 } //namespace ITK
91 
92 
93 #ifndef ITK_MANUAL_INSTANTIATION
94 #include "rtkPhaseGatingImageFilter.hxx"
95 #endif
96 
97 #endif
void SetPhases(std::vector< float > phases)
std::vector< float > GetGatingWeights()
Subselects projections from a stack of projections.
STL namespace.
Parses csv file containing the cardiac or respiratory phases of each projection.
void GenerateOutputInformation() override
std::vector< float > GetGatingWeightsOnSelectedProjections()
std::vector< float > m_GatingWeightsOnSelectedProjections
#define itkSetMacro(name, type)
rtk::PhaseReader::Pointer m_PhaseReader