Loaded volume from file: /home/redacted/redacted/redacted/redacted/redacted/redacted/redacted/Public_Patient0/img_0.nii.gz. Dimensions: 200x249x292. Number of components: 1. Pixel type: float.
"Volume" Reader has successfully read the file "/home/redacted/redacted/redacted/redacted/redacted/redacted/redacted/Public_Patient0/img_0.nii.gz" "[0.20s]"
By crash do you mean that the application actually crashed, or just the image was not loaded?
pathlib.Path objects are not supported yet in Slicer’s Python API. It would require much more work for Slicer developers to support it than for users to add the str(), so it has not been high on the priority list. I’ve added an issue to keep track of this request:
Would you consider contributing to Slicer by adding pathlib.Path support to the methods that you are using, for example for loadVolume?
The image was just not loaded (ie, the entire program did NOT crash), sorry for not being clear.
I’ve submitted a pull requested with the change to support pathlib.Path (more generally, it will assume the str method of the object will return the path). I’ve done this for both loadNodeFromFile and loadNodesFromFile (loadVolume calls loadNodeFromFile).