MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkNavigationDataCSVSequentialPlayer.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13
14#ifndef mitkNavigationDataCSVSequentialPlayer_h
15#define mitkNavigationDataCSVSequentialPlayer_h
16
18
19namespace mitk
20{
21
40 {
41 public:
42
45
49 void SetFileName(const std::string& _FileName);
50
71 void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats,
72 int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums);
73
78
80 {
81 NavigationDataCSV, //for csv files from the MITK navigation data player
82 ManualLoggingCSV //for custom csv files
83 };
90
94 bool IsAtEnd();
95
100 void UpdateOutputInformation() override;
101
103
104 protected:
107
111 void GenerateData() override;
112
113 std::string m_FileName;
114
117
118 //member for the navigation datas which were read (only one output is supported at the moment)
119 std::vector<mitk::NavigationData::Pointer> m_NavigationDatas;
120
121 std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
122 std::vector<std::string> GetFileContentLineByLine(std::string filename);
123 mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
124
125 void FillOutputEmpty(int number);
126 mitk::NavigationData::Pointer GetEmptyNavigationData();
127
128 bool m_RightHanded; //true if the used coordinate System is right handed, false if it is left handed
129 char m_SeparatorSign; //symbol that is used to separate the values in the .csv file
130 int m_SampleCount; //every n-th sample in the file that should be used
131 bool m_HeaderRow; //true if the .csv file has a header row otherwise false
132 int m_XPos; //number of the column in the .csv file for the x-coordinates of the position
133 int m_YPos; //number of the column in the .csv file for the y-coordinates of the position
134 int m_ZPos; //number of the column in the .csv file for the z-coordinates of the position
135 bool m_UseQuats; //true if Quaternions are used to construct the orientation, false if Euler Angles are used
136 int m_Qx; //number of the column in the .csv file for the x component of the quaternion
137 int m_Qy; //number of the column in the .csv file for the y component of the quaternion
138 int m_Qz; //number of the column in the .csv file for the z component of the quaternion
139 int m_Qr; //number of the column in the .csv file for the r component of the quaternion
140 int m_Azimuth; //number of the column in the .csv file for Azimuth (Euler Angles)
141 int m_Elevation; //number of the column in the .csv file for Elevation (Euler Angles)
142 int m_Roll; //number of the column in the .csv file for Roll (Euler Angles)
143 bool m_EulersInRadiants; // true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
144 int m_MinNumberOfColumns; //minimal number of columns the file has to have (e.g. if you read data from column 8 the file has to have at least 8 columns)
145 };
146} // namespace mitk
147
148#endif
This class is a NavigationDataPlayer which can play CSV formatted files in sequential order,...
void SetFileName(const std::string &_FileName)
sets the file name and path (if XMLString is set, this is neglected)
void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats, int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums)
SetOptions sets the options for reading out the data out of the correct positions of the file....
mitkClassMacro(NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase)
void UpdateOutputInformation() override
Used for pipeline update just to tell the pipeline that we always have to update.
mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line)
std::vector< mitk::NavigationData::Pointer > m_NavigationDatas
itkGetStringMacro(FileName)
returns the file name and path
itkSetMacro(Filetype, Filetype)
Sets the file type. ManualLoggingCSV is default and is thought for your custom csv files....
std::vector< std::string > GetFileContentLineByLine(std::string filename)
std::vector< mitk::NavigationData::Pointer > GetNavigationDatasFromFile(std::string filename)
Base class for using mitk::NavigationData as a filter source. Subclasses can play objects of mitk::Na...
IGT Exceptions.