Dov
Dov

Reputation: 326

Render segmentation, stored in a NumPy array, with VTK

I have a segmentation, in a 3D numpy.ndarray, which I would like to render into VTK. [See here 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) Save the NumPy array to a Nifiti file with nib. Nifti1Image (2) Load the Nifiti file into vtk with (vtkNIFTIImageReader()) (3) Render the surface with vtkDiscreteMarchingCubes()

My question: How can I convert this 3D NumPy array directly into VTK without the intermediate file.

Upvotes: 3

Views: 1178

Answers (1)

Related Questions