UCL / STIR

Software for Tomographic Image Reconstruction
http://stir.sourceforge.net/
Other
108 stars 91 forks source link

BinNormalisation crash when no time-frame info present #853

Closed KrisThielemans closed 3 years ago

KrisThielemans commented 3 years ago

Tracking https://github.com/SyneRBI/SIRF/issues/892 down, shows that we have a crash at https://github.com/UCL/STIR/blob/56f742977c837ccd51c2f3e5fc1fb8f78c2353cb/src/recon_buildblock/BinNormalisation.cxx#L193-L194 This is because there is no time frame info in the test data. We should handle this gracefully.

it's not so obvious how to though. Some BinNormalisation objects would need the time-frame info, others not. I guess their set_up function should check if it needs it or not, so that's fine. However, the undo function wouldn't know it.

But... it turns out that pretty much all these functions do not use the start_time and end_time, so possibly this problem disappears once we cut them out!

In any case, exam_info_sptr->get_time_frame_definitions().get_start_time() needs to do a check and write a more sensible error message.

danieldeidda commented 3 years ago

Shall we assume that all data should have at least 1 frame and set it if the exam_info-> time-frame is empty? otherwise I am a bit confused how to differentiate between test data and "real" data

KrisThielemans commented 3 years ago

I would first start by cutting all calls to get_time_frame_definitions() where we don't need them, and raising a suitable error when they're not set. Maybe that'll be enough? (Probably not, but let's see)