Can I display a binary numpy array on Slicer as a segmentation volume?

I have a numpy array with dimensions 512 * 512 * 64 * 5. This represents 5 3D arrays, and the arrays have only 1 or 0 values representing voxels in a segmentation volume. Is there anyway I can display this saved .npy file to see the 3D segmentations in Slicer? Is there a way for me todo this without slicer?

Apologies if this is a simple and has been asked elsewhere but im relatively new to slicer and from what I can see people have asked questions todo the opposite (convert segmentation to npy and not the other way around)

The question I have is the opposite to the question in : Segment / BinaryLabelMap to numpy array

I think this user is asking how to get the numpy array from the .seg.nrrd. I want to know how to get a numpy array and convert it to a .sseg.nrrd format that slicer can work with

The simplest is probably to create a labelmap volume node, set its voxels from a numpy array using slicer.util.updateVolumeFromArray, and convert into a segmentation node using ImportLabelmapToSegmentationNode.

1 Like