Error when running TotalSegmentator: "Failed to obtain launcher executable name"

Dear experts,

I tried to use TotalSegmentator extionsion, but it showed the error. Thank you in advance for suggestions.

Failed to compute results.

Command ‘[‘C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\アイソトープ部\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 1.

Traceback (most recent call last):
File “C:\Users\アイソトープ部\AppData\Local\slicer.org\Slicer 5.6.2\bin\Python\slicer\util.py”, line 3255, in tryWithErrorDisplay
yield
File “C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 298, in onApplyButton
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
File “C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 961, in process
self.processVolume(inputFile, inputVolume,
File “C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 1035, in processVolume
self.logProcessOutput(proc)
File “C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 807, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[‘C:/Users/アイソトープ部/AppData/Local/slicer.org/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\アイソトープ部\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 1.

The box of the left hand side show this error:

Processing started

Writing input file to C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/total-segmentator-input.nii

Creating segmentations with TotalSegmentator AI…

Total Segmentator arguments: [‘-i’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/アイソトープ部/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-11_11+11+08.463/segmentation’, ‘–ml’, ‘–task’, ‘total’]

error: Failed to obtain launcher executable name !

Please try to install Slicer in a directory that does not have special characters in its name.

Thank you for your suggestion. It is an office computer in Japan. I will find another folder and let you know the result.

This is another error of another PC.

Failed to compute results.

Command ‘[‘C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 120.

Traceback (most recent call last):
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\bin\Python\slicer\util.py”, line 3255, in tryWithErrorDisplay
yield
File “C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 298, in onApplyButton
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
File “C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 961, in process
self.processVolume(inputFile, inputVolume,
File “C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 1035, in processVolume
self.logProcessOutput(proc)
File “C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 807, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[‘C:/Users/khajt/AppData/Local/slicer.org/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 120.

Processing started
Writing input file to C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/khajt/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-12_11+12+07.371/segmentation’, ‘–ml’, ‘–task’, ‘total’]
Traceback (most recent call last):
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe_main
.py", line 7, in
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\bin\TotalSegmentator.py”, line 127, in main
totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\python_api.py”, line 293, in totalsegmentator
seg_img, ct_img = nnUNet_predict_image(input, output, task_id, model=model, folds=folds,
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 375, in nnUNet_predict_image
nnUNetv2_predict(tmp_dir, tmp_dir, tid, model, folds, trainer, tta,
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 178, in nnUNetv2_predict
predict_from_raw_data(dir_in,
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py”, line 347, in predict_from_raw_data
[i.get() for i in r]
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\pool.py”, line 736, in exit
self.terminate()
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\pool.py”, line 654, in terminate
self._terminate()
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\util.py”, line 224, in call
res = self._callback(*self._args, **self._kwargs)
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\pool.py”, line 713, in _terminate_pool
p.terminate()
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\process.py”, line 133, in terminate
self._popen.terminate()
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\multiprocessing\popen_spawn_win32.py”, line 123, in terminate
_winapi.TerminateProcess(int(self._handle), TERMINATE)
PermissionError: [WinError 5] Access is denied
Exception in thread Thread-20:
Traceback (most recent call last):
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\threading.py”, line 973, in _bootstrap_inner
self.run()
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\threading.py”, line 910, in run
self._target(*self._args, **self._kwargs)
File “C:\Users\khajt\AppData\Local\slicer.org\Slicer 5.6.2\lib\Python\Lib\site-packages\batchgenerators\dataloading\multi_threaded_augmenter.py”, line 92, in results_loop
raise RuntimeError(“One or more background workers are no longer alive. Exiting. Please check the print”
RuntimeError: One or more background workers are no longer alive. Exiting. Please check the print statements above for the actual error message
Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x0000018BCF7F5100>
AttributeError: ‘DummyFile’ object has no attribute ‘flush’

If you use this tool please cite: https://pubs.rsna.org/doi/10.1148/ryai.230024

No GPU detected. Running on CPU. This can be very slow. The ‘–fast’ or the --roi_subset option can help to reduce runtime.
Resampling…
Resampled in 5.04s
Predicting part 1 of 5 …
Predicting part 2 of 5 …
Predicting part 3 of 5 …
Predicting part 4 of 5 …
Predicting part 5 of 5 …

I’ve never seen that it’s weird. Here is a list of thing that might help :

  1. Check that totalSegmentator run on fast mode on the sample data provided by slicer (click the “fast” checkbox to enable this mode)
  2. Check that you have enough free space on your computer (If your disk is almost full it can cause issues, if you have 10Go of free space it’s good)
  3. Since it’s a permissionerror maybe try to run slicer as Administrator to see if it solves the issue

I notice that when I use CT images of Abdomen, it can run without any error. However, it had an error when I use CT inages of Chest + whole abdomen. The error showed following:

Failed to compute results.

Command ‘[‘F:/Slicer/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘F:\Slicer\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 120
Traceback (most recent call last):
File “F:\Slicer\Slicer 5.6.2\bin\Python\slicer\util.py”, line 3255, in tryWithErrorDisplay
yield
File “F:/Slicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 298, in onApplyButton
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
File “F:/Slicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 961, in process
self.processVolume(inputFile, inputVolume,
File “F:/Slicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 1035, in processVolume
self.logProcessOutput(proc)
File “F:/Slicer/Slicer 5.6.2/slicer.org/Extensions-32448/TotalSegmentator/lib/Slicer-5.6/qt-scripted-modules/TotalSegmentator.py”, line 807, in logProcessOutput
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command ‘[‘F:/Slicer/Slicer 5.6.2/bin/…/bin\PythonSlicer.EXE’, ‘F:\Slicer\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe’, ‘-i’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/segmentation’, ‘–ml’, ‘–task’, ‘total’]’ returned non-zero exit status 120.

Processing started
Writing input file to C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/total-segmentator-input.nii
Creating segmentations with TotalSegmentator AI…
Total Segmentator arguments: [‘-i’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/matsubaralab/AppData/Local/Temp/Slicer/__SlicerTemp__2024-06-15_14+28+53.265/segmentation’, ‘–ml’, ‘–task’, ‘total’]
Traceback (most recent call last):
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "F:\Slicer\Slicer 5.6.2\lib\Python\Scripts\TotalSegmentator.exe_main
.py", line 7, in
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\bin\TotalSegmentator.py”, line 127, in main
totalsegmentator(args.input, args.output, args.ml, args.nr_thr_resamp, args.nr_thr_saving,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\python_api.py”, line 293, in totalsegmentator
seg_img, ct_img = nnUNet_predict_image(input, output, task_id, model=model, folds=folds,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 375, in nnUNet_predict_image
nnUNetv2_predict(tmp_dir, tmp_dir, tid, model, folds, trainer, tta,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\totalsegmentator\nnunet.py”, line 178, in nnUNetv2_predict
predict_from_raw_data(dir_in,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\nnunetv2\inference\predict_from_raw_data.py”, line 333, in predict_from_raw_data
np.save(ofile + ‘.npy’, prediction)
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\numpy\lib\npyio.py”, line 546, in save
format.write_array(fid, arr, allow_pickle=allow_pickle,
File “F:\Slicer\Slicer 5.6.2\lib\Python\Lib\site-packages\numpy\lib\format.py”, line 730, in write_array
array.tofile(fp)
OSError: 1363934700 requested and 0 written
Exception ignored in: <totalsegmentator.libs.DummyFile object at 0x00000207772AB970>
AttributeError: ‘DummyFile’ object has no attribute ‘flush’

If you use this tool please cite: https://pubs.rsna.org/doi/10.1148/ryai.230024

No GPU detected. Running on CPU. This can be very slow. The ‘–fast’ or the --roi_subset option can help to reduce runtime.
Resampling…
Resampled in 14.75s
Predicting part 1 of 5 …

Could you suggest for this issue.

If TotalSegmentator works for smaller volumes but not for larger ones then most likely it means that it runs out of memory. You can fix it by cropping and/or resampling the input image using Crop Volume module or upgrade your computer with more memory.