Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::cl::FeatureResultWriter Class Reference

Writes classification feature results to a CSV-style output file. More...

#include <mitkCLResultWriter.h>

Public Member Functions

 FeatureResultWriter (std::string filePath, int mode)
 Construct a result writer for the given file path. More...
 
 ~FeatureResultWriter ()
 Destructor. Flushes and closes the output file. More...
 
void SetDecimalPoint (char decimal)
 Set a custom decimal point character for numeric output. More...
 
void AddSubjectInformation (std::string value)
 Add subject-identifying information to the current row. More...
 
void AddColumn (std::string value)
 Add a string column value to the current row. More...
 
void AddColumn (double value)
 Add a numeric column value to the current row. More...
 
void NewRow (std::string endName)
 Finalize the current row and start a new one. More...
 
void AddResult (std::string desc, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool withHeader, bool withDescription)
 Add a row of feature results to the output. More...
 
void AddHeader (std::string desc, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool withHeader, bool withDescription)
 Add a header row describing the feature columns. More...
 

Detailed Description

Writes classification feature results to a CSV-style output file.

Supports row-by-row construction of output with columns for subject information, feature descriptions, and computed feature values. Results can be written with configurable decimal point characters and optional header rows.

Definition at line 35 of file mitkCLResultWriter.h.

Constructor & Destructor Documentation

◆ FeatureResultWriter()

mitk::cl::FeatureResultWriter::FeatureResultWriter ( std::string  filePath,
int  mode 
)

Construct a result writer for the given file path.

Parameters
filePathPath to the output file.
modeOutput mode (0 = new file, 1 = append).

◆ ~FeatureResultWriter()

mitk::cl::FeatureResultWriter::~FeatureResultWriter ( )

Destructor. Flushes and closes the output file.

Member Function Documentation

◆ AddColumn() [1/2]

void mitk::cl::FeatureResultWriter::AddColumn ( double  value)

Add a numeric column value to the current row.

Parameters
valueThe numeric value to add.

◆ AddColumn() [2/2]

void mitk::cl::FeatureResultWriter::AddColumn ( std::string  value)

Add a string column value to the current row.

Parameters
valueThe string value to add.

◆ AddHeader()

void mitk::cl::FeatureResultWriter::AddHeader ( std::string  desc,
int  slice,
mitk::AbstractGlobalImageFeature::FeatureListType  stats,
bool  withHeader,
bool  withDescription 
)

Add a header row describing the feature columns.

Parameters
descDescription string for this header.
sliceThe slice index.
statsThe feature list used to derive column names.
withHeaderWhether to actually write the header.
withDescriptionWhether to include feature description columns.

◆ AddResult()

void mitk::cl::FeatureResultWriter::AddResult ( std::string  desc,
int  slice,
mitk::AbstractGlobalImageFeature::FeatureListType  stats,
bool  withHeader,
bool  withDescription 
)

Add a row of feature results to the output.

Parameters
descDescription string for this result set.
sliceThe slice index (-1 for the entire image).
statsThe list of computed feature name-value pairs.
withHeaderWhether to include a header row before the data.
withDescriptionWhether to include feature description columns.

◆ AddSubjectInformation()

void mitk::cl::FeatureResultWriter::AddSubjectInformation ( std::string  value)

Add subject-identifying information to the current row.

Parameters
valueThe subject identifier string.

◆ NewRow()

void mitk::cl::FeatureResultWriter::NewRow ( std::string  endName)

Finalize the current row and start a new one.

Parameters
endNameA label appended at the end of the row.

◆ SetDecimalPoint()

void mitk::cl::FeatureResultWriter::SetDecimalPoint ( char  decimal)

Set a custom decimal point character for numeric output.

Parameters
decimalThe decimal separator character (e.g. ',' for European locale).

The documentation for this class was generated from the following file: