Skip to content

Scatter Estimation / Sinogram interpolation in 3D - #1156

Open
NikEfth wants to merge 8 commits into
UCL:masterfrom
NikEfth:scatter_3d
Open

Scatter Estimation / Sinogram interpolation in 3D#1156
NikEfth wants to merge 8 commits into
UCL:masterfrom
NikEfth:scatter_3d

Conversation

@NikEfth

@NikEfth NikEfth commented Feb 8, 2023

Copy link
Copy Markdown
Collaborator

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

@KrisThielemans KrisThielemans left a comment

Copy link
Copy Markdown
Collaborator

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)

Comment thread src/buildblock/interpolate_projdata.cxx Outdated
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
Copy Markdown
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

Comment thread src/buildblock/interpolate_projdata.cxx Outdated
{
Array<3,float> extended =
extend_segment_in_views(proj_data_in.get_segment_by_sinogram(0), 2, 2);
{ //TODO: be removed ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

??

Comment thread src/buildblock/interpolate_projdata.cxx Outdated
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
Copy Markdown
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
Copy Markdown
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

NikEfth commented Feb 17, 2023

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Collaborator

Where is the .clang-format file?

in the STIR root 😄

@KrisThielemans

Copy link
Copy Markdown
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

NikEfth commented Mar 16, 2023

Copy link
Copy Markdown
Collaborator Author

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

@KrisThielemans

Copy link
Copy Markdown
Collaborator

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

@markus-jehl

Copy link
Copy Markdown
Contributor

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

@NikEfth

NikEfth commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

Is this PR still useful or completely superseded?

@KrisThielemans

Copy link
Copy Markdown
Collaborator

I don't think it is completely obsolete. Certainly, there's nothing on master that does 3D upsampling.

It'd be great to have a 3D upsampler of course, but I haven't check the current approach nor do I know what other things are going on in Groningen, but I suppose you do.

@NikEfth

NikEfth commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

Not sure what you mean about other things in Groningen

@codacy-production

codacy-production Bot commented Aug 27, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 medium

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
UnusedCode 1 medium
BestPractice 1 medium

View in Codacy

🟢 Metrics 98 complexity · 5 duplication

Metric Results
Complexity 98
Duplication 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@NikEfth

NikEfth commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator Author

@Aparna1403J @KrisThielemans This is moving forward quite well I think.
Fixed extending the projdata in obligue segments following @markus-jehl modifications and the first step of the 3D interpoloation which is very similar to what the non-3D does but for obligue segments, too.

Next step the michelogram interpolation and this will be finished.

NikEfth and others added 6 commits September 7, 2026 15:57
Support for 3D sinogram interpolation, which allows us to run 3D SSS.
* Guard if enough axial positions exist for the type of interpolation that is asked
* First step of interpolation is finished, michelogram to follow.
@NikEfth

NikEfth commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author
image

As tests are starting piling up I want to paste here a comparison of the output of scatter_interpolation_test_cyl_asymmetric(). This is the 28th (out of 29) segment (1st axial position).
On the left is the full projdata. In the middle is the 3D upsampling / interpolation and on the right going through 2D interpolation and inverse SSRB.

* One bug fix for the oblique sinograms, corrected
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