Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Filters do not work in all installations #7661

Open
dzenanz opened this issue Mar 25, 2024 · 2 comments
Open

Simple Filters do not work in all installations #7661

dzenanz opened this issue Mar 25, 2024 · 2 comments

Comments

@dzenanz
Copy link
Member

dzenanz commented Mar 25, 2024

Summary

Trying to run any filter from Simple Filters results in an error:

---------------------------
Exception before execution of AbsImageFilter
---------------------------
<class 'RuntimeError'>
---------------------------
OK   
---------------------------

content in the log:

myFilter = AbsImageFilter()
myFilter.SetDebug(False)
myFilter.SetNumberOfThreads(24)
myFilter.SetNumberOfWorkUnits(0)
Error ImageIO factory did not return an ImageIOBase: MRMLIDImageIO

Steps to reproduce

  1. Download MRHead sample data
  2. Switch to Simple Filters module
  3. Click Apply
  4. The above error appears

Environment

  • Error appears for me in Slicer 5.6.1 r32438 / 117ce5f on Windows 11 (23H2 build 22631.3296) fully updated
  • Works as expected in versions 5.2.1 r31317 / 77da381 and 5.7.0-2024-03-06 r32752 / 024b340 on the same Windows machine
  • Works as expected in Slicer 5.6.1 r32438 / 117ce5f on Ubuntu 22.04.4 LTS.
  • Error appears in Slicer 5.6.1 r32438 / 117ce5f on Ubuntu for @andinet.
@lassoan
Copy link
Contributor

lassoan commented Mar 25, 2024

This error is typically due to that you (or any of the extensions you installed) installed SimpleITK from PyPI and that overwrote Slicer's SimpleITK. SimpleITK installed from PyPI does not include the in-memory transfer image IO.

We have been avoiding reinstaing SimpleITK and if there is a package then insists on replacing it (e.g., nnunetv2) then we rewrite package dependencies on-the-fly (see TotalSegmentator Slicer extension).

Would it be sufficient to check the SimpleITK version at startup and display a descriptive error message if it is not correct, to make extension developers aware that they broke some features Slicer?

@dzenanz
Copy link
Member Author

dzenanz commented Mar 25, 2024

check the SimpleITK version ar startup and display a descriptive error message

I think that would be sufficient. The possible culprit (in this instance) is https://github.com/bowang-lab/MedSAMSlicer or https://github.com/bingogome/samm.

lassoan added a commit to lassoan/Slicer that referenced this issue Apr 17, 2024
When extensions pip-install SimpleITK and it replaces SimpleITK that is bundled with Slicer, then MRMLIDImageIO ITK IO plugin is no longer available for passing data between SimpleITK and Slicer. As a result, Simple Filters module and most Slicer modules that use SimpleITK no longer work.

This commit makes image passing between SimpleITK and Slicer more robust: if MRMLIDImageIO is not available then images are written to regular files.

see Slicer#7661
lassoan added a commit that referenced this issue Apr 19, 2024
When extensions pip-install SimpleITK and it replaces SimpleITK that is bundled with Slicer, then MRMLIDImageIO ITK IO plugin is no longer available for passing data between SimpleITK and Slicer. As a result, Simple Filters module and most Slicer modules that use SimpleITK no longer work.

This commit makes image passing between SimpleITK and Slicer more robust: if MRMLIDImageIO is not available then images are written to regular files.

see #7661
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants