UCL / STIR

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

Scanner coincidence window depends on TOF data #1481

Open KrisThielemans opened 1 month ago

KrisThielemans commented 1 month ago

We currently cannot set the coincidence window, even if we know it, or it is contained in the data (for instance, for Siemens data we ignore the field, and for GE data we don't read it either). The current code is https://github.com/UCL/STIR/blob/8c57bc93894e9245b6c9b90e4ce755f958d656ac/src/buildblock/Scanner.cxx#L2214-L2218 with https://github.com/UCL/STIR/blob/8c57bc93894e9245b6c9b90e4ce755f958d656ac/src/include/stir/Scanner.inl#L263-L266 This therefore only works for TOF data. (It is also potentially dangerous if someone would create a wrong scanner object with fewer (uncompressed) TOF bins than actually used, but that seems up to them and could be addressed via documentation)

The coincidence window is currently only used in the RFS calculation https://github.com/UCL/STIR/blob/8c57bc93894e9245b6c9b90e4ce755f958d656ac/src/data_buildblock/randoms_from_singles.cxx#L37. This is currently only used for GE data (but it would therefore fail when using trimmed data, or for the Omni as that's non-TOF).

After thinking about this a bit, my impression is that we don't need a separate coincidence_window member in Scanner, as even for non-TOF, we can say the num_timing_poss=1 and set the TOF bin width to the coincidence window. We can therefore already set it in the Scanner initialisation as well as parse this from the header etc.

Of course, it's going to be hard to find timing resolution for non-TOF scanners, so the condition on is_tof_ready would have to be changed. This is already done in #1430: https://github.com/UCL/STIR/blob/34a35de49f905c10cf458f7b17565432954ee2d5/src/include/stir/Scanner.inl#L263-L266

In any case, it'd be nice to check the computed value with whatever the scanner reports (if it does).

@danieldeidda if you know the relevant info for the Mediso AnyScan, you can already add it in your Interfile headers, and (ideally) Scanner.cxx.

@NikEfth are we missing something else?

danieldeidda commented 1 month ago

After thinking about this a bit, my impression is that we don't need a separate coincidence_window member in Scanner, as even for non-TOF, we can say the num_timing_poss=1 and set the TOF bin width to the coincidence window. We can therefore already set it in the Scanner initialisation as well as parse this from the header etc.

I think I am confused, then what do I set it to if there is no member? also what is the keyword to save into the header?

KrisThielemans commented 1 month ago

If you'd fill in

 Maximum number of (unmashed) TOF time bins := 264
 Size of unmashed TOF time bins (ps)        := 17.9039
 TOF timing resolution (ps)                 := 214

(these are values for the Vision 600), it'll compute the coincidence window from the above as per the code.

danieldeidda commented 1 month ago

So are you saying to have these even with scanners with no ToF?

KrisThielemans commented 1 month ago

yes, maximum number, size of bin = coincidence window, tof timing resolution: something very big. (not used for the coincidence window calculation)