Code for my blog post.
Export the nii.gz segmentation files in Totalsegmentor into 3D models (STL, OBJ, PLY)
- Download the Totalsegmentor CT dataset from here and extract the dataset to your preferred location.
- Open the export_from_Slicer.py script and modify the following variables:
TotalSegmentor_path: The path to the Totalsegmentor datasetexport_path: The path to the export directoryselected_segment: The selected segment to exportexport_type: The type of export {obj, stl, ply}skip_image_id: The list of image ids to skip due to some error files that 3DSlicer can't load
- Open the 3DSlicer and navigate to python console: View > Python console
- Run the script by pressing Ctrl + g (or Cmd + g on macOS) and select the export_from_Slicer.py script
- The 3D models will be saved to the export directory
