RTK  1.4.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  * 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:
41 
43  itkNewMacro(Self)
44 
45 
47 
48  itkSetMacro(PhasesFileName, std::string)
49  itkGetMacro(PhasesFileName, std::string)
50 
51  itkSetMacro(GatingWindowWidth, float)
52  itkGetMacro(GatingWindowWidth, float)
53 
54  itkSetMacro(GatingWindowCenter, float)
55  itkGetMacro(GatingWindowCenter, float)
56 
57  itkSetMacro(GatingWindowShape, int)
58  itkGetMacro(GatingWindowShape, int)
59 
60  std::vector<float> GetGatingWeights();
62 
63 protected:
64  PhaseGatingImageFilter();
65  virtual ~PhaseGatingImageFilter() ITK_OVERRIDE {}
66 
67  void GenerateOutputInformation() ITK_OVERRIDE;
68 
69  void SelectProjections();
70 
71  void ComputeWeights();
72 
73  void SetPhases(std::vector<float> phases);
74 
77 
79  std::vector<float> m_GatingWeights;
81  std::vector<float> m_Phases;
85  std::string m_PhasesFileName;
86 
87 private:
88  PhaseGatingImageFilter(const Self &); //purposely not implemented
89  void operator=(const Self &); //purposely not implemented
90 
91 };
92 } //namespace ITK
93 
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "rtkPhaseGatingImageFilter.hxx"
97 #endif
98 
99 #endif
SubSelectImageFilter< ProjectionStackType > Superclass
void SetPhases(std::vector< float > phases)
std::vector< float > GetGatingWeights()
Subselects projections from a stack of projections.
STL namespace.
void GenerateOutputInformation() override
std::vector< float > GetGatingWeightsOnSelectedProjections()
void operator=(const Self &)
itk::SmartPointer< Self > Pointer
std::vector< float > m_GatingWeightsOnSelectedProjections
#define itkSetMacro(name, type)
rtk::PhaseReader::Pointer m_PhaseReader