fedorov
(Andrey Fedorov)
August 28, 2023, 7:11pm
1
I’ve just had a conversation with Dr. Ron Summers from NCI, who has been trying to use the ImportOsirixROI function from the Sandbox extension . It is failing with the following error:
"[...]/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/Sandbox/lib/Slicer-5.4/qt-scripted-modules/ImportOsirixROI.py", line 284, in importOsirixRoiFileToSegmentation
[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) - inputRoiData = plistlib.readPlist(inputRoi)
[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) - AttributeError: module 'plistlib' has no attribute 'readPlist'
I have never used that extension. Can someone from the Sandbox extension team help here? @lassoan is this something you maintain?
rsummers
(Ron Summers)
August 28, 2023, 7:29pm
2
Just to provide some background, I’m trying to import a flood-filled segmentation from Osirix into Slicer, and then output the segmentation as a NIFTI file.
It appears the readPlist
method was removed from plistlib as mentioned in the Python 3.9 release notes What’s New In Python 3.9 — Python 3.9.17 documentation after having being marked deprecated in Python 3.4. The load
method is the new method plistlib — Generate and parse Apple .plist files — Python 3.9.17 documentation . This should be an easy upgrade to the new API.
Slicer upgraded to Python 3.9 back in January 2022, so it appears this SlicerSandbox code has been broken for well over 1.5 years now.
1 Like
fedorov
(Andrey Fedorov)
September 1, 2023, 5:49pm
4
I submitted the issue so this does not get lost.
opened 05:49PM - 01 Sep 23 UTC
As discussed in https://discourse.slicer.org/t/problems-using-importosirixroi-fr… om-the-sandbox-extension/31406, `ImportOsirixROI` functionality appears to be broken.
```
"[...]/AppData/Local/slicer.org/Slicer 5.4.0/slicer.org/Extensions-31938/Sandbox/lib/Slicer-5.4/qt-scripted-modules/ImportOsirixROI.py", line 284, in importOsirixRoiFileToSegmentation
[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) - inputRoiData = plistlib.readPlist(inputRoi)
[CRITICAL][Stream] 28.08.2023 11:25:17 [] (unknown:0) - AttributeError: module 'plistlib' has no attribute 'readPlist'
```
lassoan
(Andras Lasso)
September 1, 2023, 9:10pm
5
@fedorov thanks for reporting and @jamesobutler thanks for the investigation.
@rsummers It may be a simple fix, but I would like to test it with your data to make sure that I use the new plistlib API correctly. Could you upload some anonymized test segmentation to somewhere and post the link here?
1 Like
I wonder if there is a temporary work around with and older version. I tried couple older version but none works.
mattflick
(Matt Flick)
November 13, 2023, 6:36pm
7
Hi @lassoan , I’ve been attempting to update the script used to import Osirix ROIs to utilize the new plistlib methods (load and loads) in the relevant lines of code. Unfortunately this does not appear to be working when I run the script through the 3D slicer GUI, so I am wondering if you have made any progress on fixing this issue? The updated script I’ve tried is available here, in case it is helpful: GitHub - flickmatt/3D-Slicer
Thank you for your help.
lassoan
(Andras Lasso)
November 13, 2023, 9:32pm
8
Thanks for the update @mattflick . Could you provide an example file that I can test with? (I only seem to have .json files and not binary plist files)