RTK  2.1.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  * 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 rtkPhaseReader_h
19 #define rtkPhaseReader_h
20 
21 #include <itkCSVFileReaderBase.h>
22 
23 namespace rtk
24 {
25 
34 class ITK_EXPORT PhaseReader : public itk::CSVFileReaderBase
35 {
36 public:
37  ITK_DISALLOW_COPY_AND_ASSIGN(PhaseReader);
38 
40  using Self = PhaseReader;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(PhaseReader, itk::CSVFileReaderBase);
50 
52  using ValueType = float;
53 
56  void
57  Parse() override;
58 
61  virtual void
62  Update();
63 
66  virtual std::vector<float>
67  GetOutput();
68 
69 protected:
70  PhaseReader();
71  ~PhaseReader() override = default;
72 
74  void
75  PrintSelf(std::ostream & os, itk::Indent indent) const override;
76 
77 private:
78  std::vector<float> m_Phases;
79 };
80 
81 } // end namespace rtk
82 
83 #ifndef ITK_MANUAL_INSTANTIATION
84 # include "rtkPhaseReader.hxx"
85 #endif
86 
87 #endif
std::vector< float > m_Phases
Parses csv file containing the cardiac or respiratory phases of each projection.