Skip to content

GRD2D and DDSR2D: algorithms for PET and SPECT Reconstruction#1595

Merged
KrisThielemans merged 120 commits intoUCL:masterfrom
Dimitra-Kyriakopoulou:GRD2D--DDSR2D
Oct 29, 2025
Merged

GRD2D and DDSR2D: algorithms for PET and SPECT Reconstruction#1595
KrisThielemans merged 120 commits intoUCL:masterfrom
Dimitra-Kyriakopoulou:GRD2D--DDSR2D

Conversation

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor

@Dimitra-Kyriakopoulou Dimitra-Kyriakopoulou commented May 15, 2025

Changes in this pull request

Two new analytic reconstruction algorithms added. The run_test_simulate_and_recon.sh file had to also change.

Testing performed

Locally on my pc.

Checklist before requesting a review

  • I have performed a self-review of my code
  • [] I have added docstrings/doxygen in line with the guidance in the developer guide
  • [] I have implemented unit tests that cover any new or modified functionality (if applicable)
  • The code builds and runs on my machine
  • [] documentation/release_XXX.md has been updated with any functionality change (if applicable)

@KrisThielemans KrisThielemans self-assigned this May 20, 2025
@KrisThielemans
Copy link
Copy Markdown
Collaborator

MacOS job errors in recon_test_pack

==> my_SRT2DSPECT_test_sim.par_force_zero_view_offset.log <==
ERROR: Error opening file my_sino_force_zero_view_offset.hs

==> my_DDSR2D_test_sim.par_force_zero_view_offset.log <==

WARNING: KeyParser warning: unrecognized keyword: noise filter2
ERROR: Error opening file my_sino_force_zero_view_offset.hs

No idea why yet, but note the unrecognized keyword: noise filter2. This doesn't cause an error, but it does indicate on (obsolete?) keyword in the .par file.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dimitra-Kyriakopoulou commented May 21, 2025

Dear Professor @KrisThielemans,
Thank you so much for your comments!
I’ve corrected the “noise filter2” mistake -in the parameter file I had forgotten the space (“noise filter 2”).

For the Mac issue, it seems as if '_force_zero_view_offset' is applied to the two SPECT algorithms, which is not the case in run_test_simulate_and_recon.sh (only _SPECT suffix applies to them). Could uneven indentation/extra spaces be confusing the code?

THANK YOU WHOLEHEARTEDLY FOR YOUR HELP!!!

Comment thread recon_test_pack/run_test_simulate_and_recon.sh Outdated
@KrisThielemans
Copy link
Copy Markdown
Collaborator

That didn't help. I guess we need somebody with a Mac to try this.

Removed ‘|’ in case the macOS version fails to support it.
@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans,
Thank you wholeheartedly for all your help!!!

Mac now runs! As there was no issue when SRT2DSPECT run on its own, I tried splitting SRT2DSPECT and DDSR2D into separate IF blocks to remove '|'; it seems the MacOS version cannot support '|'.

May I please ask for your guidance and assistance with the pre-commit test as well? I’m afraid I don’t see how to resolve it.

THANK YOU WHOLEHEARTELDLY FOR ALL YOUR INVALUABLE HELP!!!

Comment thread examples/samples/DDSR2D.par Outdated
Comment thread examples/samples/GRD2D.par
Comment thread recon_test_pack/GRD2D_test_sim.par
Comment thread recon_test_pack/DDSR2D_test_sim.par
Comment thread recon_test_pack/run_test_simulate_and_recon.sh
Comment thread src/analytic/GRD2D/GRD2DReconstruction.cxx Outdated
Comment thread src/analytic/GRD2D/GRD2DReconstruction.cxx Outdated
Comment thread src/analytic/GRD2D/GRD2DReconstruction.cxx Outdated
Comment thread src/analytic/GRD2D/GRD2DReconstruction.cxx Outdated
Comment thread src/analytic/GRD2D/GRD2DReconstruction.cxx Outdated
 Temporary: disable OpenMP in SRT2D to avoid sporadic CI failures with clang/OpenMP (see STIR#1626)
Correction of typo and of description
one line with description of input data
@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dimitra-Kyriakopoulou commented Oct 24, 2025

Dear Professor @KrisThielemans,
THANK YOU WHOLEHEARTEDLY FOR ALL YOUR INVALUABLE HELP!!!
I applied the review comments. I will send you the copyright document late evening.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans,
I just changed the thesis reference, and updated its comment.

The SRT update (parallelization comment etc) are included in this PR.

Can you please ask for your help on how to pass the pre-commit check? THANK YOU WHOLEHEARTEDLY

@KrisThielemans
Copy link
Copy Markdown
Collaborator

@Dimitra-Kyriakopoulou I've added copyright lines for you, as well as ran pre-commit.

Could you please write some brief text on this PR to add to the release notes. Summarise the main contributions (DDSR2D and GRD2D of course), but also note that the modifications you made to SRT2D. I'll enter it into the release notes on your behalf.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans,
THANK YOU WHOLEHEARTEDLY!!!

I) Copyright

  1. As your student, is it really necessary to have copyright in my name?
    If so, shouldn't there be copyright in your name as co-author?

  2. I am not certain I completed the copyright doc correctly.

  3. A small typo in SRT2D: 2020 in place of 2024.

