# TotalSegmentator setup

**URL:** <https://discourse.slicer.org/t/totalsegmentator-setup/26683>\
**Category:** Support\
**Tags:** segmentation\
**Created:** [December 11, 2022, 1:53pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683 "2022-12-11T13:53:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chuns\_SS](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chuns_ss/32/10007_2.png) [@Chuns\_SS](https://discourse.slicer.org/u/Chuns_SS)\
**Post date:** [December 11, 2022, 1:53pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/1 "2022-12-11T13:53:32Z")

</div>

I keep getting errors trying to run totalsegmenter. I suspect it has to do with pyTorch not being installed properly on my system. Linux Ubuntu 22.04. To install pyTorch seems a bit tricky and most sites recommend using anaconda. Any advice? error message included:  
Traceback (most recent call last):  
File “/home/samuel/Slicer-5.2.1-linux-amd64/bin/Python/slicer/util.py”, line 2961, in tryWithErrorDisplay  
yield  
File “/home/samuel/Slicer-5.2.1-linux-amd64/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 248, in onApplyButton  
self.logic.setupPythonRequirements()  
File “/home/samuel/Slicer-5.2.1-linux-amd64/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 531, in setupPythonRequirements  
slicer.util.pip\_install(totalSegmentatorPackage + " --no-deps" + (" --upgrade" if upgrade else “”))  
File “/home/samuel/Slicer-5.2.1-linux-amd64/bin/Python/slicer/util.py”, line 3571, in pip\_install  
\_executePythonModule(‘pip’, args)  
File “/home/samuel/Slicer-5.2.1-linux-amd64/bin/Python/slicer/util.py”, line 3533, in \_executePythonModule  
logProcessOutput(proc)  
File “/home/samuel/Slicer-5.2.1-linux-amd64/bin/Python/slicer/util.py”, line 3502, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[’/home/samuel/Slicer-5.2.1-linux-amd64/bin/…/bin/PythonSlicer’, ‘-m’, ‘pip’, ‘install’, ‘git+https://github.com/wasserth/TotalSegmentator.git’, ‘–no-deps’]’ returned non-zero exit status 1.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [December 11, 2022, 2:31pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/2 "2022-12-11T14:31:44Z")

</div>

There is a new 3D Slicer extension available for installing and running TotalSegmentator within 3D Slicer.  
Highly recommended.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/c/ac1a2858154e1aee0d1d7b11a34e1a7c309f3259.png)

Sources on GitHub: [GitHub - lassoan/SlicerTotalSegmentator: Fully automatic total body segmentation in 3D Slicer using "TotalSegmentator" AI model](https://github.com/lassoan/SlicerTotalSegmentator)

You will also need to install PyTorch by using the PyTorch extension:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/e/ce52cf236f8bbc41891c1ea4ee6dd22ed57bbbd2.png)

---

<div class="post-metadata">

**Author:** ![Chuns\_SS](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chuns_ss/32/10007_2.png) [@Chuns\_SS](https://discourse.slicer.org/u/Chuns_SS)\
**Post date:** [December 14, 2022, 1:41am UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/3 "2022-12-14T01:41:40Z")

</div>

Thank-you, I installed newer version and also GIT which I overlooked previously. Now running fine. Is there a version for the Mac OS platform?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [December 14, 2022, 2:50am UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/4 "2022-12-14T02:50:44Z")

</div>

Yes, the TotalSegmentator extenstion works on a mac (tested on an M2 mac book air) but the GPU version is not available and I didn’t see an option to run the high-res version (but the faster low-res version did work).

---

<div class="post-metadata">

**Author:** ![Chuns\_SS](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chuns_ss/32/10007_2.png) [@Chuns\_SS](https://discourse.slicer.org/u/Chuns_SS)\
**Post date:** [December 14, 2022, 5:11am UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/5 "2022-12-14T05:11:33Z")

</div>

Thanks I updated my mac version and was able to load the extension but as you said I couldn’t get the hi res version to compile.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2022, 6:46am UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/6 "2022-12-14T06:46:59Z")

</div>

The full-resolution model works fine on CPU (at least on Windows). Tested on two computers. Even completes successfully on an 8th-generation Intel i5 with 8GB RAM (it takes 30-40 minutes, which is long, but still much shorter than doing the segmentation manually).

What error did you get on macOS when you attempted to segment with “fast” mode disabled?

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [December 14, 2022, 12:44pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/7 "2022-12-14T12:44:24Z")

</div>

I does not see the totalsegmentation plug-in in the list when I open the extension manager.I am working with3D slicer 5-1-0-2022-11-12

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [December 14, 2022, 1:15pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/8 "2022-12-14T13:15:09Z")

</div>

Please update Slicer to the recent stable version 5.2.1.

You should find the extension here after installation:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/0/205568a7e0271a56a26ef049267b99890843f33d.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2022, 1:18pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/9 "2022-12-14T13:18:07Z")

</div>

> [@philippepellerin](#):
>
> I does not see the totalsegmentation plug-in in the list when I open the extension manager.I am working with3D slicer 5-1-0-2022-11-12

This is a new extension. It is not available in older Slicer Preview Releases.

I would recommend to use the latest Slicer Stable Release (currently Slicer-5.2.1), as it allows you to easily update the extensions as we make improvements/fixes.

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [December 14, 2022, 2:36pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/10 "2022-12-14T14:36:21Z")

</div>

Thank you so much, I missed the latest release! I will do that.  
Very best regards

Pr Philippe Pellerin.  
Former coordinator of the French National Reference Center for rare craniofacial malformations.  
Departement of Plastic Surgery.  
Lille University Hospital.  
France

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [December 14, 2022, 4:50pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/11 "2022-12-14T16:50:12Z")

</div>

I have downloaded Slicer 5-3 and the total segmentation extension, tried it at once: great result, I can’t believe how you did that but this is for me as a miracle!  
Bravo and thanks again for the incredible tool that you provided.  
Happy X’mas

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [December 14, 2022, 8:09pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/12 "2022-12-14T20:09:32Z")

</div>

Thanks for the kind words. TotalSegmentator is indeed amazing, and it is still in early stage. It is expected to become much better - more accurate and more comprehensive. Credits go to DKFZ for releasing this AI segmentation tool (including training method and data sets) for public use without restrictions (see [GitHub - wasserth/TotalSegmentator: Tool for robust segmentation of 104 important anatomical structures in CT images](https://github.com/wasserth/TotalSegmentator) for details).

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [January 18, 2023, 2:51pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/13 "2023-01-18T14:51:47Z")

</div>

Dear Andras, I am trying to work with Bale’s team to implement face segmentation in Totalsegmentator. I am asked to send the CT data as Nifti files, I am OK with this, but they ask as well a Nifti or NRRD for the segmentation. I can’t find a way to export the segmentation this way. Is it one that I could use?  
Thanks for your time and help.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [January 18, 2023, 3:15pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/14 "2023-01-18T15:15:09Z")

</div>

> [@philippepellerin](#):
>
> way to export the segmentation?

This is quite hidden: You can find it in “Segmentations”

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fc122f9647f131b11e34bd63fa20df7b2dbe39eb.png)

---

<div class="post-metadata">

**Author:** ![philippepellerin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/philippepellerin/32/16062_2.png) [@philippepellerin](https://discourse.slicer.org/u/philippepellerin)\
**Post date:** [January 18, 2023, 3:52pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/15 "2023-01-18T15:52:56Z")

</div>

Super, thank you, in the meantime, Jakob has been happy with the .nrrb file in the saved bundle. But this way, I could select what he is specifically interested in.  
Thanks a lot for your fast answer.  
All the best.

---

<div class="post-metadata">

**Author:** ![linda\_varghese](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/linda_varghese/32/66243_2.png) [@linda\_varghese](https://discourse.slicer.org/u/linda_varghese)\
**Post date:** [June 4, 2023, 5:39pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/16 "2023-06-04T17:39:29Z")

</div>

Hi, I am trying to run TotalSegmentor,but its showing error.pyTorch has already been installed on my system Windows 64 bit.  
Traceback (most recent call last):  
File “C:\Users\lvarghese\AppData\Local\NA-MIC\Slicer 5.2.2\bin\Python\slicer\util.py”, line 2967, in tryWithErrorDisplay  
yield  
File “C:/Users/lvarghese/AppData/Local/NA-MIC/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 264, in onApplyButton  
self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),  
File “C:/Users/lvarghese/AppData/Local/NA-MIC/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 799, in process  
self.logProcessOutput(proc)  
File “C:/Users/lvarghese/AppData/Local/NA-MIC/Slicer 5.2.2/NA-MIC/Extensions-31382/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py”, line 692, in logProcessOutput  
raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)  
subprocess.CalledProcessError: Command ‘[‘C:/Users/lvarghese/AppData/Local/NA-MIC/Slicer 5.2.2/bin/…/bin\PythonSlicer.EXE’, ‘C:\Users\lvarghese\AppData\Local\NA-MIC\Slicer 5.2.2\lib\Python\Scripts\TotalSegmentator’, ‘-i’, ‘C:/Users/lvarghese/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-06-04\_19+38+07.977/total-segmentator-input.nii’, ‘-o’, ‘C:/Users/lvarghese/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_2023-06-04\_19+38+07.977/segmentation’, ‘–ml’, ‘–task’, ‘total’, ‘–fast’]’ returned non-zero exit status 120.

I am not that good with coding,can someone help me where I am doing wrong,is there anyother extensions for support I have to install?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 4, 2023, 7:29pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/17 "2023-06-04T19:29:59Z")

</div>

Please go to Pytorch Utils module and copy here the displayed version of Pytorch and cuda.

---

<div class="post-metadata">

**Author:** ![linda\_varghese](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/linda_varghese/32/66243_2.png) [@linda\_varghese](https://discourse.slicer.org/u/linda_varghese)\
**Post date:** [June 4, 2023, 8:21pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/18 "2023-06-04T20:21:13Z")

</div>

I had installed the latest version.

 ![Screenshot (5)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/c/fce4cd5ea1d52e0a64385a4334af5bbcd1ff48ca.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 4, 2023, 8:26pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/19 "2023-06-04T20:26:31Z")

</div>

Please go to Pytorch Utils module and check what are the Pytorch and cuda versions displayed there.

---

<div class="post-metadata">

**Author:** ![linda\_varghese](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/linda_varghese/32/66243_2.png) [@linda\_varghese](https://discourse.slicer.org/u/linda_varghese)\
**Post date:** [June 4, 2023, 8:29pm UTC](https://discourse.slicer.org/t/totalsegmentator-setup/26683/20 "2023-06-04T20:29:59Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/1/e1a0f25439b18d11eef8d32019484e1971cf0e0b.png)  
This is what it showing

[Next page](https://discourse.slicer.org/t/totalsegmentator-setup/26683.md?page=2)
