MacOS Python Problem

46%20PM 55%20PM

The nightly version (1.1) 2019-06-14 doesn’t work in Mac.
It can display .vtk files when imported, but Can’t process ANY SPHARM process.
I also tested stable (1.0) version, but same issue.
It’s weird since SlicerSalt seems embed it’s own python.

Any successful test is existing in Mac environment?

Hi @iPsych

Does this also happen with input volumes? i.e. nrrd type data?

Thanks,
Bea

cc. @jcfr

This is related to transition of Slicer to Python3 and should be reproducible in any environment.

Could you provide an example dataset along with the steps allowing to reproduce the problem ? Thanks

I thought that it may possible interruption by Anaconda python environments.
I found python3.6m in the package, and it should work properly.
However, the same error happens when
1)run SPHARM-PDM generator
2)Set input and output directory (input directory contains segmented .nii file.)

Tested in both system with and without anaconda environment. Same error happens.

@jcfr
I found the errors.
Please refer the comment of link below.
https://tickets.metabrainz.org/browse/PICARD-1328

In MacOS, to run the python codes, all the strings seem to change to byte as below.

exts = [".gipl", ".gipl.gz", ".mgh", ".mgh,gz", ".nii", ".nii.gz",".nrrd", ".vtk", ".vtp", ".hdr", ".mhd"]

to

exts = [b'.gipl', b'.gipl.gz', b'.mgh', b'.mgh,gz', b'.nii', b'.nii.gz',b'.nrrd', b'.vtk', b'.vtp', b'.hdr', b'.mhd']

and

SPHARMMeshRootname = SPHARMMeshOutputDirectory + "/" + self.inputRootname + "_flip" + flipName[i - 1] + "_pp_surf"

to

SPHARMMeshRootname = SPHARMMeshOutputDirectory + b'/' + self.inputRootname + b'_flip' + flipName[i - 1] + b'_pp_surf'

(and all the lines like above).

I believe there might be a smart way to resolve it.
Currently, it seems the Python part will work in Windows but not in the MacOS.