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