Skip to main content

TotalSegmentator 2D: A Tool for Rapid Anatomical Structure Analysis

⚡ Latest Updates

  • 2025-08-26: v1.1.0 released → includes models pretrained on the TotalSegmentator v2.0.1
  • 2025-07-31: v1.0.0 released → includes [MIUA2025a] TS2D models pretrained on the TotalSegmentator v1.0 dataset
  • ✅ Added TSXR models: X-Ray segmentation models, see [MIUA2025b]
  • 🚧 Coming soon: TSXR documentation & how-tos

What is TS2D?

TotalSegmentator 2D (TS2D) is a fast and lightweight tool for anatomical structure segmentation and analysis.
It adapts TotalSegmentator (3D) by projecting CT scans into 2D views, enabling:

  • ⚡ Rapid inference (results in less than a second, compared to several minutes for 3D methods)
  • 💻 Low GPU/CPU requirements
  • 🧠 Accurate segmentation of 117 anatomical structures (see ts2d-v2 models)
  • 🩻 Segmentation of native 2D X-ray scans (see the tsxr models)

Use cases include:

  • Anatomical structure segmentation and analysis in CT images.
  • Body-region segmentation and detection in CT scans.
  • X-ray image segmentation
Overview of our method.

Figure 1: Standard CT workflow. Volumetric scans and ground-truth labels are projected onto the coronal plane to train five specialized 2D U-Net models. These models enable fast and efficient inference of 2D anatomical labels for any projected CT scan.

How It Works

TS2D uses coronal projection images generated through maximum and average intensity projection for the segmentation of anatomical structures. The two-channel input is processed by a 2D U-Net, implemented using our adapted nnU-Net framework to support multi-label output and thus correctly handle overlapping structures (see Figure 1). Pretrained models for both version 1 and version 2 of TotalSegmentator are available. Version 2 supports segmentation of 117 anatomical labels. The segmentation task was distributed across five specialized models, each focused on a distinct group of anatomical structures (see Figure 2).

Example segmentation results.

Figure 2: Segmentation results for the five anatomical group models used with the default TS2D configuration (ts2d-v2-ep4000b2), along with the combined output (Patient s0616).

TS2D was evaluated using projected ground-truth labels and its performance was compared to the original TotalSegmentator tool (TS3D), with both methods' inference results projected to 2D for consistency. A comprehensive comparison can be found in our publication [MIUA2025a].

Method Overall Bone Structures Soft-Tissue Structures Inference Time (Nvidia RTX 4090)
TS2D (Ours) 0.86 0.90 0.81 0.5-0.9 secs
TS3D 0.97 0.97 0.97 43–146 secs

Note: The table shows results for the TotalSegmentator v1 dataset to ensure comparability with the original TS3D publication.

Usage

Setup

TS2D has been tested with Python 3.12 and Pytorch 2.7.1 (CUDA 11.8) on a Windows 11 system and on Ubuntu (tested with CPU only).

👉 Install PyTorch before installing TS2D (see PyTorch setup).

Then install TS2D via:

  • from PyPI: pip install ts2d
  • from a local clone: pip install .
  • from GitHub: pip install git+https://github.com/risc-mi/totalsegmentator2D.git.

Get Started

You can run TS2D using the Command line interface (CLI):

ts2d -i <input_image> -o <output_directory>

or alternatively, you can use the API to run TS2D in your Python scripts:

from ts2d import TS2D
with TS2D() as model:
    result = model.predict('<input_image>')
    result.save(dest='<output_directory>')

For CT scans, TS2D will project the input 3D image, run the segmentation models and save a multilabel segmentation file to the output directory. The segmentation labels can be parsed from the metadata, to view the segmentation use e.g. 3D Slicer to view the results. For more information, refer to the CLI help or the API documentation.

For X-ray images, no projection is required and everything is just the same. Simply specify the correct model key tsxr either through CLI or the API interface.

Default Models

By default, TS2D uses the model key ts2d-v2, which refers to models trained on the TotalSegmentator v2.0.1 dataset.

  • ts2d-v2 → pretrained on v2.0.1 dataset (117 labels)
  • ts2d-v1 → pretrained on v1.0 dataset (104 labels)
  • tsxr-v2 → pretrained on synthetic projections of v2.0.1 dataset (117 labels)

