-
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
ScatterEstimation convergence problem fix #1160
ScatterEstimation convergence problem fix #1160
Conversation
…at set_up and in each iteration. Plus some code tidy-up that happened along the way during the investigation.
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. can you check what happens if the initial image isn't initialised? (presumably taken care of by get_initial_data_sptr
though)
Just ran it and it works fine, as expected! |
great. It'd be reassuring if you or @emikhay could run some more scatter estimations on your previous data with this branch before we merge. Also, please add something to the release notes (`[ci skip]') |
Triple-checked it with simulated data and BPET reconstructions with different normalisations - everything looks good. |
Hmm... I guess modifying how many iterations the scatter and the underlying OSMAPOSL performs will have a similar impact then? Because all this change is doing is offset the starting point of OSMAPOSL, making it slower to converge. Would it be possible to suggest bumping up the OSMAPOSL iterations as the "legacy mode" you are proposing, instead of actually introducing a new setting? |
it's a pain... but I think user experience isn't great if we release 5.2 which gives scatter estimation differences. Of course, scatter estimation results depend a lot on specific settings used. The Siemens example uses 21 OSEM updates per scatter iteration, so not so small. STIR/examples/Siemens-mMR/scatter_and_recon.sh Lines 80 to 81 in 2e68f4d
Image values (max around 0.12) are also not so far off from 1. So that means people could see bigger differences in their data. I suggest therefore introducing a new variable and method |
Something to consider with this methodology is the persistent OSEM image might begin to converge and noisy. I am not sure whether this would happened or what its effect on scatter estimation would be. |
You raise a good point: it sounds to me like the total sum of OSEM iterations is the relevant factor. If we reset the image, then we need to perform this total sum each scatter estimation iteration. Otherwise, we can divide the sum by the scatter estimation iterations and only do this fraction in each iteration (saving a lot of time). |
@KrisThielemans : happy to add this setting (especially if it is defaulted to false ;-) ). |
I'm fairly sure that we heavily postfilter (necessary for the downsampling anyway), so I don't think noise increase is a big issue. Of course, this is a user-tunable parameter, so it likely could use some more doc. |
Yes, but this is getting into the specific implementation that is probably best left to the user. Adding |
I am just catching up with this. Are you sure that the scaled normalization factors do actually normalize your data? The issue with the normalization in scatter estimation is something that still gets under my skin. If you invert "A" and put in the gaps 10^12. This is "B" and you should use this. If you invert the "C" and put 10^12 in the gaps this is "D" and you should not use this! Edit (I forgot one case): So if in your case, your scaling go from "B" to "A" you should not do that. I don't think this option is correct. Edit: |
@NikEfth, I'll try to answer this, but it might be hard to write this up. In any case, I can't see how this is related with this PR? The problem that is resolved with this PR is if you scale the norm factors (without gaps), the image should scale appropraitely, but the (upsampled) scatter estimate should be the same. With the existing code, it'd only do that if you let OSEM iterate for a long time (as its convergence rate depends on the initial scale of the image as there is a background term). Of course, still good to see the intermediate images. |
I agree. But if you scale the norm factors as described in #1112, it might not be the case anymore. |
with this PR, it will. Obviously, there's still the issue that without providing an initial image, OSMAPOSL will initialise with 1, which might be a terrible choice for your data, and that it will still take a while to recover the correct scale. |
On your previous comments
What do you mean with “you should not use it”? How? If you give measured data from a normalisation scan as input to
Yes, because we cannot (reliably) store infinite normalisation factors. (Note of course that with this “direct normalisation” approach, noise in the measurements is an issue, but that’s not what we're talking about here)
What do you mean? How would you use it? If you use
Obviously by now I’m lost what you mean with C and D. (By the way, we now have a |
Well, I have seen people using this file, so I tried to cover all bases.
Indeed, it is the direct normalization and I recommend using this for the scatter estimation.
Indeed, but for true events. So the component-based worked better for me in the final reconstruction. It is my understanding that this discussion started when @markus-jehl tried to scale the norm factors by a large value. And I believe that this was the problem with the reported behaviour. |
I don't disagree with your statements on use of direct/component-based norm factors and scatter, but I don't think this has anything to do with this PR.
indeed.
Not sure what you mean with "this". In any case, this PR resolved that problem. |
I've re-run the Siemens NEMA example data. Unfortunately this has uncovered another problem. For that data, both I mention this here as it would influence the difference between this PR and |
@NikEfth we're going to merge this soon, unless you have any concrete proof that this is buggy? |
rewrote the description of the updates to the scatter estimate a bit
Fix for #1112.