Render segmentation stored in a NumPy array with VTK

I have a segmentation in 3D numpy.ndarray that I would like to display in VTK. [Cm. There's a similar process here: https://pyscience.wordpress.com/2014/11/16/volume-rendering-with-python-and-vtk/ by @ somada141]

My current (ad-hoc) solution includes: (1) Store the NumPy array in a Nifiti file using nib. Nifti1Image (2) Load the Nifiti file into vtk with (vtkNIFTIImageReader ()) (3) Display surface with vtkDiscreteMarchingCubes ()

My question is how to convert this 3D NumPy array directly to VTK without an intermediate file.

+3


source to share


1 answer


+4


source







All Articles