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

Zoom image from template method for ImageData #1285

Merged
merged 12 commits into from
Mar 18, 2025

Conversation

samdporter
Copy link
Contributor

@samdporter samdporter commented Aug 21, 2024

Changes in this pull request

Added method for ImageData to zoom image using geometrical information from a template image

Testing performed

  • Compared ImageData zoomed using zoom_image_from_template() and zoom_image() with manually calculated arguments (although dimensions will be different).
  • Compared with zoom_image using stir python

Related issues

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
  • The code builds and runs on my machine
  • CHANGES.md has been updated with any functionality change

Contribution Notes

Please read and adhere to the contribution guidelines.

Please tick the following:

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in SIRF (the Work) under the terms and conditions of the Apache-2.0 License.

Sorry, something went wrong.

samdporter and others added 7 commits December 7, 2023 15:28

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…mplate' into zoom_image_from_template
Copy link
Member

@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 comments, but in addition,

  • there are some weird/unnecessary white-space differences. Please fix/ remove (see the diff on github). Some of this might be caused by editor conventions with tabs vs spaces, but even your own code doesn't like sensible in places.

  • add a line to CHANGES.md

@samdporter
Copy link
Contributor Author

samdporter commented Jan 28, 2025

Hey Kris,
I think I've corrected all the bits you asked for. zoom_image_as_template is now used across the board and I removed some odd whitespace. The Doxygen comments are only one line but I think it should be sufficient.

Are there any specific unit tests that I should add or is it enough that they (probably) exist in STIR?

Copy link
Member

@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.

I still see strange inconsistent indentation in the C/C++ files, but as we currently don't have a way to enforce this, I'm prepared to accept it.

@KrisThielemans
Copy link
Member

@evgueni-ovtchinnikov want to review?

@KrisThielemans
Copy link
Member

@samdporter could conceivably add a Python test (e.g. zoom, test if geometric_info is the same). Not sure how easy it is, and a lot of this is untested anyway, but I'd appreciate it :-)

Copy link
Contributor

@evgueni-ovtchinnikov evgueni-ovtchinnikov left a comment

Choose a reason for hiding this comment

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

please see my comments for cstir.cpp line 1513 and STIR.py line 699

Copy link
Contributor

@evgueni-ovtchinnikov evgueni-ovtchinnikov left a comment

Choose a reason for hiding this comment

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

looks ok

@samdporter
Copy link
Contributor Author

I was thinking that perhaps zoom_image_to_template makes more sense?

I'll get on the python test next week. Sorry for the delay

@@ -176,10 +176,8 @@ void* cSTIR_newObject(const char* name)
return NEW_OBJECT_HANDLE(RayTracingMatrix);
if (sirf::iequals(name, "SPECTUBMatrix"))
return NEW_OBJECT_HANDLE(SPECTUBMatrix);
#if STIR_VERSION >= 050100
Copy link
Member

Choose a reason for hiding this comment

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

probably fine to remove this since STIR_REQUIRED_VERSION in cmake is currently 6.0

@casperdcl casperdcl merged commit 4f765cf into SyneRBI:master Mar 18, 2025
6 checks passed
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.

None yet

4 participants