SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.05868 · 2022

TotalSegmentator: robust segmentation of 104 anatomical structures in CT images

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2208.05868.json · badge: /api/ran/2208.05868.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
wasserth/totalsegmentator canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
stanfordmimi/totalsegmentatorv2 community (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
command_exists Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/dicom_io.py
code served (permissive licence) · get_code("d1a4855959beb8d9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import shutil

def command_exists(command):
    return shutil.which(command) is not None

# The function takes a single parameter 'command' which is a string
# representing a command name to check if it exists in the system PATH
# shutil.which() expects a string command name

ARGS = {
    "command": "python"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
crop_to_bbox Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/cropping.py
code served (permissive licence) · get_code("56b08e7a65ca7b6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (5, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small 3D image array
# Shape: (10, 8, 6) - distinct dimensions for x, y, z
image = np.random.rand(10, 8, 6).astype(np.float32)

# Create a bounding box in voxel coordinates
# Format: [[minx_idx, maxx_idx], [miny_idx, maxy_idx], [minz_idx, maxz_idx]]
bbox = [[2, 7], [1, 6], [0, 4]]

ARGS = {
    'image': image,
    'bbox': bbox
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (5, 5, 4) — shape (5, 5, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_bbox_from_mask Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/cropping.py
code served (permissive licence) · get_code("37ba223dc48dddd1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a 3D mask array with some foreground voxels
# Shape: (10, 12, 8) to have distinct dimensions
mask = np.ones((10, 12, 8), dtype=np.float32) * -900

# Add some foreground voxels (values > -900)
mask[2:7, 3:9, 1:6] = 0.5

ARGS = {
    'mask': mask,
    'outside_value': -900,
    'addon': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_config_key Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/config.py
code served (permissive licence) · get_code("0eafd685e8045cc3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import json
from pathlib import Path
import tempfile

# Create a temporary directory structure to simulate the totalsegmentator config
temp_dir = tempfile.mkdtemp()
totalseg_dir = Path(temp_dir) / '.totalsegmentator'
totalseg_dir.mkdir(parents=True, exist_ok=True)

# Create a config.json file
config_data = {
    'test_key': 'test_value',
    'another_key': 'another_value',
    'nested': {'inner': 'data'}
}
config_file = totalseg_dir / 'config.json'
with open(config_file, 'w') as f:
    json.dump(config_data, f)

# Set the environment variable
os.environ['TOTALSEG_HOME_DIR'] = str(totalseg_dir)

ARGS = {
    'key_name': 'test_key'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_valid_license Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/config.py
code served (permissive licence) · get_code("226ac7dd432d8d40")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import requests
from unittest.mock import Mock, patch

# Construct arguments for is_valid_license function
# The function takes a single parameter: license_number (a string)

license_number = "TEST_LICENSE_12345"

ARGS = {
    'license_number': license_number
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
keep_largest_blob Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/postprocessing.py
code served (permissive licence) · get_code("0333f6eb1f790f7f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (10, 10) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import ndimage

# Create sample binary data with multiple blobs
# We need data that when labeled will have multiple connected components
data = np.zeros((10, 10), dtype=np.uint8)

# Create a large blob (will be the largest)
data[1:4, 1:4] = 1

# Create a medium blob (will be second largest)
data[6:8, 6:8] = 1

# Create a small blob (will be smallest)
data[2, 8] = 1

ARGS = {
    "data": data,
    "debug": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (10, 10) — shape (10, 10) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
positive_float Ran
ran, honoured the contract we drafted
wasserth/totalsegmentator/totalsegmentator/bin/TotalSegmentator.py
code served (permissive licence) · get_code("a10d5a7ef3cf306b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def positive_float(value):
    try:
        value = float(value)
    except ValueError:
        raise argparse.ArgumentTypeError(f"Invalid number: '{value}'.")
    if value <= 0:
        raise argparse.ArgumentTypeError('Value must be greater than 0.')
    return value

ARGS = {
    'value': '3.14'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_small_blobs Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/postprocessing.py
code served (permissive licence) · get_code("5fa84fa04d5cb866")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (20, 20) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy import ndimage

# Create a binary image with some blobs of varying sizes
# The function expects a binary image (0s and 1s)
np.random.seed(0)

# Create a small binary image with some connected components
img = np.zeros((20, 20), dtype=np.int32)

# Add some small blobs (size < 10, should be removed)
img[2:4, 2:4] = 1  # 4 pixels
img[5:6, 5:7] = 1  # 2 pixels

# Add medium blobs (size 10-30, should be kept)
img[8:13, 8:12] = 1  # ~20 pixels
img[14:18, 14:17] = 1  # ~12 pixels

# Add a large blob (size > 30, should be removed)
img[0:10, 0:8] = 1  # ~80 pixels

ARGS = {
    "img": img,
    "interval": [10, 30],
    "debug": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (20, 20) — shape (20, 20) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reorder_multilabel_like_v1 Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/libs.py
code served (permissive licence) · get_code("8eab68f75cf61e14")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small multilabel image array (3x4 shape for distinctness)
data = np.array([
    [0, 1, 2, 1],
    [0, 2, 1, 0],
    [1, 1, 0, 2]
], dtype=np.uint8)

# label_map_v2: maps label_id to label_name
label_map_v2 = {
    0: "background",
    1: "person",
    2: "car"
}

# label_map_v1: maps label_id to label_name (different schema)
label_map_v1 = {
    0: "background",
    1: "car",
    2: "person"
}

ARGS = {
    "data": data,
    "label_map_v2": label_map_v2,
    "label_map_v1": label_map_v1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (3, 4) — shape (3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
resampling_order Ran
ran, honoured the contract we drafted
wasserth/totalsegmentator/totalsegmentator/bin/TotalSegmentator.py
code served (permissive licence) · get_code("40eb90ea5711b3d7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import argparse

def resampling_order(value):
    try:
        value = int(value)
    except ValueError:
        raise argparse.ArgumentTypeError(f"Invalid resampling order: '{value}'.")
    if value < 0 or value > 5:
        raise argparse.ArgumentTypeError('Resampling order must be between 0 and 5.')
    return value

ARGS = {
    'value': '3'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
setup_totalseg Ran
ran on a synthesized input
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/config.py
code served (permissive licence) · get_code("cb6f2c57ee0d3459")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import random
import json
import string
from pathlib import Path
import tempfile

# Create a temporary directory for testing
test_dir = tempfile.mkdtemp()
os.environ['TOTALSEG_HOME_DIR'] = test_dir

# Define ARGS - the function setup_totalseg has one optional parameter
ARGS = {
    'totalseg_id': 'test_totalseg_id_12345'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
undo_canonical Not yet run
unverified (harvested, no recorded run)
stanfordmimi/totalsegmentatorv2/totalsegmentatorv2/alignment.py
code served (permissive licence) · get_code("49ba65e86a9016df")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present a deep learning segmentation model that can automatically and robustly segment all major anatomical structures in body CT images. In this retrospective study, 1204 CT examinations (from the years 2012, 2016, and 2020) were used to segment 104 anatomical structures (27 organs, 59 bones, 10 muscles, 8 vessels) relevant for use cases such as organ volumetry, disease characterization, and surgical or radiotherapy planning. The CT images were randomly sampled from routine clinical studies and thus represent a real-world dataset (different ages, pathologies, scanners, body parts, sequences, and sites). The authors trained an nnU-Net segmentation algorithm on this dataset and calculated Dice similarity coefficients (Dice) to evaluate the model's performance. The trained algorithm was applied to a second dataset of 4004 whole-body CT examinations to investigate age dependent volume and attenuation changes. The proposed model showed a high Dice score (0.943) on the test set, which included a wide range of clinical data with major pathologies. The model significantly outperformed another publicly available segmentation model on a separate dataset (Dice score, 0.932 versus 0.871, respectively). The aging study demonstrated significant correlations between age and volume and mean attenuation for a variety of organ groups (e.g., age and aortic volume; age and mean attenuation of the autochthonous dorsal musculature). The developed model enables robust and accurate segmentation of 104 anatomical structures. The annotated dataset (https://doi.org/10.5281/zenodo.6802613) and toolkit (https://www.github.com/wasserth/TotalSegmentator) are publicly available.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2208.05868")
get_code_for_paper("2208.05868")
have("2208.05868")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2208.05868.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2208.05868.svg)](https://syntology.ai/paper/2208.05868)

Connect an agent — have() is free.