18 template <
class charT>
19 class punct_facet :
public std::numpunct<charT> {
21 punct_facet(charT sep) :
27 charT do_decimal_point()
const override {
return m_Sep; }
37 m_SubjectInformation(
""),
38 m_UsedSubjectInformation(false),
39 m_UseSpecialDecimalPoint(false),
43 m_List.push_back(str);
45 m_Output.open(file, std::ios::app);
50 for (std::size_t i = 0; i < m_List.size() - 1; ++i)
52 m_Output << m_List[i] << std::endl;
60 m_Output.imbue(std::locale(std::cout.getloc(),
new punct_facet<char>(decimal)));
61 m_UseSpecialDecimalPoint =
true;
62 m_DecimalPoint = decimal;
66 std::ostringstream ss;
67 if (m_UseSpecialDecimalPoint)
69 ss.imbue(std::locale(std::cout.getloc(),
new punct_facet<char>(m_DecimalPoint)));
76 if ((m_Mode == 0) || (m_Mode == 1))
82 if (m_UsedSubjectInformation)
84 m_SubjectInformation =
"";
86 m_SubjectInformation += value + m_Separator;
87 m_UsedSubjectInformation =
false;
92 if ((m_Mode == 0) || (m_Mode == 2))
94 m_List[m_CurrentRow] = m_List[m_CurrentRow] + value + m_Separator;
99 while (m_List.size() <= m_CurrentRow)
102 m_List.push_back(str);
104 m_List[m_CurrentRow] = m_List[m_CurrentRow] + value + m_Separator;
111 if ((m_Mode == 0) || (m_Mode == 2))
114 while (m_List.size() <= m_CurrentRow)
117 m_List.push_back(str);
130 for (std::size_t i = 0; i < stats.size(); ++i)
140 AddColumn(m_SubjectInformation + stats[i].first);
145 m_UsedSubjectInformation =
true;
157 for (std::size_t i = 0; i < stats.size(); ++i)
161 NewRow(
"EndOfMeasurement");
168 if ((withHeader) && (m_CurrentElement == 0))
178 for (std::size_t i = 0; i < stats.size(); ++i)
182 NewRow(
"EndOfMeasurement");
void AddColumn(std::string value)
void AddResult(std::string desc, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool, bool withDescription)
FeatureResultWritter(std::string, int mode)
std::vector< std::pair< std::string, double > > FeatureListType
void AddSubjectInformation(std::string value)
void NewRow(std::string endName)
void AddHeader(std::string, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool withHeader, bool withDescription)
void SetDecimalPoint(char decimal)