Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
valosekj opened this issue Jun 3, 2024 · 1 comment
Open
Assignees

Comments

@valosekj
Copy link
Member

valosekj commented Jun 3, 2024

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.

@valosekj
Copy link
Member Author

valosekj commented Jun 6, 2024

Note that the script has been moved: ivadomed/MetricsReloaded#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants