19#ifndef itkCSVFileReaderBase_h
20#define itkCSVFileReaderBase_h
27#include "ITKIOCSVExport.h"
80 itkSetStringMacro(FileName);
85 itkSetMacro(FieldDelimiterCharacter,
char);
88 itkGetMacro(FieldDelimiterCharacter,
char);
92 itkSetMacro(UseStringDelimiterCharacter,
bool);
95 itkGetConstMacro(UseStringDelimiterCharacter,
bool);
98 itkSetMacro(StringDelimiterCharacter,
char);
101 itkGetMacro(StringDelimiterCharacter,
char);
105 itkSetMacro(HasRowHeaders,
bool);
108 itkGetConstMacro(HasRowHeaders,
bool);
112 itkSetMacro(HasColumnHeaders,
bool);
115 itkGetConstMacro(HasColumnHeaders,
bool);
120 itkBooleanMacro(HasRowHeaders);
121 itkBooleanMacro(HasColumnHeaders);
122 itkBooleanMacro(UseStringDelimiterCharacter);
142 template <
typename TData>
147 std::istringstream isstream(str);
150 if ((isstream >> value).fail() || !(isstream >> std::ws).eof())
152 return std::numeric_limits<TData>::quiet_NaN();
167 std::string m_FileName{};
168 char m_FieldDelimiterCharacter{};
169 char m_StringDelimiterCharacter{};
170 bool m_UseStringDelimiterCharacter{};
171 bool m_HasRowHeaders{};
172 bool m_HasColumnHeaders{};
173 std::ifstream m_InputStream{};
174 int m_EndOfColumnHeadersLine{};
175 std::string m_Line{};
A base class that contains common methods used for parsing csv files.
void PrintSelf(std::ostream &os, Indent indent) const override
void GetDataDimension(SizeValueType &rows, SizeValueType &cols)
TData ConvertStringToValueType(const std::string str)
~CSVFileReaderBase() override=default
void GetNextField(std::string &)
Control indentation during Print() invocation.
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType