You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are willing to find the warp/displacement on a grayscale version of the image, but want to apply it to all 3 layers in the color version, then here is a simple hack to warp_image():
def warp_image(image, displacement):
image_size = image.size
grid = compute_grid(image_size[:2], dtype=image.dtype, device=image.device)
out=image_from_numpy(np.empty(image_size),(),(),device=image.device,dtype=image.dtype)
if len(image_size==2):
out.image = transformation.utils.F.grid_sample(image.image, displacement + grid)
else:
for i in range(image_size[-1]):
out.image[...,i] = transformation.utils.F.grid_sample(image.image[...,i], displacement + grid)
return out
The text was updated successfully, but these errors were encountered:
@bsugerman I am using drop2 registration for histopathology images but the outputs are deformation_field_x.nii.gz and deformation_field_y.nii.gz deformation fields which I would like to apply on the RGB png image channels to get a registered png RGB image.
Is there a quick way to apply your function on an RGB png image and the deformation field gz field above?
If you are willing to find the warp/displacement on a grayscale version of the image, but want to apply it to all 3 layers in the color version, then here is a simple hack to warp_image():
The text was updated successfully, but these errors were encountered: