This post has NOT been accepted by the mailing list yet.
This post was updated on .
I use the vtkMRMLLabelMapVolumeNode in my scripted plugin with python.
Can I convert the node in a numpy array?
Edit: I create a selection using this tutorial: youtube slicer selection. It create a volume and I select this volume with the "vtkMRMLScalarVolumeNode" component and in the logic of my plugin I obtain that the volume is a vtkMRMLLabelMapVolumeNode and now if I try to use vtk_to_numpy I have back this error:
File "/Users/marcomameli/Downloads/SlicerExtension/VolumeCalculation/VolumeCalculation/VolumeCalculation.py", line 123, in run
numpy_data_array = numpy_support.vtk_to_numpy(workVolume)
File "/Applications/Slicer.app/Contents/bin/Python/vtk/util/numpy_support.py", line 212, in vtk_to_numpy
typ = vtk_array.GetDataType()
AttributeError: 'vtkCommonCorePython.vtkMRMLLabelMapVolumeNode' object has no attribute 'GetDataType'
Can anyone help me with this problem?