➡️ See Available Models for a full list and instructions on selecting specific sub-models.

Performance Evaluation

The images below illustrate segmentation results for bone tissue (left) and soft tissue (right) using the ts2d-v2 models. Dice Similarity Coefficients (DSC) are reported for all 117 anatomical structures, sorted from highest to lowest median DSC. TS2D is recommended for bone tissue and most soft tissue structures; however, caution is advised for smaller soft tissue structures with lower DSC values.

DSC Bones DSC Soft Tissue

Publications

Our following publications are related to the development and application of TS2D:

  • Original publication introducing TS2D:

    • [MIUA2025a] TotalSegmentator 2D: A Tool for Rapid Anatomical Structure Analysis
      Presented at Medical Image Understanding and Analysis (MIUA) Conference 2025
      Full Reference: Sabrowsky-Hirsch, B., Alshenoudy, A., Thumfart, S., Giretzlehner, M. (2025). TotalSegmentator 2D (TS2D): A Tool for Rapid Anatomical Structure Analysis. Medical Image Understanding and Analysis 2025 (MIUA 2025). Springer Nature.
  • TS2D extended to the segmentation of X-Ray images:

    • [MIUA2025b] Leveraging Synthetic Data for Whole-Body Segmentation in X-ray Images
      Presented at Medical Image Understanding and Analysis (MIUA) Conference 2025
      Full Reference: Alshenoudy, A., Sabrowsky-Hirsch, B., Thumfart, S., Giretzlehner, M. (2025). Leveraging Synthetic Data for Whole-Body Segmentation in X-Ray Images. Medical Image Understanding and Analysis 2025.
  • Our earlier work on body-region segmentation for an industrial usecase:

    • [AIROV2025] Efficient Automatic Detection of Scanned Body Regions in CT Scans
      Presented at Austrian Symposium on AI, Robotics, and Vision (AIRoV) Conference 2025
      Full Reference: Sabrowsky-Hirsch, Bertram, et al. “Efficient Automatic Detection of Scanned Body Regions in CT Scans.” In Proceedings of the Joint Austrian Computer Vision and Robotics Workshop 2025. Verlag der TU Graz (2025).

References

TotalSegmentator 2D builds upon two key works in the field of medical image segmentation:

Contact

If you have any inquiries, please open a GitHub issue.

GitHub · PyPI · Zenodo · RISC Software GmbH

Acknowledgements

This project is financed by research subsidies granted by the government of Upper Austria. RISC Software GmbH is Member of UAR (Upper Austrian Research) Innovation Network.

Versions

  • v1.0.0: first release of TS2D including the [MIUA2025a] models.
  • v1.1.0: added models trained on the TotalSegmentator v2 dataset
  • v1.2.0 added TSXR models trained on DiffDRR reconstructions of the TotalSegmentator v2 dataset

Metadata

Release files for ts2d 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ts2d 1.2.0
File Size Uploaded Provenance Actions
ts2d-1.2.0.tar.gz 55.7 kB Without provenance Details for ts2d-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ts2d 1.2.0
File Interpreter ABI Platform Actions
ts2d-1.2.0-py3-none-any.whl Python 3 none any Details for ts2d-1.2.0-py3-none-any.whl

Total release size: 113.8 kB

Release files / ts2d-1.2.0.tar.gz

Download URL ts2d-1.2.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
334b05fc2c93f8fedd6a8e9d3bc38bfc7a12b0ccd39ffc7e163fed5a01ed4ff6
BLAKE2b-256 checksum
How to use checksums
23c56911f5e2c1284dc5ac061e2fee2b06bdcc76ff6dd10d33f3b2dcba9d122c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release files / ts2d-1.2.0-py3-none-any.whl

Download URL ts2d-1.2.0-py3-none-any.whl
Size 58.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbead005239bdd0843ec84b2ee31a9f04de293fbd57ef9b128f3848bfe568210
BLAKE2b-256 checksum
How to use checksums
537638c06b7e258d5fa17fa92750ec2bda354a5e6708927fdd2b3e05333ca66e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Security for ts2d 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page