lassoan / SlicerTotalSegmentator

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

TotalSegmentator fails to launch on Windows with Slicer 5.4 #48

Closed BishopWolf closed 11 months ago

BishopWolf commented 11 months ago

The script failed to launch the process TotalSegmentator on Windows.

On line 719 of TotalSegmentator.py (branch 5.4) https://github.com/lassoan/SlicerTotalSegmentator/blob/a0f8f686ef70f765243453f20d2511595f11870a/TotalSegmentator/TotalSegmentator.py#L719 totalSegmentatorPath = os.path.join(sysconfig.get_path('scripts'), "TotalSegmentator")

should be:

totalSegmentatorPath = os.path.join(sysconfig.get_path('scripts'), "TotalSegmentator")
if os.name == 'nt':
    totalSegmentatorPath += ".exe"

This change fixes the issue for me

EDIT: I see that the code in latest version handles this issue. But this is not what it is installed by default in Slicer.

lassoan commented 11 months ago

Thanks, fixed in https://github.com/lassoan/SlicerTotalSegmentator/commit/66d377ffd14c8488e37982ca31458dd16d9a30c1