-
Notifications
You must be signed in to change notification settings - Fork 178
Developer question: why so many clones? #811
Copy link
Copy link
Open
Labels
Description
This came up because of slow performance in ants.resample_image for large images
Lots of copies of the big image happening
ANTsPy/ants/ops/resample_image.py
Lines 50 to 60 in 43c7174
if image.components == 1: inimage = image.clone('float') outimage = image.clone('float') rsampar = 'x'.join([str(rp) for rp in resample_params]) args = [image.dimension, inimage, outimage, rsampar, int(use_voxels), interp_type] processed_args = process_arguments(args) libfn = get_lib_fn('ResampleImage') libfn(processed_args) outimage = outimage.clone(image.pixeltype) return outimage
Originally posted by @cookpa in #810
Do all these clones need to happen? Would it be possible to initialize a dummy image and pass that pointer to libfn?
Reactions are currently unavailable