-
Is your feature request related to a problem? Please describe. Describe alternatives you've considered Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 1 reply
-
Hi @ericspod @AndreasHeumann , Do you have any idea about this question? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
No, Clara Viz is not using a VTK backend for the rendering, it's using our own CUDA based renderer. The renderer includes code to re-orient a 3D volume (swap and flip axes) but not to on a random plane. |
Beta Was this translation helpful? Give feedback.
-
I had a quick look and it is supported by the import matplotlib.pyplot as plt
from monai.transforms import RandAffine, LoadImage
image = LoadImage(image_only=True)("/Users/Documents/MarsAtlas-MNI-Colin27/colin27_MNI.nii")
print(image.shape) # (181, 217, 181)
xform = RandAffine(prob=1, rotate_range=(1, 1, 1), spatial_size=(110, 120, 1))
slice_2d = xform(image[None])
print(slice_2d.shape) # (1, 110, 120, 1) single-channel, (110, 120, 1) volume
plt.imshow(slice_2d[0, :, :, 0])
plt.show() the idea is to set the output spatial size to MONAI/monai/transforms/spatial/array.py Line 1433 in bcbfbdd if the input is a torch tensor on cuda device, this computation will be using the gpu. |
Beta Was this translation helpful? Give feedback.
-
you can also use |
Beta Was this translation helpful? Give feedback.
-
Thanks @wyli and @Nic-Ma I will try this today. Vikash |
Beta Was this translation helpful? Give feedback.
-
Hi @wyli and @Nic-Ma, I tried |
Beta Was this translation helpful? Give feedback.
-
That's great! for MONAI/monai/transforms/spatial/array.py Line 945 in c3db337 (I'm converting this to a discussion as it's not about the original topic now.) |
Beta Was this translation helpful? Give feedback.
-
Thanks @wyli |
Beta Was this translation helpful? Give feedback.
That's great! for
rotate_range
translate_range
inRandAffine
, they are random factors relative to the image center. the goal of this transform is mainly to combine different spatial transforms and only do the resampling once. if you are only interested in rotation, there's aRandRotate
MONAI/monai/transforms/spatial/array.py
Line 945 in c3db337
(I'm converting this to a discussion as it's not about the original topic now.)