-
Notifications
You must be signed in to change notification settings - Fork 95
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
Root data energy information is converted to keV instead of MeV #736
Conversation
could you put this on |
This is done only in the when reading energy information.
aac4d82
to
41a5136
Compare
We are assuming the root data is in One final silly suggestion would be to check the values of the energy information, for both thresholds and actual values, and if less than 1, we assume the energy is in STIR should use keV as the energy unit, which includes |
Hi, yes the root data is in MeV. With this PR you did, if you try to access the energy info (for instance during the unlisting), that will still be in MeV, as it's been only multiplied during the thresholding but it's not set to keV. This could all be fine in the case we don't need to access the energy info anymore i guess? not sure I have done this on my branch : https://github.com/ludovicabrusaferri/STIR/blob/5470dcf08d0f1b584e2764795e21a0d3a9f4de5f/src/include/stir/listmode/CListRecordROOT.h#L137-L153. If this can be of any help, I am also setting the energy info from the scanner template and not from root header: Keep me posted! I am happy to help |
Thank you for the input @ludovicabrusaferri Im sorry but I cant work out why you create
As far as I know, the energy information, from list mode, is only ever accessed in these window checks (in the master). Inspired by your code, perhaps we could set the
in https://github.com/UCL/STIR/blob/master/src/include/stir/IO/InputStreamFromROOTFile.h. That way, everything is clean. We can then convert your energy window checks to a standardised keV units? What I don't know is the this suggestion's impact on computation, i.e. the multiplcation or the call of a function multiple times for each list mode event.
I initially thought we could do this, but I think this is dangerous in the long run as |
I certainly agree that any STIR class should only return numbers in keV. If ROOT stores in MeV, we convert internally before we pass it on (a multiplication with 1000 isn't going to kill us, compared to all the rest!) For @ludovicabrusaferri 's work, there are 2 things:
However, for listmode recon, you either have some kind of filtering of events, or you need to write projectors that are energy aware (which we don't have). At present, the ROOT code allows you to do that filtering, so we cannot remove it until we put something more general in the listmode recon (similarly, Nikos created some things in the TOF branch to specify the TOF window width in the .hroot, such that you can simulate different DACs.) Another somewhat tricky part is that in contrast to ROOT, in most scanners, listmode wouldn't give you an energy-pair, but an energy window pair index, where the energy window info sits in some header. (i.e. energy info is discretised, such as TOF or indeed ring/crystal info is discretised). So a Anyway, after all this, I believe that the current PR is good (except that I'd like to see it on (I certainly think that breaking #722 in smaller PRs would be a good strategy. Depends if it can be done without having interdependencies between PRs.) |
Clean up the conversion of energy information to keV using methods. Updates the documentation regarding ROOT energy units and the conversion
I think it is on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (aside from 1 line in the release_4.1.htm).
@ludovicabrusaferri are you ok with this?
@KrisThielemans Sounds good to me. I have energyA and energyB because I kept the same strategy used for time in https://github.com/ludovicabrusaferri/STIR/blob/5470dcf08d0f1b584e2764795e21a0d3a9f4de5f/src/include/stir/listmode/CListRecordROOT.h#L86 (https://github.com/ludovicabrusaferri/STIR/blob/5470dcf08d0f1b584e2764795e21a0d3a9f4de5f/src/include/stir/listmode/CListRecordROOT.h#L139). It made sense in my mind to create a copy of the time1/time2 or energy1/energy2 but it's probably unneeded? |
@ludovicabrusaferri not 100% sure really how @NikEfth set-up the ROOT parsing (I knew, but forgot!). It's a special type of handling of listmode data, as other CListRecord classes just get whatever is stored in the record, while for ROOT, @NikEfth copied the data into class members. Both work, not 100% sure what is fastest (likely application dependent). In any case, it'd make sense for you to copy energy info as well then. I did wonder why your chose anyway these comments should really sit in #722 I guess 😉 |
Addresses #356. @ludovicabrusaferri I cannot figure out how you handled this issue in #722.
This is done when properties of the list mode event are queeried to be between
upper/low energy window (keV)
.Edit: Our work around by setting
upper/low energy window (keV)
to an MeV value (e.g. 0.65) no longer works. This energy information is needed for scatter estimation code. Usinglm_to_projdata
to unlist a root file, theupper/low energy window (keV)
information in the output sinogram is set from the hroot file, overwriting that in thetemplate sinogram
.