RTK  2.6.0
Reconstruction Toolkit
rtkPhaseReader.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 rtkPhaseReader_h
19 #define rtkPhaseReader_h
20 
21 #include "RTKExport.h"
22 #include <itkCSVFileReaderBase.h>
23 
24 namespace rtk
25 {
26 
35 class RTK_EXPORT PhaseReader : public itk::CSVFileReaderBase
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_MOVE(PhaseReader);
39 
41  using Self = PhaseReader;
45 
47  itkNewMacro(Self);
48 
50 #ifdef itkOverrideGetNameOfClassMacro
51  itkOverrideGetNameOfClassMacro(PhaseReader);
52 #else
53  itkTypeMacro(PhaseReader, itk::CSVFileReaderBase);
54 #endif
55 
56 
58  using ValueType = float;
59 
62  void
63  Parse() override;
64 
67  virtual void
68  Update();
69 
72  virtual std::vector<float>
73  GetOutput();
74 
75 protected:
76  PhaseReader();
77  ~PhaseReader() override = default;
78 
80  void
81  PrintSelf(std::ostream & os, itk::Indent indent) const override;
82 
83 private:
84  std::vector<float> m_Phases;
85 };
86 
87 } // end namespace rtk
88 
89 #endif
std::vector< float > m_Phases
Parses csv file containing the cardiac or respiratory phases of each projection.