The following code reproducibly crashes Slicer:
import numpy as np crashVolNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLScalarVolumeNode','crashVol') crashVolNode.CreateDefaultDisplayNodes() slicer.util.updateVolumeFromArray(crashVolNode,np.array(np.ones((100,100,100)),dtype=np.int64)) slicer.util.setSliceViewerLayers(background=crashVolNode)
There is no crash if the dtype is np.int32. The crash does not occur until the image is viewed in the slice viewers. As long as it is not viewed, the Volumes module reports everything correctly about it. The Scalar Type is listed as long long
I don’t actually need 64bit images, so casting down is just fine. However, this was difficult to track down as there was no error and nothing in the Slicer log, so I figured I would post this here for general awareness. I was naively using the output of skimage.measure.label to create the image, and the output was 64bit integers, so it crashed Slicer. I assumed at first I was incorrectly creating the volume, but it turns out it was just the data type.