Manuals

5. How to install TotalSegmentator

To install TotalSegmentator you need to first install Python, PyTorch and add python to the PATH. TotalSegmentator works on Ubuntu, macOS, and Windows, and supports both CPU and GPU. Performance on CPU is significantly slower.

5.1

Installing Python

If you already have Python on your device you can skip this step.

How to check if you have Python installed?

  1. Open command prompt.

  2. Type python --version

  3. If it’s installed you will see the installed version. If not, a message like 'python' is not recognized as an internal or external command will be shown.

How to install Python?

  1. Go to Download Python Website.

  2. Find the version between 3.7 and 3.13.

  3. If it’s installed you will see the installed version. If not, a message like 'python' is not recognized as an internal or external command will be shown.

  4. Make sure to select the 'Add python.exe to PATH' checkbox, and ensure that pip will be installed alongside Python (it is included when you choose the 'Install Now' option).

  5. Manual-Image
  6. Install Python.

  7. You can check if installed properly by following the steps above: How to check if you have Python installed?

Python in PATH

Note, that it’s very important to have Python added to the environmental variable PATH. To see if you have it in PATH type ‘python’ in the command prompt. If it’s added you will see it ‘open’ in the command prompt. If not, a message like that will appear ‘python is not recognized as an internal or external variable. See here how to add Python to the PATH.

5.2

Installing PyTorch

If you already have PyTorch on your device you can skip this step.

How to check if you have PyTorch installed?

  1. Open command prompt.

  2. Type python

  3. Type import torch

  4. Type print(torch.__version__)

  5. If it’s installed you will see the installed version. If not, a message like 'ModuleNotFoundError: No module named 'torch' will be shown.

How to install PyTorch?

  1. Go to Download PyTorch Website.

  2. Choose the correct version of PyTorch depending if you want to use the CPU or CUDA (GPU) version.

  3. Copy (CTRL+C) the command specified in Run this Command section e.g pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

  4. Open command prompt and paste the copied command.

  5. Install PyTorch.

  6. You can check if installed properly by following the steps above: How to check if you have PyTorch installed?

5.3

Installing TotalSegmentator

If you already have TotalSegmentator on your device you can skip this step.

How to install TotalSegmentator?

  1. Open command prompt.

  2. Type pip install TotalSegmentator==2.5.0

  3. Install TotalSegmentator.

  4. To check if TotalSegmentator is installed properly type in the command line TotalSegmentator -–version. It should show the installed version.

  5. Restart your computer to make TotalSegmentator available to other apps, like Medicalholodeck.

  6. Go to the settings and allow showing local segmentation models.

  7. Manual-Image
  8. Once everything is installed correctly, the segmentation options in Medicalholodeck will appear without the cloud note, indicating local processing.