I’m trying to load a FreeSurfer model (lh.pial) programmatically through a scripted module but I’m not achieving it.
I’ve tried:
fsImporterLogic = slicer.util.getModuleLogic('FreeSurferImporter')
volumeNode = fsImporterLogic.LoadFreeSurferVolume(file_path)
where file_path is the path to one of the files I want to open, and got the following error:
vtkITKArchetypeImageSeriesReader::ExecuteInformation: Cannot open /Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial. ITK exception info: error in unknown:  Could not create IO object for reading file /Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial
[VTK]   Tried to create one of the following:
[VTK]     BMPImageIO
[VTK]     BioRadImageIO
[VTK]     DCMTKImageIO
[VTK]     GDCMImageIO
[VTK]     GiplImageIO
[VTK]     JPEGImageIO
[VTK]     LSMImageIO
[VTK]     MGHImageIO
[VTK]     MINCImageIO
[VTK]     MRCImageIO
[VTK]     MetaImageIO
[VTK]     NiftiImageIO
[VTK]     NrrdImageIO
[VTK]     PNGImageIO
[VTK]     ScancoImageIO
[VTK]     StimulateImageIO
[VTK]     TIFFImageIO
[VTK]     VTKImageIO
[VTK]     MRMLIDImageIO
[VTK]   You probably failed to set a file suffix, or
[VTK]     set the suffix to an unsupported type.
[VTK] Algorithm vtkITKArchetypeImageSeriesScalarReader (0x7f8fc479ae80) returned failure for request: vtkInformation (0x60001155aa00)
[VTK]   Debug: Off
[VTK]   Modified Time: 5320081
[VTK]   Reference Count: 1
[VTK]   Registered Events: (none)
[VTK]   Request: REQUEST_INFORMATION
[VTK]   ALGORITHM_AFTER_FORWARD: 1
[VTK]   FORWARD_DIRECTION: 0
[VTK] vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Reading of file '/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial' failed: FileFormatError Number of files listed in the node is 0. File reader says it was able to read 0 files. File reader used the archetype file name of '/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial' (first filename: '')
[VTK] vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Reading of file '/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial' failed: FileFormatError Number of files listed in the node is 0. File reader says it was able to read 0 files. File reader used the archetype file name of '/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial' (first filename: '')
[VTK] vtkMRMLVolumeArchetypeStorageNode::ReadDataInternal: Cannot read '/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial' file as a volume of type 'Volume'. Details: FileFormatError.
[VTK] vtkMRMLStorageNode::ReadData: Failed to read node lh (vtkMRMLScalarVolumeNode5) from filename='/Users/justo/Library/CloudStorage/GoogleDrive-justo.montoya@upf.edu/Mi unidad/SLICER/test_raw/fsfolder/surf/lh.pial'
I’ve also tried other options like:
modelNode = slicer.util.loadModel(file_path)
But it’s not working either. How can I open this FreeSurfer model programmatically?
Thanks in advance! 