Fully automatic total body segmentation in 3D Slicer using "TotalSegmentator" AI model
Python
283
140 commits
updated Jul 21, 2026
3D Slicer extension for fully automatic whole body CT segmentation using "TotalSegmentator" AI model. Computation time is less than one minute.

If you use the TotalSegmentator nn-Unet function from this software in your research, please cite:
Wasserthal J., Meyer M., , Hanns-Christian Breit H.C., Cyriac J., Shan Y., Segeroth, M.: TotalSegmentator: robust segmentation of 104 anatomical structures in CT images. https://arxiv.org/abs/2208.05868
If you have a powerful GPU is available then a full-quality segmentation can be computed in a few minutes, instead of 40-50 minutes on the CPU. Therefore, it is recommended to set up GPU acceleration as described in this section.
Install latest version of 3D Slicer
Sample Data module and load CTA Abdomen (Panoramix) data setTotalSegmentator moduleInput volume -> Panoramix-croppedSegmentation -> Create new segmentationApply
Failed to compute results ... Command ... 'pip', 'install' ... returned non-zero exit status 1. This may be normal, see what to do in Troubleshooting sectionShow 3D buttonNormal computes full-resolution output; Fast (3mm resolution) and Faster (6mm resolution, only available for a few tasks) trade accuracy for speedFailed to compute results ... Command ... 'pip', 'install' ... returned non-zero exit status 1Explanation: This happens because when the tool has to download and install PyTorch and other required Python packages.
Solution:
Failed to compute results ... Command ... 'PythonSlicer', TotalSegmentator.exe ... returned non-zero exit status 120Explanation: This typically happens when PyTorch is not installed correctly or your computer runs out of memory.
Solution:
RuntimeError: ... DefaultCPUAllocator: not enough memory: you tried to allocate ... bytes. then it means that your computer has not enough memory to process the input image. You can use Crop volume module to crop the your image to the relevant region and/or resample it (with using a scaling factor >1) until the memory usage drops low enough so that your computer can handle it. Alternatively, you can install more physical RAM or configure your operating system to use more virtual memory.Segmentation fails while predicting issue.Problem: Segmentation fails while predicting and the RuntimeError: CUDA out of memory. message is found in the message log (textbox under the Apply button).
Explanation: This means that a CUDA-capable GPU is available, but it is not powerful enough to be used by TotalSegmentator.
Solution: It is recommended to switch to use the CPU by the following steps:
PyTorch Util module, click Uninstall PyTorch. An error may be reported at the end of this step, as some PyTorch files are in use. Click Restart the application button to unload all PyTorch files.PyTorch Util module, select cpu as Computation backend, and click Install PyTorch.If your GPU has more than 7GB memory and you still get this error then the error message might indicate that the PyTorch CUDA version does not match the CUDA version installed on the system. Reinstall PyTorch with the correct CUDA version by following the instructions given below for GPU is not found.
Problem: Segmentation fails while predicting and a message similar to this is found in the message log (textbox under the Apply button): numpy.core._exceptions._ArrayMemoryError: Unable to allocate 6.85 GiB for an array with shape (287, 233, 233, 118) and data type float32
Explanation: This means that your computer has ran out of memory (RAM) while performing the segmentation.
Solution: It is recommended to reduce the image size or increase avaialable memory size by one of the following options:
Crop volume module. Cropping the image to a smaller size will reduce memory need without decreasing the segmentation quality. Setting "Spacing scale" to value larger than 1 (for example 2 or 3) will preserve the extents of the image but small details may be lost (this should not be an issue when the object of interest is a large structure with a smooth surface).Problem: Segmentation fails while predicting and the 'DummyFile' object has no attribute 'flush' message is found in the message log (textbox under the Apply button).
Explanation: This error message can be safely ignored (it is just a small bug in the implementation of the helper class that suppresses nnunet output). If segmentation failed then it is due to another error in the output.
Solution: Look for other messages in the output.
Problem: Your computer has a CUDA-capable GPU but TotalSegmentator reports that GPU is not available.
Explanation: CUDA may not be installed on the system or CUDA version in PyTorch does not match the system CUDA version.
Solution:
PyTorch Util module, click Uninstall PyTorch. An error may be reported at the end of this step, as some PyTorch files are in use. Click Restart the application button to unload all PyTorch files.PyTorch Util module, select the Computation backend that matches the system CUDA version, and click Install PyTorch. The CUDA computational backend name has the format cuNNN, where NNN corresponds to the CUDA major+minor version. For example, CUDA 11.7 backend name is cu117.Problem: There is a big segment called face at the front of the head, which is not an accurate segmentation of the face.
Explanation: This segment is not designed to match the shape of an anatomical feature, but it designates the general area of the face. It can be used to remove features (for example by masking or blurring the image or clipping models) that might otherwise identify the individual subject. Removing these features makes it easier to share 3D data.
Model files are hosted on github.com or Zenodo.org and downloaded automatically when segmenting the first time. Institutional firewall or proxy servers may prevent access or the server may be temporarily overloaded, which may cause an error report similar to requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/6802052/files/Task256_TotalSegmentator_3mm_1139subj.zip?download=1. Potential solutions:
.totalsegmentator folder in the user's profile (for example in c:\Users\(yourusername)\.totalsegmentator\nnunet\results\Dataset291_TotalSegmentator_part1_organs_1559subj)Problem: Your TotalSegmentator config.json file was corrupted or was not created correctly.
Solution: Delete your .totalsegmentator folder in the user's profile (for example in c:\Users\(yourusername)\.totalsegmentator). The folder will be recreated with the correct content.
Contributions to this extensions are welcome. Please send a pull request with any suggested changes. 3D Slicer contribution guidelines apply.
Please post any questions to the Slicer Forum.
Developers of this extension are not associated with the developers of TotalSegmentator, just provide the convenient 3D Slicer based user interface.
Python
97.2%
CMake
2.8%
Fully automatic total body segmentation in 3D Slicer using "TotalSegmentator" AI model
Python
283
140 commits
updated Jul 21, 2026
3D Slicer extension for fully automatic whole body CT segmentation using "TotalSegmentator" AI model. Computation time is less than one minute.

