Skip to content

Simple python code to transfer segmented nii.gz file to a list of stl files based on the labels

Notifications You must be signed in to change notification settings

DavidTu21/Multilabel_Niftis2Stl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Multilabel Niftis2Stl

Simple python code that transfers a single segmented nii.gz file to a list of stl files based on the labels inside.

Your output segmented nii.gz file from other segmentation algorithms may contain series of identical labels, such as 1,2,4,5. If you would like to view or save them seperately without using expensive software, or you want to integrate this function into your own code, then the code will be helpful. It could transfer this single nii.gz file into series of .stl files using simpleITK and vtk to create the mesh and save these individual files in your folder.

name-of-you-image

This code can be used in many medical imaging situations as a final step of processing output that be read by clients. Labels do not require to be continuous, but need to be numbers (int, float...)

Sample Input file (.Dicom)

Developed using Browsersync

Sample Output .STL Files

T7 T10 L5

Auto smooth

It will also smooth the surface (parameters can be changed) for the outputs

No smooth Smoothed

Usage

cd YOUR_RESULT_FOLDER
python nii_2_mesh_v3.py

Future development

Output the corresponding .json file with all the coordinates for each label and the bounding box may be helpful.

About

Simple python code to transfer segmented nii.gz file to a list of stl files based on the labels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages