Operating system:Linux
Slicer version:4.11.0
Hi 3D Slicer experts and all
I have a BSplin Transform which contains displacement fields. I want to extract its vector components. for this purpose I converted it to a volume node using Transforms module.[ my reference volume is a CT image with image dimensions of 512 *512 *173]. Therefore, the result was a volume node (renamed to Voluememasked) with image dimensions 512 *512 *173.
for extraction I used the following commands in Slicer python interactor :
import scipy.io as sio
nodeName= ‘Volumemasked’
voxelArray = array(nodeName)
Traceback (most recent call last):
File “”, line 1, in
File “/home/aseman/Downloads/Slicer-4.11.0-2020-02-19-linux-amd64/bin/Python/slicer/util.py”, line 935, in array
return arrayFromVolume(node)
File “/home/aseman/Downloads/Slicer-4.11.0-2020-02-19-linux-amd64/bin/Python/slicer/util.py”, line 971, in arrayFromVolume
narray = vtk.util.numpy_support.vtk_to_numpy(vimage.GetPointData().GetScalars()).reshape(nshape)
ValueError: cannot reshape array of size 136052736 into shape (173,512,512)
how can I reshape it? can you help me?
Thanks a lot