-
for conversion of nifti to vtk stl, see
nifti2stl.py
below -
for conversion from stl to nifgi, see
stl2nifti.py
below
wget https://discourse.itk.org/uploads/default/original/1X/ced4efe8c1eb78342afe474f53ad4409ad5dfc0c.obj
mv ced4efe8c1eb78342afe474f53ad4409ad5dfc0c.obj bunny.obj
wget https://upload.wikimedia.org/wikipedia/commons/4/43/Stanford_Bunny.stl
docker build -t stl2nifti .
docker run -it -u $(id -u):$(id -g) -v $PWD:$PWD -w $PWD stl2nifti bash
python stl2nifti.py bunny.obj bunny.nii.gz
python stl2nifti.py Stanford_Bunny.stl Stanford_Bunny.nii.gz
https://discourse.itk.org/t/trianglemeshtobinaryimagefilter-in-python/1604/7
https://examples.itk.org/src/core/mesh/converttrianglemeshtobinaryimage/documentation
https://github.com/InsightSoftwareConsortium/ITKIOMeshSTL
https://stackoverflow.com/questions/42281881/get-stl-format-3d-mesh-from-binary-mask-segmentation
https://discourse.slicer.org/t/itk-image-to-mesh-to-vtk-polydata/12717
https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#rasterize-a-model-and-save-it-to-a-series-of-image-files
https://github.com/InsightSoftwareConsortium/ITK/issues/2416
https://stackoverflow.com/questions/31430171/convert-stl-into-numpy-array
https://github.com/InsightSoftwareConsortium/ITK/issues/2884
https://stackoverflow.com/questions/65112987/convert-stl-object-to-vtk-geometry-in-python/68584066#68584066
DICOM RT-STRUCT
https://zhangresearch.org/post/parse-dicom-rtstruct-into-binary-masks
https://github.com/qurit/rt-utils
rendering of input
bunny.obj
(right), and outputbunny.nii.gz
(left).