-
Notifications
You must be signed in to change notification settings - Fork 998
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
Geometric transform -- Resize #7509
base: geometric
Are you sure you want to change the base?
Conversation
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
for more information, see https://pre-commit.ci
return points_affine | ||
|
||
|
||
def resize_point(points, out_size, dtype, input_ndim, lazy, transform_info, **kwargs): |
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.
How can we avoid having *_point(...)
functions for each operation? At this level, shouldn't we be able to always just pass the correct transform? If we think about object space (raster space) and world space transforms then we shouldn't need to be performing these calculations based on spatial size here.
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.
As far as I understand it, resize should have no effect on point data, as it is entirely a "raster" space operation that preserves the extents of an image or volume, no?
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.
As discussed in the meeting, the alternative of taking the operation that defines the operation out of the function and putting it into its own implementation function works just as well as what I am suggesting.
def resize_point(data, lazy, ...):
meta_info = get_resize(...)
out = apply_to_geom(data, metainfo, lazy)
return out
def resize_image(data, lazy, ...):
meta_info = get_resize(...)
if not lazy:
out = torch.interpolate(data, meta_info.affine)
else:
out = out.copy_meta_from(meta_info)
return out
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Part of #7486
Description
Geometric transform -- Resize
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.