SyneRBI / PETRIC

PET Image Reconstruction Challenge 2024
https://www.ccpsynerbi.ac.uk/events/petric/
2 stars 2 forks source link

`import petric` reads all data and other comments #31

Closed KrisThielemans closed 1 week ago

KrisThielemans commented 1 week ago

When experimenting on one data-set, it is convenient to import petrid to get petric.get_data(). However, currently the import actually reads all (3) data-sets. That takes some time and a lot of memory (and will just become worse). This is due to https://github.com/SyneRBI/PETRIC/blob/58750541908e4ace9d47e4aed731c709628574ca/petric.py#L171-L181 I suggest to convert data_metric_pairs a list of pairs of srcdir, outdir and metrics. This will also have the effect that the redirection https://github.com/SyneRBI/PETRIC/blob/58750541908e4ace9d47e4aed731c709628574ca/petric.py#L155-L156 will write files in the relevant outdir when get_data is called (currently, all redirections will be in the folder for the last get_data call). (By the way, the redirection filenames should not use the BSREM prefix.)

Also, I see no reason to have https://github.com/SyneRBI/PETRIC/blob/58750541908e4ace9d47e4aed731c709628574ca/petric.py#L182-L183