Extract all 2D slices from Binary labelMap

Hi,

I have 3D vtkImageData (binarylabelMap) from which, I want extract all 2D slices. How can I do that

thank’s in advance

Probably the simplest is to get the voxels as numpy array using a=slicer.util.arrayFromVolume(volumeNode). Then you can extract a slice using numpy array indexing, for example the 6th slice is a[:,:,5].

1 Like

Thank you very much Mr for reply