Reputation: 45
I have this numpy array of slices of segments of the liver CT(ground truths). I want to export them into a viewable format in tools like blender. The slices are white and black, 0-255. Anything other than liver is black, I want the liver to be viewed in 3d.
The slices are in top view. I used this code in kaggle to view them but just in jupyter https://www.kaggle.com/akh64bit/full-preprocessing-tutorial/data. It can be any way to visualize them.
Upvotes: 0
Views: 2202
Reputation: 297
For new folks stumbling upon this question that are looking to convert pixels / voxels to an STL file or files, this Python workflow has worked for me:
skimage.measure
to convert the voxels of interest to a list of faces defined by vertices on the surface of the volume.stl.Mesh
object from the list of faces and vertices (as done in this example) then save the mesh with stl.Mesh.save()
.As a bonus, you can use the Python package for the Open3D library to open & view multiple STL files!
Upvotes: 1
Reputation: 147
You may try transform your arrays to DICOM format as mentioned before in stackoverflow: Create pydicom file from numpy array
Than you can easily visualize DICOM images in various platforms!
Upvotes: 1