lassoan / SlicerTotalSegmentator

Fully automatic total body segmentation in 3D Slicer using "TotalSegmentator" AI model
Apache License 2.0
167 stars 24 forks source link

SimpleITK problem is still present when using lungmask #45

Closed rbumm closed 10 months ago

rbumm commented 10 months ago

in Slicer 5.4.0. and Totalsegmentator 1.5.7

image

lassoan commented 10 months ago

Was it a fresh install and you only installed TotalSegmentator?

rbumm commented 10 months ago

I have lost the overview.

rbumm commented 10 months ago

It is a 5.4.0 install and Lung CT Segmenter and TotalSegmenterextension are included via the modules mechanism. In another install 5.4.0 with Lung CT Segmenter and TotalSegmenter extension, I do not have this error.

lassoan commented 10 months ago

This is the exact reason why we always install TotalSegmentator by git hash and not by branch name.

If you install a Python package from github just by using a branch name (as you do it here) then the package will never be updated, because pip caches each downloaded package, globally on the that computer, forever. Even worse, you have no way of knowing what version you have actually installed (as the URL identifies the package, but that is just the branch name, not a specific version on that branch). The package may declare some version about itself (typically packagename.__version__), but that version is not used by pip install and it is not reliable anyway (the developer may forget to update it).

If you install a package from github, switching to using a specific git hash will ensure that a known, tested version of the package is installed.

Note that if you install from PyPI then using the version number is reliable, as PyPI does not let you modify a package once you uploaded it. However, in github you can modify tags (e.g., the developer may find a bug and decide to move the tag instead of create a new one), so you can only trust the git hash to uniquely identify a version.

rbumm commented 10 months ago

I hate working with hashes but I would be grateful if you could repair the issue. Thank you. Please do not forget the COI form, I want to resubmit the manuscript tomorrow. Best Rudolf

lassoan commented 10 months ago

Sure, I can do it. For this, could you tell which is the correct (working) version of the Lung CT segmenter for the current Slicer-5.4 version? (maybe you can check the __version__ variable of package on the computer where it works)

rbumm commented 10 months ago

I will have to further analyze the problem. The SimpleITK error message was introduced when we tested TotalSegmentator v2. I'll let you know when I find out more details.

lassoan commented 10 months ago

If there were any changes in LungCTAnalyzer for TS v2 then we need to create a 5.4 branch in the SlicerLungCTAnalyzer repository from the version before those changes. We can then update the ExtensionsIndex to use that 5.4 branch for Slicer-5.4.

We probably need to set an older LungSegmenter hash in the 5.4 branch of SlicerLungCTAnalyzer (and set the most recent hash in the main branch).

Specifying branch names for Slicer extensions and hashes for Python packages should resolve all the issues and I can make all these changes. But I would need to know the git hashes of SlicerLungCTAnalyzer and LungSegmenter that still worked compatible with Slicer-5.4 and the 5.4 branch of SlicerTotalSegmentator. Maybe the easiest is if you remember a date when everything still worked in Slicer-5.4 and use the corresponding hashes.

rbumm commented 10 months ago

I deleted the 3D Slicer 5.4.0 folder and installed everything from scratch and from the installation manager. Got an error message when I force installed Totalsegmentator, after restart it worked - Totalsegmentator and lungmask,.