-
Notifications
You must be signed in to change notification settings - Fork 89
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
Issue/1161 improvements to scatter estimation interpolation #1172
Issue/1161 improvements to scatter estimation interpolation #1172
Conversation
…test with known ground truth and investigate boundary conditions for interpolator (to remove bright edges).
…dified InverseSSRB to work for non-1 span.
…re finding a way to deal with diagonal BlocksOnCylindrical artifact.
AppvVeyor complains with
Will also need an update in the release notes |
Also fixes #1177 |
Also fixes #1178 |
…check to ensure views and tangential bins are the same number for BlocksOnCylindrical.
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.
I haven't reviewed interpolate_projdata.cxx
very well yet. It looks reasonable but due to white-space changes, I'm not sure if it does the same as before.
src/buildblock/extend_projdata.cxx
Outdated
if (abs(segment.get_proj_data_info_sptr()->get_phi(Bin(0, segment.get_proj_data_info_sptr()->get_max_view_num(), 0, 0)) - | ||
segment.get_proj_data_info_sptr()->get_phi(Bin(0, segment.get_proj_data_info_sptr()->get_min_view_num(), 0, 0))) > _PI) |
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.
This doesn't really test for 360, but larger than 180. To cope with SPECT, I'd prefer to make this test more accurate
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.
This is actually not trivial, because for BlocksOnCylindrical scanners phi doesn't change continuously, so I can't just compare the first and last phi to _PI. Can you think of a check for specifically 180° and 360° that works for both BOC and Cylindrical?
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.
for BlocksOnCylindrical scanners phi doesn't change continuously
I guess you mean it isn't regularly sampled. True. Would something like this work?
const float phi_diff = max_phi - min_phi;
const float average_phi_sampling = phi_diff/(get_num_views()-1);
const float approx_phi_range = average_phi_sampling * get_num_views();
if (abs(phi_range - 2*_PI) < average_phi_sampling)
...
a bit elaborate of course
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.
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.
ah well. a factor ~4 off. I guess this will depend on the size of the gaps etc.
It brings us to an interesting question. The output of extend_segment
is used as input for interpolation. If the views are very different, then you could argue that we shouldn't be using the "wrap-around" ones anyway.
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.
This is true, if the views are very different it would make more sense to just extend with the current view. However, for symmetric BlocksOnCylindrical scanners it would make sense to wrap around, since this would be exactly the same view difference that we also interpolate in other places of the sinograms.
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.
I have now set it to use 5* average_sampling as the cutoff, and to fill with nearest neighbour and print a warning if it is further away from either 180° or 360°
…checks, adding doxygen comments.
By the way, is |
Let's remove the obsolete warning at https://github.com/markus-jehl/STIR/blob/d9aa91bcd260efcf57152a40becd4770eff4a148/src/buildblock/interpolate_projdata.cxx#L190-L191 |
actually, the relevant code in Cylindrical looks rather suspicious |
Yes, the tests I added do interpolation of Cylindrical data with view offsets and everything looks as expected. What part of the code looks suspicious to you? |
…r 180 and 360 degree view coverage and some more cleanup.
thanks @markus-jehl can you also remove the obsolete warning? I would need stating in the release notes as well. |
@danieldeidda @markus-jehl given the back-and-forth a bit on this PR, ok to squash-merge? |
Ok for me |
The warning is already removed, but will add this to the release notes. |
Clean version #1181 merged |
Linked to issue: #1161