II) Release notes

  1. Would it be OK for the release notes to include just the few comments from the .h files?

  2. Should there be references to the papers? In the .h files, there is a reference to the thesis where the papers are referenced.
    SRT was the name coined in its introduction paper, but the other two names were chosen by me.

  3. SRT algorithms and the filters were not included in the previous version in June 2024. Hence, should I give a brief description of them too?

3b. Now the SRT2D change was commenting out parallelization and creating a physical grid in place of the previous fixed [-1,1] grid. However, isn’t this too technical?

  1. Proposed descriptions.
    SRT2D models each PET projection (per angle) with natural cubic splines along the tangential
    coordinate, then performs the required angular integration on these spline representations to
    form the image. The implementation exploits geometric symmetries.

SRT2DSPECT models each projection with cubic splines along the detector (tangential) axis and explicitly
accounts for attenuation: it applies exponential weighting and a Hilbert-transform term to the spline representation,
then accumulates over the projection angles to form the image.

GRD2D maps each PET view into Fourier space, interpolates non-uniform samples to a Cartesian
grid using a Kaiser–Bessel kernel, then applies an inverse 2D FFT and resamples to the output image. A radial
low-pass noise filter can suppress high-frequency noise.

DDSR2D reconstructs a 2D activity image from parallel-beam SPECT data with attenuation.
It forms exponentially weighted projections, applies Hilbert transforms along the detector
axis, differentiates with respect to the tangential coordinate, and integrates over angle
(backprojection). Two optional frequency-domain cut-offs control smoothing.

Adaptive Wiener and Gamma post-filters were implemented.

THANK YOU WHOLEHEARTEDLY FOR ALL YOUR HELP!!!

@KrisThielemans
Copy link
Copy Markdown
Collaborator

I) Copyright

  1. As your student, is it really necessary to have copyright in my name?
    If so, shouldn't there be copyright in your name as co-author?

you wrote the code, you own the copyright. Mine is owned by UCL. So we're both included.

  1. A small typo in SRT2D: 2020 in place of 2024.

I've now used dates for SRT2D* from your documentation.

II) Release notes

I've merged this with the previously existing text. Please check.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans ,
THANK YOU WHOLEHEARTEDLY!!!

I am really sorry -the dates for copyright are unfortunately complex ...

-The SRT2D had this current change of grid (and commented out parallelization); hence would it need 2025?
-DDSRT2D and GRD2D initial versions were also created in 2014-2016. Should that be added too?
-Also I returned to working on the 5 codes (the 4 in the pull request and the 3D) in 2023. Should it be 2023 instead of 2024?

I am really sorry for all the trouble ...

@KrisThielemans KrisThielemans added this to the v6.3 milestone Oct 29, 2025
@KrisThielemans
Copy link
Copy Markdown
Collaborator

AppVeyor builds time-out. This should be fine once we merge on master.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans,
THANK YOU WHOLEHEARTEDLY FOR ALL YOUR HELP!!!

I am really sorry: SRT2D is the only alg that is from 2012–2016, not 2014–2016. The former was in the .h, so I did not mention it in the last post. I just changed the .cxx and committed.

I am really sorry for all the trouble. It stemmed from me wrongly thinking copyright was related only to merging into STIR.

@KrisThielemans KrisThielemans merged commit c4f12cf into UCL:master Oct 29, 2025
11 of 12 checks passed
@KrisThielemans
Copy link
Copy Markdown
Collaborator

Done!

Thanks a lot. A great step forward.

@Dimitra-Kyriakopoulou
Copy link
Copy Markdown
Contributor Author

Dear Professor @KrisThielemans ,
This result was only possible because of your invaluable help.
I am beyond grateful for all your generous and invaluable help and guidance!!!
THANK YOU WHOLEHEARTEDLY!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants