DICOM RT export plugin error on Mac
Closed this issue · 6 comments
User reported DICOM export error on Mac: https://discourse.slicer.org/t/export-volume-with-burnt-in-segmentation/5216/2
It seems that there is something wrong with DicomRtImportExportPlugin:
[CRITICAL][Stream] 28.12.2018 10:41:13 [] (unknown:0) - Traceback (most recent call last):
[CRITICAL][Stream] 28.12.2018 10:41:13 [] (unknown:0) - File “<string>”, line 1, in <module>
[CRITICAL][Stream] 28.12.2018 10:41:13 [] (unknown:0) - KeyError: ‘DicomRtImportExportPlugin’
It works well on Windows, so it might be some Mac-specific issue.
I renamed the plugin to conform with other plugin names (and to be shorter).
https://github.com/SlicerRt/SlicerRT/blob/master/DicomRtImportExport/DicomRtImportExportPlugin.py#L165
I don't think it's in the scene. Why do you think it looks for the old name?
I'm not sure, but if we rename the plug in then we should rename the plug in class, too, for consistency.
The DICOM export dialog assumes that key in slicer.modules.dicomPlugins
is the plugin class (see here).
Since the plugin sets the class name as exportable.pluginClass = self.__module__
(see here, we would need to set the key value consistently as slicer.modules.dicomPlugins[self.__module__] = DicomRtImportExportPluginClass
(here).
To change the plugin name, the plugin filename and all classes inside must be renamed.
Thanks for the investigation. What would you prefer? Rename the plugin class or undo this change?
I don't have any preference. It is nicer if we follow a common naming convention with the plugins but I'm not sure if it is worth the number of changes that are needed.
I simply reverted that change (decided that it's not worth the time of renaming the classes and files). I did a test run and it worked for me. I hope it resolves this issue for the user as well.