Closed jamesobutler closed 5 years ago
Thank you for reporting the issue. Is this bug in the currently posted nightly build?
Yes. Slicer nightly was download from slicer.org today as indicated by
C:\Program Files\Slicer 4.11.0-2019-05-13
in the errors above.
It looks like Python3 may not be as forgiving with joining paths on windows with a mix of '\' and '/' slashes. I believe the issue is here on these lines: https://github.com/SimpleITK/SlicerSimpleFilters/blob/12efaabb0151c270e61bc7a3b3d08ad4c8db8095/SimpleFilters/SimpleFilters.py#L35-L36
and like would only present itself on windows. I would think changing:
ICON_DIR = os.path.dirname(os.path.realpath(__file__)) + '/Resources/Icons/'
to
ICON_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'Resources', 'Icons')
JSON_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'Resources, 'json')
Are you able to give that change a try?
Changing
https://github.com/SimpleITK/SlicerSimpleFilters/blob/12efaabb0151c270e61bc7a3b3d08ad4c8db8095/SimpleFilters/SimpleFilters.py#L105
to use open()
fixes the initial error.
The second error is something related to these type of calls where "default" is now undefined in python3. Changing the joining of paths doesn't solve this issue. https://github.com/SimpleITK/SlicerSimpleFilters/blob/12efaabb0151c270e61bc7a3b3d08ad4c8db8095/SimpleFilters/SimpleFilters.py#L962-L963
nice job tracking done the file error!
Closed by #19.
There are some compatibilities issues that were found by a user using the recent Slicer nightly which uses Python3.
https://discourse.slicer.org/t/simple-filters-module-do-not-have-any-filters-in-latest-nightly-version/6787
On loading module
Upon selecting one of the filters after changing
file()
usage toopen()
, there were more errors:More issues might be present, but these were the first I have noticed.