-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: master
Are you sure you want to change the base?
Conversation
…mplate' into zoom_image_from_template
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.
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
void zoom_image(const STIRImageData& original_image, | ||
const stir::ZoomOptions zoom_options = stir::ZoomOptions::preserve_sum); | ||
|
||
void zoom_image(const STIRImageData& original_image, | ||
const char* const zoom_options_str = "preserve_sum"); |
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.
naming of parameter would have to be template_image
. Needs some doxygen as well. Finally, I'd prefer these to be called exactly the same as the Python version. e.g. zoom_image_as_template
if not isinstance(template, ImageData): | ||
raise error('zoom_image_from_template: template should be ImageData') | ||
|
||
### becaus of a bug somewherre |
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.
misspellings and indentation problems.
@@ -681,6 +681,24 @@ def zoom_image(self, zooms=(1., 1., 1.), offsets_in_mm=(0., 0., 0.), | |||
np_offsets_in_mm.ctypes.data, np_size.ctypes.data, scaling)) | |||
|
|||
return zoomed_im | |||
|
|||
def zoom_image_from_template(self, template, scaling='preserve_sum'): |
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.
what about zoom_image_as_template
?
Changes in this pull request
Added method for
ImageData
to zoom image using geometrical information from a template imageTesting performed
ImageData
zoomed usingzoom_image_from_template()
andzoom_image()
with manually calculated arguments (although dimensions will be different).zoom_image
using stir pythonRelated issues
Checklist before requesting a review
Contribution Notes
Please read and adhere to the contribution guidelines.
Please tick the following: