Skip to content

compute_metrics_reloaded.py - consider other output type than CSV #51

@valosekj

Description

@valosekj

The compute_metrics_reloaded.py script currently outputs the segmentation performance metrics into CSV files:

# save as CSV
fname_output_csv = os.path.abspath(args.output)
df.to_csv(fname_output_csv, index=False)
print(f'Saved metrics to {fname_output_csv}.')
# save as CSV
fname_output_csv_mean = os.path.abspath(args.output.replace('.csv', '_mean.csv'))
df_mean.to_csv(fname_output_csv_mean, index=False)
print(f'Saved mean and standard deviation of metrics across all subjects to {fname_output_csv_mean}.')

The CSV files might be tricky to read in the terminal (due to CSV formatting).

A possible solution is to use a workaround such as function column_csv { column -t -s $';' ${1} }, followed by column_csv <file.csv>. But this does not work well if the CSV file has a lot of columns.

--> we can explore other ways how to save the metrics, such as pandas.DataFrame.to_markdown.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions