Repository navigation
|
Is your feature request related to a problem? Please describe. Describe alternatives you've considered Additional context |
Replies: 8 comments 1 reply
|
Hi @ericspod @AndreasHeumann , Do you have any idea about this question? Thanks in advance. |
|
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. |
|
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. |
|
you can also use |
|
Hi @wyli and @Nic-Ma, I tried |
|
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.) |
That's great! for
rotate_rangetranslate_rangeinRandAffine, 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 aRandRotateMONAI/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.)