Skip to content
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

Scatter Estimation / Sinogram interpolation in 3D #1156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NikEfth
Copy link
Collaborator

@NikEfth NikEfth commented Feb 8, 2023

This is in good shape. I have tested with data from various scanners.
But more testing is needed and updates in the documentation and such.

@KrisThielemans I am not sure if you would like to change the recon_tests to test this in addition to the existing one.

@NikEfth NikEfth changed the title Scatter 3d Scatter Estimation / Sinogram interpolation in 3D Feb 8, 2023
@NikEfth NikEfth self-assigned this Feb 16, 2023
Copy link
Collaborator

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments without actual review of the "working" part of the code.

Sadly, there's white-space changes here, which seems a bit arbitrary. I'd prefer to revert these. If there are any, they should be compatible with our clang-format. (we will need to run this through all of STIR, but the TOF PR needs to catch up first)

extended[y][old_min-1] = extended[y][old_min];
extended[y][old_max+1] = extended[y][old_max];
}
std::cout << "n7" << std::endl;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these will have to go

{
Array<3,float> extended =
extend_segment_in_views(proj_data_in.get_segment_by_sinogram(0), 2, 2);
{ //TODO: be removed ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

@@ -170,7 +174,8 @@ using namespace detail_interpolate_projdata;

Succeeded
interpolate_projdata(ProjData& proj_data_out,
const ProjData& proj_data_in, const BSpline::BSplineType these_types,
const shared_ptr<ProjData> proj_data_in,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change all these types to shared_ptr? It is recommended C++ practice to pass references unless you really need the pointer (e.g. because the function needs to store it after the function exists). Reasons include:

  • clearer interface: the user knows you don't need access afterwards
  • less dependency on shared_ptr (I could have a unique_ptr for instance, which I wouldn't be able to pass).

Of course, STIR isn't quite consistent in this choice, and it is confusing that we mix conventions. But I see no good reason to change the calling conventions here (certainly as proj_data_out is still a reference), but I might be missing something.

If we do need to change it, it should be a const shared_ptr<const ProjData>.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not aware of this. I thought that I was improving the code quality.
OK. I will make the changes.

@NikEfth
Copy link
Collaborator Author

NikEfth commented Feb 17, 2023

Sadly, there's white-space changes here, which seems a bit arbitrary. I'd prefer to revert these. If there are any, they should be compatible with our clang-format.

Where is the .clang-format file?

@KrisThielemans
Copy link
Collaborator

Where is the .clang-format file?

in the STIR root 😄

@KrisThielemans
Copy link
Collaborator

Sadly, #1172 will generate a lot of conflicts with this PR., and I need to merge that first (it fixes a bug). However, as #1172 simplifies the logic of the scatter umsampling, hopefully it isn't too hard to take it into account here.

Sorry, a case of development in the same place at the same time.

@NikEfth
Copy link
Collaborator Author

NikEfth commented Mar 16, 2023

Ok, no worries. Let me know when to pull it or should I wait for the master?

@KrisThielemans
Copy link
Collaborator

better to wait till it's on master I think. @markus-jehl is going to finish this soon.

@markus-jehl
Copy link
Contributor

Also, let me know if you have questions about the changes I made, @NikEfth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants