I now have some segmentation label files of 3d computed tomography image with extesion of 'nii'. These labels are used to train networks like 3d U-net which takes 3d images as input.
Now I want to use these labels to train another network (meshsegnet) that takes 3d triangle mesh as input therefore I have to convert the ct images as well as the corresponding nii labels mentioned above to .vtk files. The vtk files should be in a format similar to (data and label in one file):
mesh = load(xxx.vtk)
data = mesh._data.Getcell(index)
labels = mesh.getCellArray('Label')
Is there a quick way to do so?