openneuropet / PET2BIDS

PET2BIDS helps you convert your PET data into BIDS! raw PET scanner files (e.g. ecat, dicom) and additional side files like .e.g excel sheets -- paper @JOSS https://doi.org/10.21105/joss.06067
https://pet2bids.readthedocs.io
MIT License
26 stars 20 forks source link

[BUG] flatten series crashes conversion when invalid data is in spreadsheet #280

Open bendhouseart opened 9 months ago

bendhouseart commented 9 months ago

Describe the bug pypet2bids crashes when bad input values are present in a blood spreadsheet.

To Reproduce Include a nonsense/non-pythonic datatype in a spreadsheet column and read it in with the --metadata-path argument in dcm2niix4pet. e.g. #DIV/0!

Expected behaviour Conversion completes and outputs a blood tsv, sidecar, etc with an empty value for the entity instead of raising the following error:

*pypet2bids/helper_funictions.py, line 117, in flatten_series
    raise Exception(f"Invalid Series: {series}")

Exception: Invalid Series: 0 NaN

Desktop (please complete the following information):