If you use the TotalSegmentator nn-Unet function from this software in your research, please cite:
Wasserthal J., Meyer M., , Hanns-Christian Breit H.C., Cyriac J., Shan Y., Segeroth, M.: TotalSegmentator: robust segmentation of 104 anatomical structures in CT images. https://arxiv.org/abs/2208.05868
If you have a powerful GPU is available then a full-quality segmentation can be computed in a few minutes, instead of 40-50 minutes on the CPU. Therefore, it is recommended to set up GPU acceleration as described in this section.
Install latest version of 3D Slicer
Sample Data module and load CTA Abdomen (Panoramix) data setTotalSegmentator moduleInput volume -> Panoramix-croppedSegmentation -> Create new segmentationApply
Failed to compute results ... Command ... 'pip', 'install' ... returned non-zero exit status 1. This may be normal, see what to do in Troubleshooting sectionShow 3D buttonNormal computes full-resolution output; Fast (3mm resolution) and Faster (6mm resolution, only available for a few tasks) trade accuracy for speedFailed to compute results ... Command ... 'pip', 'install' ... returned non-zero exit status 1Explanation: This happens because when the tool has to download and install PyTorch and other required Python packages.
Solution:
Failed to compute results ... Command ... 'PythonSlicer', TotalSegmentator.exe ... returned non-zero exit status 120Explanation: This typically happens when PyTorch is not installed correctly or your computer runs out of memory.
Solution:
RuntimeError: ... DefaultCPUAllocator: not enough memory: you tried to allocate ... bytes. then it means that your computer has not enough memory to process the input image. You can use Crop volume module to crop the your image to the relevant region and/or resample it (with using a scaling factor >1) until the memory usage drops low enough so that your computer can handle it. Alternatively, you can install more physical RAM or configure your operating system to use more virtual memory.Segmentation fails while predicting issue.Problem: Segmentation fails while predicting and the RuntimeError: CUDA out of memory. message is found in the message log (textbox under the Apply button).
Explanation: This means that a CUDA-capable GPU is available, but it is not powerful enough to be used by TotalSegmentator.
Solution: It is recommended to switch to use the CPU by the following steps:
PyTorch Util module, click Uninstall PyTorch. An error may be reported at the end of this step, as some PyTorch files are in use. Click Restart the application button to unload all PyTorch files.PyTorch Util module, select cpu as Computation backend, and click Install PyTorch.If your GPU has more than 7GB memory and you still get this error then the error message might indicate that the PyTorch CUDA version does not match the CUDA version installed on the system. Reinstall PyTorch with the correct CUDA version by following the instructions given below for GPU is not found.
Problem: Segmentation fails while predicting and a message similar to this is found in the message log (textbox under the Apply button): numpy.core._exceptions._ArrayMemoryError: Unable to allocate 6.85 GiB for an array with shape (287, 233, 233, 118) and data type float32
Explanation: This means that your computer has ran out of memory (RAM) while performing the segmentation.
Solution: It is recommended to reduce the image size or increase avaialable memory size by one of the following options:
Crop volume module. Cropping the image to a smaller size will reduce memory need without decreasing the segmentation quality. Setting "Spacing scale" to value larger than 1 (for example 2 or 3) will preserve the extents of the image but small details may be lost (this should not be an issue when the object of interest is a large structure with a smooth surface).Problem: Segmentation fails while predicting and the 'DummyFile' object has no attribute 'flush' message is found in the message log (textbox under the Apply button).
Explanation: This error message can be safely ignored (it is just a small bug in the implementation of the helper class that suppresses nnunet output). If segmentation failed then it is due to another error in the output.
Solution: Look for other messages in the output.
Problem: Your computer has a CUDA-capable GPU but TotalSegmentator reports that GPU is not available.
Explanation: CUDA may not be installed on the system or CUDA version in PyTorch does not match the system CUDA version.
Solution:
PyTorch Util module, click Uninstall PyTorch. An error may be reported at the end of this step, as some PyTorch files are in use. Click Restart the application button to unload all PyTorch files.PyTorch Util module, select the Computation backend that matches the system CUDA version, and click Install PyTorch. The CUDA computational backend name has the format cuNNN, where NNN corresponds to the CUDA major+minor version. For example, CUDA 11.7 backend name is cu117.Problem: There is a big segment called face at the front of the head, which is not an accurate segmentation of the face.
Explanation: This segment is not designed to match the shape of an anatomical feature, but it designates the general area of the face. It can be used to remove features (for example by masking or blurring the image or clipping models) that might otherwise identify the individual subject. Removing these features makes it easier to share 3D data.
Model files are hosted on github.com or Zenodo.org and downloaded automatically when segmenting the first time. Institutional firewall or proxy servers may prevent access or the server may be temporarily overloaded, which may cause an error report similar to requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://zenodo.org/record/6802052/files/Task256_TotalSegmentator_3mm_1139subj.zip?download=1. Potential solutions:
.totalsegmentator folder in the user's profile (for example in c:\Users\(yourusername)\.totalsegmentator\nnunet\results\Dataset291_TotalSegmentator_part1_organs_1559subj)Problem: Your TotalSegmentator config.json file was corrupted or was not created correctly.
Solution: Delete your .totalsegmentator folder in the user's profile (for example in c:\Users\(yourusername)\.totalsegmentator). The folder will be recreated with the correct content.
Contributions to this extensions are welcome. Please send a pull request with any suggested changes. 3D Slicer contribution guidelines apply.
Please post any questions to the Slicer Forum.
Developers of this extension are not associated with the developers of TotalSegmentator, just provide the convenient 3D Slicer based user interface.
Python
97.2%
CMake
2.8%