Do We Still Need Medical Segmentation Models?
Kai Zhang and Xianjin Dai
Department of Radiation Oncology
Stanford University School of Medicine
Contents
TL;DR. We think a generalist model with a simple harness has the potential, in the long run, to replace medical segmentation models. The task has long been formulated as dense prediction, but when the object is well defined, as the structures in medical images are, it can be recast as reasoning. Generalist models now have robust visual and language understanding and, most importantly, strong multimodal reasoning: given a scan and Python, they look at slices and write the code that draws the mask. These abilities keep evolving, so for deployment the whole system evolves with the model, while a specialist model has to be retrained.
Image source: TotalSegmentator MRI v3. All outlines come from one real run on the liver.
Code as contouring
A clinician who outlines an organ by hand, as in planning radiotherapy, scrolls through the scan, finds the structure, traces its border on every few slices and lets the software interpolate the slices in between. A general model that can look at images and write code can follow the same steps, and then nobody has to train a segmentation model for each new structure, because a sentence that describes the structure is enough. If that works, segmentation turns from something you train into something you describe. We call this Code as Contouring (CaC), and we tested how far it gets when the general model is GPT-6 Astra and its only tool is Python.
Every other route to a 3D segmentation depends on a model built for the job and inherits that model's limits (Figure 3). TotalSegmentator (Wasserthal et al. 2023) segments only the classes it was trained on. MedSAM (Ma et al. 2024) accepts any structure, but someone has to mark it with a box, points or a scribble, and a poor prompt gives a poor mask. VoxTell (Rokuss et al. 2026) replaces the marking with a free-text prompt, and in exchange it is sensitive to wording and fails outside its training data. The nnInteractive Agent (Isensee et al. 2026) puts a generalist agent in front, which writes the prompts for the nnInteractive model (Isensee et al. 2025), so its masks are still only as good as that model, and the agent needs 3,800 words of step-by-step instructions and purpose-built tools. Code as Contouring keeps the agent and drops everything built for the job.

Tap the figure to enlarge
How it works. Each run starts from one 3D scan, a case, and one prompt. The prompt names every target, one structure to segment in that scan, in a sentence of its own, and CaC works through all the targets of a case in one conversation, with a Python interpreter and a way to view the images its code saves. It never writes out a mask voxel by voxel. Instead it writes code that draws a slice with a coordinate grid, looks at the picture to read off where the structure is, and types those coordinates into code that builds the 3D mask, the array marking which voxels belong to the structure.
One run. A 3D scan is a stack of 2D slices, so CaC looks at it one picture at a time and chooses its own key slices. On the liver of a TotalSegmentator MRI, it first viewed every second slice, then slices 3 to 26 with a grid drawn on them, and typed outlines on 14 of them. Its code fills each outline with scikit-image's polygon, fills the slices in between from signed distance maps of the two nearest outlines, and smooths the result with a Gaussian filter. The resulting mask scores 0.88 in Dice, the overlap between a mask and the reference on a scale from 0 to 1. Tab ① of Figure 2 shows this run in five steps, and the code below is step 9 of the run, with 12 of its 14 outlines left out.
from scipy.ndimage import distance_transform_edt as edt, gaussian_filter
from skimage.draw import polygon
def polys(d):
m=np.zeros(a.shape,bool); keys=sorted(d)
for y,pts in d.items():
p=np.array(pts);r,c=polygon(p[:,0],p[:,1],(a.shape[0],a.shape[2]));m[r,y,c]=1
for lo,hi in zip(keys[:-1],keys[1:]):
if hi-lo>1:
u=edt(m[:,lo,:])-edt(~m[:,lo,:]);v=edt(m[:,hi,:])-edt(~m[:,hi,:])
for y in range(lo+1,hi):m[:,y,:]=((hi-y)*u+(y-lo)*v)>0
return m
d={
3:[(230,432),(269,443),(296,432),(311,405),(310,359),(292,324),(280,322),(265,347),(246,365),(225,378),(217,407)],
4:[(224,437),(268,450),(295,441),(314,417),(322,385),(314,341),(294,305),(278,304),(267,335),(250,363),(225,384),(217,410)],
# 12 more slices, typed the same way
}
m=polys(d);m=gaussian_filter(m.astype(float),(.9,.45,.9))>.48;save(m,'t01_liver')How the requests are written. The same name can mean different masks, so a request sentence has to say what the reference mask holds. We therefore wrote each sentence from the dataset's official label definition and added nothing to it. Where the name alone is ambiguous, the sentence says what is included and where the structure ends: "all vertebral bodies (without the vertebral arches), as one object", or "the left ventricular cavity (inside the endocardial border), including the papillary muscles and the trabeculations, closed at the mitral valve plane". In hearts with congenital defects a ventricle can lie on the other side, so there the sentence asks for "the morphologic left ventricle (identified by anatomy, not by side)". Only where a dataset publishes no definition is the sentence the plain name, such as "the left breast".
Setup: model, input, tools, what was not allowed, scoring
- Model. Every CaC result in this post comes from GPT-6 Astra, called through the OpenAI Responses API with reasoning effort set to medium (an API setting for how much the model reasons before it answers). Each case was run once. The API returns a summary of the model's reasoning at each step, and the quotes in this post come from these reasoning summaries. Most runs went through Stanford's AI API Gateway, which is approved for high-risk data. All images come from public, de-identified datasets.
- Data. Ten public datasets. One is the nnInteractive Agent benchmark (Isensee et al. 2026), nnIA-Bench for short: 14 scans of CT, MRI, PET and micro-CT, each with a request sentence and a reference mask per target, published to test agents that segment 3D images. We use 12 of its scans, 44 targets. The other nine have 271 cases and 1,369 targets of CT, MRI and 3D ultrasound, and the pooled numbers in this post count these nine. Most of the nine are samples of a public dataset. From TotalSegmentator we took 13 of the 65 official test cases of CT v1 and 19 and 18 cases from the two v3 releases, and asked for up to five structures per scan, chosen to spread across organs, vessels, muscles and bones. For the other sets we took a test or held-out split where one exists, for example the 20 Pediatric-CT-SEG cases of VoxTell's test split and the 35 held-out µ-RegPro volumes, and asked for the structures their papers report.
- Data checks. Every case passed eight automatic checks before it was run, for example that each reference mask is non-empty, lies on the image's grid and matches the released file's checksum. We read the request of every structure against its reference masks. Five cases with a data problem were dropped, and one released scan whose left and right lung labels were swapped was corrected.
- Input. One 3D scan and one prompt per run. The prompt gives one sentence per target, and tells CaC to work through the targets in that order and save each before starting the next (the full prompt of the liver run is in the next fold). All targets of a case share one conversation. A case has between 1 and 23 targets: one on the ultrasound sets, 23 on Pediatric-CT-SEG. The scan is a NIfTI file, a common medical image format whose header records how the image sits in the patient.
- Tools. A Python interpreter with NumPy, SciPy, scikit-image, SimpleITK, nibabel, matplotlib, Pillow and OpenCV, and nothing else. The model can look at any PNG or JPEG file its code saves.
- Sandbox. CaC's code ran in an isolated sandbox with no network. It could see only its own run folder and the Python libraries, so the reference masks and other runs were out of reach.
- Not allowed. No segmentation model, no pretrained weights, and no clicks, boxes or other hints. Images stayed on their released voxel grids, without cropping, resampling or reorientation.
- Scoring. Every mask is scored against the released reference mask in 3D. Dice is twice the overlapping volume divided by the sum of the two volumes. Precision is the share of the mask's voxels that lie inside the reference. NSD (normalized surface Dice) is the share of the surface within 2 mm of the reference's surface. HD95 is the 95th-percentile distance between the two surfaces and ASSD the mean distance, both in millimeters, so lower is better. In the tables, Dice and NSD are means over targets, and HD95 and ASSD are medians over targets. On nnIA-Bench, Dice and NSD are averaged within each image first, as its paper scores it. A target with an empty mask counts as an infinite distance.
- Who ran what. We ran every method in this post ourselves, except the two coding agents and one-click nnInteractive on nnIA-Bench, whose scores come from its paper (Isensee et al. 2026). Those are marked reported.
The full prompt of the liver run
The two messages that started the liver run, word for word except for the folder path, which is shortened. The first describes the tools and the second is the request. Other runs differ in the first sentence of the request, the target list and the paths, so a prompt runs from about 200 to 400 words, depending on the number of targets.
You work in the folder /runs/totalseg_mri_v3_s0879. You have two tools. python runs a Python 3 script with that folder as the working directory and returns what it prints; numpy, scipy, scikit-image, SimpleITK, nibabel, matplotlib, pillow and opencv are installed, there is no network, and files you write persist between calls. view_image shows you a PNG or JPEG file from the folder. When the task is done, reply without calling a tool.
Work autonomously: there is no human to answer questions during the run.
This is an MRI scan: /runs/totalseg_mri_v3_s0879/input/totalseg_mri_v3_s0879.nii.gz.
Segment each of the following structures as its own object, named exactly by its id.
Work through them in this order and commit each object before you start the next one:
- t01_liver: the liver
- t02_iliac_vena_left: the left common iliac vein
- t03_gluteus_minimus_left: the left gluteus minimus muscle
- t04_intervertebral_discs: all intervertebral discs, as one object
- t05_vertebrae: all vertebral bodies (without the vertebral arches), as one object
Save the result when you are done.
Use only the files in /runs/totalseg_mri_v3_s0879.
Committing and saving here means: write one NIfTI mask per target into /runs/totalseg_mri_v3_s0879/output, named exactly <target_id>.nii.gz (t01_liver.nii.gz, t02_iliac_vena_left.nii.gz, t03_gluteus_minimus_left.nii.gz, t04_intervertebral_discs.nii.gz, t05_vertebrae.nii.gz). Each mask: uint8, 1 inside the structure and 0 outside, with exactly the same dimensions, voxel spacing, origin and orientation as the input image.
Do not use pretrained segmentation models or networks (for example TotalSegmentator, nnU-Net, MedSAM, VoxTell, nnInteractive); your own code and classical image processing are allowed.
Main results
We compare CaC with three kinds of system built on a segmentation model. They differ in how they are told what to segment:
- Fixed-class models. TotalSegmentator (Wasserthal et al. 2023) and nnU-Net (Isensee et al. 2021) take no text or visual prompt. They output the classes in their training labels and nothing else.
- Text-prompted models. VoxTell (Rokuss et al. 2026), BiomedParse (Zhao et al. 2025), SegVol (Du et al. 2024) and SAT-Pro (Zhao et al. 2023) are also trained on labeled volumes, but they take the target as a sentence or an organ name. They learn what the words mean, so in principle one model can segment structures beyond a fixed list.
- Agents that drive a segmentation model. In the nnInteractive Agent (Isensee et al. 2026), a general agent writes the clicks, boxes and scribbles for the nnInteractive model (Isensee et al. 2025) and reviews the masks it returns.
Visual-prompt models such as MedSAM (Ma et al. 2024) are left out, because in their evaluations the box or click comes from the reference mask, which tells the model where the target is. The one exception is in § Does it match a complex agentic system?. The paper behind nnIA-Bench, the benchmark of the nnInteractive Agent, reports nnInteractive given one simulated click per target with no agent in front of it, and that score is what the segmentation model reaches on its own, so it shows how much the agents add.
The first four experiments ask for whole organs and structures, and the fifth for subregions, the named parts of one organ such as the head, body and tail of the pancreas, most of which no model has a class for.
Experiment 1
How accurate is Code as Contouring?
Setup
Cases: ten public datasets. Nine are samples of CT, MRI and 3D ultrasound datasets, 271 cases and 1,369 targets in all. The tenth is nnIA-Bench, 12 images and 44 targets. How we sampled them is in the Setup above, under Data.
Input: one 3D scan and one sentence per target.
Runs: one run per case.
It varies widely with the organ and the kind of image. Mean Dice is 0.93 on lungs and airways in CT, 0.81 to 0.85 on 3D ultrasound of the heart and the prostate, and 0.40 to 0.49 on the three TotalSegmentator sets.
The ranking does not follow the modality: the two 3D ultrasound sets are among the four highest of the ten, and the three lowest sets all come from one source, TotalSegmentator (Table 1). The main cause of their low scores is that on these scans CaC often swaps left and right, and the swap follows how the file stores its axes (see § When does it swap left and right?).
Elsewhere CaC finds the structure, and what it loses is at the edge. Of its masks, 84% overlap the reference with a Dice of at least 0.3. The most common error is an edge drawn a few millimeters off (see § Where do the errors come from?), and it shows in the surface score: on the heart ultrasound set Dice is 0.85 and NSD, the share of the mask's surface within 2 mm of the reference's, is 0.49.
| data | modality | cases | targets | Dice | NSD | HD95 | ASSD | empty |
|---|---|---|---|---|---|---|---|---|
| nnIA-Bench | CT, MRI, PET, micro-CT | 12 | 44 | 0.824 | 0.668 | 5.0 | 1.40 | 0 |
| AeroPath (lungs, airways) | CT | 27 | 54 | 0.925 | 0.865 | 13.0 | 1.46 | 0 |
| CETUS (left ventricle) | 3D echo | 60 | 60 | 0.848 | 0.485 | 6.1 | 2.47 | 0 |
| µ-RegPro (prostate) | 3D ultrasound | 35 | 35 | 0.812 | 0.590 | 6.4 | 2.24 | 1 |
| VEELA (liver, hepatic and portal veins) | CT | 19 | 57 | 0.673 | 0.719 | 18.3 | 2.77 | 0 |
| Pediatric CT (23 organs) | CT | 20 | 460 | 0.628 | 0.504 | 14.7 | 3.45 | 4 |
| HVSMR (congenital heart, 8 structures) | MRI | 60 | 464 | 0.622 | 0.559 | 16.9 | 3.61 | 3 |
| TotalSegmentator CT v1 | CT | 13 | 65 | 0.492 | 0.431 | 22.4 | 4.78 | 0 |
| TotalSegmentator MRI v3 | MRI | 18 | 82 | 0.463 | 0.396 | 18.6 | 3.96 | 1 |
| TotalSegmentator CT v3 | CT | 19 | 92 | 0.395 | 0.340 | 29.2 | 6.34 | 1 |
Table 1. CaC's scores on the ten datasets. HD95 and ASSD are in millimeters.
A typical mask from each dataset

Tap the figure to enlarge
Experiment 2
Does it match TotalSegmentator?
Setup
Cases: all ten datasets, less six TotalSegmentator CT v3 cases that are in TotalSegmentator's own training split. Outside nnIA-Bench that leaves 1,339 targets. TotalSegmentator's two general models, total for CT and total_mr for MRI, have a class for 713 of them (CT 511, MRI 202, ultrasound none).
Input: the image and the name of a model, total for CT or total_mr for MRI, with the classes that match our targets. There is no text prompt. Where one target spans several classes, as the lungs span the lobes, we merged them.
Runs: we ran TotalSegmentator 2.18 ourselves, at its default resolution, with its two general models. The 65 lung airway and liver vein targets belong to its task-specific models and count as not covered.
TotalSegmentator has no class for nearly half of our targets, so over all of them CaC scores 0.628 Dice against 0.396. On the CT classes it does have, TotalSegmentator leads, 0.833 against 0.637.
TotalSegmentator has one general model for CT and one for MRI, and no model for ultrasound. Each outputs a fixed list of classes, and for a target outside the list it returns nothing. That is the case for just under half of our targets (Figure 5, folded below): every ultrasound target, the chambers of the congenital hearts, the lung airways and the liver veins. CaC's lead over all targets comes entirely from these (the "Dice, all" column of Table 2).
How many targets TotalSegmentator covers, by dataset (Figure 5)

Tap the figure to enlarge
| modality (all, covered) | method | Dice, all | Dice, covered | NSD | HD95 | ASSD | empty |
|---|---|---|---|---|---|---|---|
| CT (698, 511) | TotalSegmentator | 0.610 | 0.833 | 0.779 | 6.6 | 1.31 | 2 |
| CaC | 0.622 | 0.637 | 0.499 | 14.6 | 3.25 | 1 | |
| MRI (546, 202) | TotalSegmentator | 0.191 | 0.517 | 0.508 | 45.5 | 8.16 | 34 |
| CaC | 0.598 | 0.578 | 0.533 | 23.3 | 4.74 | 1 | |
| Ultrasound (95, 0) | TotalSegmentator | 0.000 | – | – | – | – | – |
| CaC | 0.835 | – | – | – | – | – | |
| CT, MRI and ultrasound (1,339, 713) | TotalSegmentator | 0.396 | 0.743 | 0.702 | 9.1 | 1.67 | 36 |
| CaC | 0.628 | 0.620 | 0.508 | 17.0 | 3.60 | 2 | |
| nnIA-Bench (44, 11) | TotalSegmentator | 0.146 | 0.865 | 0.801 | 3.2 | 0.97 | 0 |
| CaC | 0.824 | 0.849 | 0.710 | 8.0 | 2.03 | 0 |
Table 2. "Dice, all" counts every target, with 0 where TotalSegmentator has no class. The other columns count only the targets it has a class for. The parentheses give all targets and covered targets. On the nnIA-Bench row, "Dice, all" is averaged within each image first.
Where it has a class on CT, TotalSegmentator is clearly better. Part of the gap is CaC swapping left and right (see § When does it swap left and right?), which is most frequent on TotalSegmentator's own two CT datasets. The rest is accuracy: on the pediatric CT, where CaC swapped the sides in no case, TotalSegmentator still leads, 0.78 against 0.66, and only on the lungs do the two tie, at 0.97.
On MRI CaC comes out ahead, 0.578 against 0.517, because TotalSegmentator can have a class and still return nothing. The aorta and inferior vena cava of the congenital-heart scans are on its class list, yet it returned an empty mask for 32 of the 120. On its own MRI scans TotalSegmentator leads, 0.76 against 0.46, so CaC's lead comes from the congenital hearts.
TotalSegmentator is far faster and cheaper to run. A case took it a median of 34 seconds on one NVIDIA RTX 6000 Ada GPU, and renting that GPU for 34 seconds costs about a cent at a public cloud rate (RunPod 2026), while a CaC case took about eight minutes and cost $3.23 on average.
What if labeled data exist?
Setup
Cases: the 35 µ-RegPro prostate ultrasound cases.
nnU-Net: trained by us on 73 labeled µ-RegPro volumes (65 to train, 8 to validate). CaC: zero examples.
A model trained on them scores higher: nnU-Net reaches 0.934 Dice on prostate ultrasound, against CaC's 0.812.
TotalSegmentator has no ultrasound model, but where labels exist one can be trained, so we trained nnU-Net on labeled volumes from the same prostate ultrasound dataset and scored it on the cases CaC had segmented. Training took 2.2 GPU-hours, about $2 at the same cloud rate.
Experiment 3
Does it beat text-prompted models?
Setup
Cases: all ten datasets.
Input: CaC's request sentence, word for word, for every method. In a second run, only the organ's name.
Runs: we ran all four models ourselves. Each model's image was prepared as its documentation specifies.
On the two 3D ultrasound datasets, CaC scores 0.835 Dice and the best of the four models 0.342. On CT and MRI, VoxTell is ahead of CaC.

Tap the figure to enlarge
All metrics by modality (Table 3)
| modality (targets) | method | Dice | NSD | HD95 | ASSD | empty |
|---|---|---|---|---|---|---|
| CT (728) | CaC | 0.612 | 0.521 | 16.3 | 3.39 | 5 |
| VoxTell v1.1 | 0.801 | 0.770 | 6.2 | 1.30 | 11 | |
| BiomedParse v2 | 0.556 | 0.514 | 20.2 | 3.97 | 84 | |
| SegVol | 0.509 | 0.480 | 24.3 | 4.89 | 14 | |
| SAT-Pro | 0.079 | 0.060 | 236.2 | 149.08 | 256 | |
| MRI (546) | CaC | 0.598 | 0.534 | 17.0 | 3.62 | 4 |
| VoxTell v1.1 | 0.751 | 0.705 | 11.7 | 2.12 | 15 | |
| BiomedParse v2 | 0.444 | 0.406 | 32.3 | 8.35 | 18 | |
| SegVol | 0.019 | 0.020 | 99.0 | 56.42 | 112 | |
| SAT-Pro | 0.131 | 0.112 | 103.8 | 48.06 | 178 | |
| Ultrasound (95) | CaC | 0.835 | 0.524 | 6.2 | 2.40 | 1 |
| VoxTell v1.1 | 0.057 | 0.050 | 51.4 | 29.89 | 30 | |
| BiomedParse v2 | 0.258 | 0.139 | 32.8 | 12.22 | 20 | |
| SegVol | 0.001 | 0.003 | inf | inf | 60 | |
| SAT-Pro | 0.342 | 0.130 | 19.1 | 7.84 | 1 | |
| nnIA-Bench (44) | CaC | 0.824 | 0.668 | 5.0 | 1.40 | 0 |
| VoxTell v1.1 | 0.614 | 0.563 | 13.9 | 3.28 | 6 | |
| BiomedParse v2 | 0.392 | 0.287 | 251.9 | 93.35 | 19 | |
| SegVol | 0.263 | 0.229 | 163.8 | 123.83 | 4 | |
| SAT-Pro | 0.158 | 0.107 | 1,531.5 | 1,077.49 | 6 |
Table 3. All metrics by modality, with every model given the sentence CaC got. On nnIA-Bench, the large distances of SAT-Pro, BiomedParse and SegVol come from the foot CT.
The four models work where they were trained and fail outside it. On ultrasound none of them comes near CaC: BiomedParse had seen ultrasound of the heart in training and still scores less than half of CaC's Dice on our heart set. nnIA-Bench shows both sides at once: VoxTell is ahead of CaC on 8 of the 12 images and far behind on the other four, among them a micro-CT of a mouse and of an ant.
On CT and MRI the trained model wins, and it does not need to have seen the dataset: of the five sets where VoxTell leads, three come from sources it was never trained on. What it has seen is the modality, more than 62,000 CT, PET and MRI volumes.
Does the wording of the request matter? A single sentence can take a model from a good mask to no mask. On a dataset it was trained on, SAT-Pro scores 0.90 given only the organ's name and 0.10 given the sentence CaC got, and most of its masks come back empty. VoxTell is built for free text and barely moves on CT and MRI, yet on the adrenal CT of nnIA-Bench the sentence takes it from 0.79 to 0.00. The image is as fragile as the words: without its CT intensity window, BiomedParse loses more than half of its Dice. Given the name (the orange ticks in Figure 6), SAT-Pro moves ahead of CaC on CT, and nothing else in the comparison changes.
Experiment 4
Does it match a complex agentic system?
Setup
Cases: 12 of the 14 nnIA-Bench images, 44 targets (the other two images were not available to us).
Input: nnIA-Bench's request sentence for CaC and the agents. One simulated click per target for nnInteractive alone.
CaC: our run, one run, no segmentation model.
Agents and one-click nnInteractive: reported in the nnIA-Bench paper (Isensee et al. 2026). The agents are Claude Code with Claude Opus 5.5 and Codex with gpt-6.1-sol, both at medium reasoning effort, and their scores are means of three runs. Its published results give a score per image, so we average its scores over the same images and do not use its 14-image means.
On nnIA-Bench, CaC scores 0.824 Dice, and the two agents 0.838 and 0.825. CaC had a prompt of 200 to 400 words and Python. The agents add a segmentation model, 18 purpose-built tools and about 3,800 words of instructions.
The nnInteractive Agent is a system stacked from many parts. A coding agent sits in front of the nnInteractive segmentation model. It reads the request, writes the clicks, boxes or scribbles that prompt the model, and reviews the masks that come back. It works from a long set of instructions, with tools written for each of these steps and an optional second agent that checks the work. CaC got the same request sentences and none of these parts.
| method | who segments | mean Dice |
|---|---|---|
| Codex agent (reported) | nnInteractive | 0.838 |
| Claude Code agent (reported) | nnInteractive | 0.825 |
| CaC | its own code | 0.824 |
| nnInteractive alone, one simulated click per target (reported) | nnInteractive | 0.695 |
Table 4. CaC, with no segmentation model, scores about the same as the two agents that drive nnInteractive.
The means are close, but single images differ widely: nnInteractive draws the 17 bones of the foot CT better than CaC, 0.98 against 0.84, and CaC is ahead on the two micro-CT images and on the bladder MRI.
What do the parts buy? They make nnInteractive segment better. Given one click and no agent, nnInteractive scores 0.695, and everything stacked around it raises that by 0.13 to 0.14. On the liver cancer CT one click scores 0.37 and both agents 0.96. CaC does not need nnInteractive made better, because it does the segmentation itself: on that image it scores 0.94 with no model.
Experiment 5
Can it segment subregions of an organ?
Setup
Cases: 20 new cases, separate from the 271: 10 prostate T2 MRIs from ProstateZones (Holmlund et al. 2024), with five zones and structures, and 10 CTs from PanTS (Li et al. 2025), with the head, body and tail of the pancreas. 80 targets.
Reference: the released labels. ProstateZones has two human readers, and we score against the first.
Input: each subregion's published definition for CaC. The models got the same sentence and, in a second run, only the name. The tables show each model with its better prompt.
Runs: we ran every method ourselves, CaC with the same model and reasoning effort as in the main runs, and looked at the masks of all 20 cases.
CaC divides the organ from the written definitions alone. Asked for the head, body or tail of the pancreas, the trained models mostly return the whole gland.
Apart from the prostate's peripheral and transition zones, no model's label list has these subregions: TotalSegmentator has "pancreas" and "prostate" and nothing below them. A lab that wants them from a trained model therefore needs new labels and new training for each one, whereas for CaC a new structure is a new sentence.
On the pancreas, BiomedParse and SegVol returned nearly the same mask three times, a mask of the whole gland. VoxTell's three masks are mostly the gland as well, and SAT-Pro left 12 of its masks empty. CaC's three masks are separate in every case (Figure 7).

Tap the figure to enlarge
Dice misses all of this. On PanTS the methods look tied, and a perfect mask of the whole pancreas, handed in for every subregion, scores higher than all of them (Table 5). The reason is arithmetic: a subregion that is a third of the gland gives that mask a recall of 1 and a precision of one third, which makes a Dice of 0.5. Precision and HD95, the distance between the two surfaces, punish the extra volume, and they rank CaC first.
| method | Dice | Precision | HD95 | Overlap | Empty |
|---|---|---|---|---|---|
| PanTS, pancreas | |||||
| Whole pancreas, every subregion | 0.492 | 0.333 | 75.7 | 1.00 | 0 |
| CaC | 0.455 | 0.548 | 20.2 | 0.00 | 0 |
| VoxTell v1.1 (sentence) | 0.433 | 0.313 | 66.9 | 0.81 | 0 |
| BiomedParse v2 (name) | 0.425 | 0.288 | 77.9 | 0.98 | 0 |
| SegVol (name) | 0.406 | 0.274 | 78.0 | 0.93 | 0 |
| SAT-Pro (name) | 0.142 | 0.095 | 230.1 | 0.11 | 12 |
| ProstateZones, prostate | |||||
| Second human reader | 0.505 | ||||
| CaC | 0.454 | 0.456 | 8.1 | 0.00 | 0 |
| VoxTell v1.1 (sentence) | 0.317 | 0.345 | 21.6 | 0.52 | 0 |
| Whole prostate, every subregion | 0.276 | 0.200 | 26.7 | 1.00 | 0 |
| BiomedParse v2 (name) | 0.249 | 0.183 | 24.6 | 0.42 | 0 |
| SAT-Pro (sentence) | 0.059 | 0.056 | 24.0 | 0.22 | 3 |
| SegVol (name) | 0.007 | 0.019 | 87.0 | 0.04 | 14 |
Table 5. "Whole pancreas" and "whole prostate" are a perfect mask of the organ handed in for every subregion. Overlap is the Dice between a method's own masks of different subregions: 0 means separate and 1 means the same mask. HD95 is in millimeters.
Does the full definition help the models? No. The sentence says where each subregion lies, for example "to the right of the superior mesenteric vessels." On neither dataset did any model score significantly higher with the sentence than with the bare name, and in five of the model and dataset pairs the name was significantly better (uncorrected p < 0.05).
On the prostate the difference shows in Dice as well. CaC scores above every model in all 10 cases, at 0.454, close to the 0.505 at which the two human readers agree with each other. VoxTell was trained on the peripheral and transition zones and beats CaC on the transition zone, 0.85 against 0.76, but asked for the central zone, the stroma or the urethra, it draws the transition zone again (Figure 8), and SAT-Pro has the peripheral and transition zones the wrong way round.
One ProstateZones case (Figure 8)

Tap the figure to enlarge
CaC's accuracy on a single subregion is moderate. Its lowest score is the pancreas body, 0.25, and part of that is a disagreement about where the body ends: the written definition ends it at the left edge of the aorta, and CaC's boundary lies a median 1.6 mm from that edge, while the boundary in the released labels lies 18 mm from it.
Analysis
This section uses only CaC's own runs on the nine datasets other than nnIA-Bench.
Experiment 6
Where do the errors come from?
Setup
Error: 1 minus Dice, summed over all targets.
Cause: we reviewed every failed target, one with a Dice below 0.3, and gave its whole error to one cause. A mask with a Dice of at least 0.3 is usable.
Mostly from boundaries: CaC finds the structure and draws its edge a few millimeters off.
- 61%: imprecise boundaries of usable masks. Small structures suffer more: in 6 of 9 datasets, Dice rises with the size of the structure. On MRI, where CaC outlines most targets by hand, the masks run large, a median 1.49 times the reference's volume on TotalSegmentator MRI.
- 17%: left and right swapped. Most of this is on the three TotalSegmentator sets, the subject of § When does it swap left and right?. The rest is swapped heart chambers, which go with unusual anatomy: a ventricle or atrium pair is swapped in 11 of the congenital-heart cases, 10 of them with a severe defect (see § Can its knowledge of anatomy mislead it?).
- 14%: wrong location or wrong object. The typical case is the right structure in a plausible but wrong place, for example the right adrenal gland drawn on the back edge of the liver in 19 pediatric cases.
- 8%: everything else. Poor boundaries of failed masks, empty masks, and targets whose official definition and released mask disagree. For the TotalSegmentator iliac vessels, the definition says "common iliac" and the reference also includes the external iliac.
An edge a few millimeters off and a structure in the wrong place are different problems, and they need different checks.
Experiment 7
When does it swap left and right?
Setup
Cases: the 47 TotalSegmentator cases with left and right targets (13 from CT v1, 16 from CT v3 and 18 from MRI v3), stored as RAS, and the 20 Pediatric CT cases, stored as LPS. Same prompt for all.
On files stored as RAS, CaC swapped the sides in 26 of 47 cases. On files stored as LPS, it swapped them in none of 20.
A NIfTI file's header says which way each voxel axis points in the patient. TotalSegmentator stores its volumes as RAS (right, anterior, superior), in which the first index increases toward the patient's right. DICOM, the format of clinical scanners, uses LPS (left, posterior, superior), in which the first axis increases toward the left. The difference matters because of how scans are viewed: a radiology screen shows the patient as seen from the feet, so the patient's left is on the right of the screen.
The swapped runs treat every file as LPS. CaC's drawing code transposes each slice before plotting, so the first index runs left to right across the picture. On an LPS file the picture then looks like a radiology screen, with the patient's left on the right. On an RAS file the same code puts the patient's right there, and CaC still names the sides as on a radiology screen, so every name is reversed. What separates the correct runs is that they worked the mapping out: none of the 26 swapped runs wrote down a correct mapping from voxel index to patient side, and 10 of the 21 correct runs did. Reading the header helps as well: runs that called nibabel's orientation function swapped the sides in 5 of 19 cases, and the others in 21 of 28.
The swapped masks are good masks with the wrong name (Figure 9). Scored against the reference of the other side, their Dice rises from about 0 to 0.73 and 0.71 on the two CT sets and to 0.52 on the MRI set. With the names corrected, the means of the three sets rise to between 0.59 and 0.70. A swap can also leave a mask empty. In one CT, CaC searched for the left humerus on the patient's right, found no bone there, and saved an empty mask with the message "the left humerus is outside the scan's field of view". That is true of the right humerus, and the left one is in the scan.

Tap the figure to enlarge
Some runs saw that the anatomy looked reversed and explained it away: six swapped runs mention situs inversus, a rare mirror-image arrangement of the organs. One reads: "I'm analyzing an image that suggests possible situs inversus due to the liver's position on the right side and the spleen being high" (CT v1, case s1248). None of the six printed the file's orientation codes. Checking such a system means checking what it assumed about the data, and the reasoning summaries let us read those assumptions.
Does one note fix it?
Setup
Cases: 12 cases from TotalSegmentator MRI v2, an earlier release that is also stored as RAS, run with a three-sentence note added to the request. They are compared with the 47 cases above, which had no note.
Yes. None of the 12 cases with the note was swapped.
The note tells CaC to take left and right from the file header and says how to read it. Both parts matter. In a pilot on 5 cases that had been swapped, the first two sentences alone, which point to the header, fixed 2, and the third sentence, which says what the axis codes mean, fixed the other 3. Five of the swapped runs had printed "RAS" in their first step and never wrote down what it meant.
The three sentences of the note
Left and right mean the patient's left and right. Take them from the image's orientation information (its affine), not from how a picture looks on screen. The axis codes that nibabel gives (nib.aff2axcodes), e.g. ('R', 'A', 'S'), name the direction in which each array axis increases: 'R' means the index grows toward the patient's right, 'A' toward the front (anterior), 'S' toward the head (superior).
Experiment 8
Can its knowledge of anatomy mislead it?
Setup
Cases: three runs read step by step, two congenital-heart MRIs and one TotalSegmentator CT.
Yes. CaC knows the textbook rule, and it fails on the patient who breaks the rule.
In a normal heart the aorta leaves the left ventricle. One patient in the congenital-heart set has a transposition: the ventricles are inverted, and the aorta leaves the morphologic right ventricle. CaC saw this early. Its summary at step 7 reads "the right ventricle is anterior, and it seems to feed into the aorta, while the left ventricle feeds the pulmonary artery", and the two ventricle masks it then drew had the correct names: the one it called left ventricle scores a Dice of 0.74 against the left ventricle's reference. The request asks for the morphologic left ventricle, identified by anatomy and not by side, and thirteen steps later CaC decided that the chamber with the aortic outflow was the morphologic left ventricle and overwrote its own answer:
# Morphologic LV: rounded rightward chamber, with paired papillary muscles and aortic outflow.
m=np.load('rv.npy');save(m,'t01_left_ventricle');np.save('lv_correct.npy',m)The right-ventricle mask, renamed and stored as lv_correct.npy, scores a Dice of 0.00 against the left ventricle's reference and 0.81 against the right ventricle's (Figure 10), and the mask that had been correct for the left ventricle was saved as the right one. A second run on a heart with inverted ventricles also exchanged its two correct masks late in the run, under the comment "correcting morphologic identities".

Tap the figure to enlarge

Tap the figure to enlarge
Counting fails in the same way. Asked for the right 7th rib on a CT that is cut off at the top, CaC split the ribs into connected pieces of bone, colored them on a projection and counted upward from the lowest one. This patient's 12th rib is rudimentary, 1.4 ml of bone, and it was not among the pieces, so the count started one rib too high. The saved mask is a clean rib that scores 0.92 against the 6th rib and 0 against the 7th (Figure 11).
In both runs the drawing is right and the rule that names the mask is wrong. A rule that holds in almost every patient is what a general model learns best, so its naming errors gather in the patients whose anatomy is unusual.
Experiment 9
Does it work like an annotator?
Setup
Runs: the 271 runs on the nine datasets, read through the code each one wrote, the images it viewed and its reasoning summaries.
In the order of its steps, yes: a run renders the scan, looks, reasons from anatomy and then draws. What it lacks is a check of the finished masks.
Our prompt names the structures and Python as the only tool and says nothing about what to render or how to use the pictures, so the order of steps in a run is CaC's own. Nearly every run renders the image before it draws any mask. One run on an AeroPath CT shows the order: it began with overview montages, coronal views and per-slice statistics, chose a method and its thresholds, computed an airway mask and rendered a projection of it. From that image its summary placed a possible leak, so it changed the region growing to block the leak and saved, for an airway Dice of 0.90.
The rule it draws with changes with the physics of the scanner. CT values are calibrated Hounsfield units, and on CT it types fixed cutoffs after looking at the image, with medians of -850 for lungs and airways and 170 for bone. MRI values have no fixed meaning, so there it picks a new number for each image: on the heart MRIs its cutoffs range from 125 to 1,025, yet divided by each image's blood brightness most land between 0.44 and 0.66. On ultrasound it thresholds in 1 of 95 runs, and in some heart scans it searches for the dark-to-bright wall along rays. When a job repeats, it also builds its own tools: in every heart MRI run (8 targets) and every pediatric CT run (23 targets) it wrote a helper module, with functions like show(), montage() or ellipses(), and called it from most later steps.
The step an annotator ends with is the one the runs skip. CaC viewed its saved mask over the image for 27 of 1,369 targets, and 255 of 271 runs close with the same message, that all masks are saved and the geometry matches the input. The doubts in its reasoning summaries do not mark the failures either, since as a review flag they would catch 22% of them. Yet the misses were in view: for 1,366 of 1,369 targets the reference structure lay on at least one slice the model looked at, and the adrenal and thyroid glands, its weakest structures, were mostly drawn in the wrong spot.
Each failure suggests its own check. Writing the patient's left and right on every rendered image exposes a swapped side. A zoomed view before saving catches a misplaced gland, and a test for overlap with the neighbors catches masks that run into each other.
Discussion
Keep the system simple. On nnIA-Bench, the model's own agentic ability was enough to work out the workflow, so step-by-step instructions and purpose-built tools had little left to add. CaC's runs arrive on their own at much of the workflow that the nnInteractive Agent's long instructions spell out (Isensee et al. 2026). Sutton's bitter lesson (Sutton 2019) describes the same pattern in AI research, where general methods overtake hand-built knowledge as they scale, and here the hand-built knowledge is a set of step-by-step instructions written into a prompt. Model makers give the same advice for prompts, and prior exploration of generalist agents in medicine points the same way (Schluntz et al. 2024, Anthropic 2025, OpenAI 2026, Zhang et al. 2026). We would state the task, give general tools, measure, and add back only what the measurement shows is missing, as we did for swapped sides with three sentences on reading the file header.
New structure, new sentence. The same short prompt carried across structures and scanners, and a new structure cost one new sentence. Trained networks stay tied to their training sites: in one study, conventionally trained models lost 39% of their Dice on an unseen site or scanner (Zhang et al. 2020). CaC adapts because it changes its rule with the physics of the scanner and writes that rule down in code. A rule written in code can be read, corrected and reused.
Write the definition down. A generalist follows the convention it is given, so segmentation by description needs its conventions in writing. Where nothing is written even experts differ: a radiation oncologist and a radiologist outlining the same rectal tumors agreed at a median Dice of 0.75 (Stratulat et al. 2026). In the pediatric CT references an adolescent's breast is the whole mound including its fat, a convention that lives only in the labels, so CaC drew a much smaller patch and scored 0.01-0.28. Scores need the same care, because on the pancreas subregions Dice ranked a mask of the whole gland above every method we ran. An evaluation has to report several metrics, add reference lines that show what a trivial answer would score, and include a visual check of the masks; on the subregions, one figure of the masks (Figure 7) showed at a glance what the means had hidden.
The missing self-check. In these runs CaC did not notice its own errors, and language models in general need outside feedback to correct themselves (Huang et al. 2024). On the targets that clearly failed, the wrong side or the wrong place accounts for four fifths of the Dice lost, and the final messages stay silent on those failures. The run that replaced its correct ventricle masks with wrong ones, described in § Can its knowledge of anatomy mislead it?, closed by reporting that all eight masks were saved under the requested names. Over-trust in auto-contours is a recognized clinical risk (De Biase et al. 2024), and a reviewer needs the system to say where it may be wrong. A general model can check a mask that it is handed: in the nnInteractive Agent, where the agent reviews the masks it gets back, Dice rose from 0.74-0.76 after the first prompt to 0.81-0.84 at the end (Isensee et al. 2026).
Generalist and specialist together. A trained model remains the cheaper and more accurate route to most structures it already covers, at about a cent per case. Its coverage grows only by training again, and the dependable way to do that is still to train on old and new data together: continual-learning methods are still measured against this joint training (Qazi et al. 2024), and TotalSegmentator retrained all of its models when its second version added classes (Wasserthal 2023). For VoxTell one such run took roughly 9,200 GPU-hours on more than 62,000 scans (Rokuss et al. 2026). CaC, by contrast, gains a structure with one sentence and improves whenever the general model under it does. The two also fail in different places, so the system we would build today uses both. Scoring ultrasound with CaC's masks and CT and MRI with VoxTell's gives a mean Dice of 0.784, against 0.730 for VoxTell alone and 0.622 for CaC alone, and all of the gain comes from ultrasound. They can also work in sequence: label-building loops start from a few hand-segmented cases (Wasserthal et al. 2023), and a generalist could draft those for a structure that no model knows yet. Each new general model then moves the line between the two toward the generalist.
References
Show all 23 references
- Wasserthal et al. TotalSegmentator: robust segmentation of 104 anatomic structures in CT images. Radiology: Artificial Intelligence, 2023. https://pmc.ncbi.nlm.nih.gov/articles/PMC10546353/
- Ma et al. Segment anything in medical images. Nature Communications, 2024. https://doi.org/10.1038/s41467-024-44824-z
- Rokuss et al. VoxTell: Free-text promptable universal 3D medical image segmentation. CVPR, 2026. https://arxiv.org/abs/2511.11450
- Isensee et al. nnInteractive Agent: General-purpose AI agents as 3D image annotators. arXiv, 2026. https://arxiv.org/abs/2610.31080
- Isensee et al. nnInteractive: redefining 3D promptable segmentation. arXiv, 2025. https://arxiv.org/abs/2503.08373
- Isensee et al. nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods, 2021. https://doi.org/10.1038/s41592-020-01008-z
- Zhao et al. A foundation model for joint segmentation, detection and recognition of biomedical objects across nine modalities. Nature Methods, 2025. https://doi.org/10.1038/s41592-024-02499-w
- Du et al. SegVol: universal and interactive volumetric medical image segmentation. NeurIPS, 2024. https://arxiv.org/abs/2311.13385
- Zhao et al. One model to rule them all: towards universal segmentation for medical images with text prompts. arXiv, 2023. https://arxiv.org/abs/2312.17183
- RunPod. GPU cloud pricing (RTX 6000 Ada, on demand). Accessed 2026-11-08. https://www.runpod.io/pricing
- Holmlund et al. ProstateZones: segmentations of the prostatic zones and urethra for the PROSTATEx dataset. Scientific Data, 2024. https://doi.org/10.1038/s41597-024-03945-2
- Li et al. PanTS: the Pancreatic Tumor Segmentation dataset. arXiv, 2025. https://arxiv.org/abs/2507.01291
- Sutton. The Bitter Lesson. Incomplete Ideas (blog), 2019. http://www.incompleteideas.net/IncIdeas/BitterLesson.html
- Schluntz et al. Building effective agents. Anthropic Engineering, 2024. https://www.anthropic.com/engineering/building-effective-agents
- Anthropic Applied AI team. Effective context engineering for AI agents. Anthropic Engineering, 2025. https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
- OpenAI. Reasoning best practices. OpenAI API documentation, accessed 2026. https://developers.openai.com/api/docs/guides/reasoning-best-practices
- Zhang et al. The complexity paradox of generalist AI agents in medicine: exploring GPT-5 for real-world multimodal medical diagnosis. npj Digital Medicine, 2026. https://doi.org/10.1038/s41746-026-03325-7
- Zhang et al. Generalizing deep learning for medical image segmentation to unseen domains via deep stacked transformation. IEEE Transactions on Medical Imaging, 2020. https://pmc.ncbi.nlm.nih.gov/articles/PMC7393676/
- Stratulat et al. Inter-observer variation in rectal cancer gross tumor volume delineation by radiologist and oncologist. Acta Radiologica, 2026. https://doi.org/10.1177/02841851261468005
- Huang et al. Large language models cannot self-correct reasoning yet. ICLR, 2024. https://arxiv.org/abs/2310.01798
- De Biase et al. Clinical adoption of deep learning target auto-segmentation for radiation therapy: challenges, clinical risks, and mitigation strategies. BJR|Artificial Intelligence, 2024. https://academic.oup.com/bjrai/article/1/1/ubae015/7841928
- Qazi et al. Continual learning in medical imaging: a survey and practical analysis. arXiv, 2024. https://arxiv.org/abs/2405.13482
- Wasserthal. Changes and improvements in TotalSegmentator v2. GitHub, 2023. https://github.com/wasserth/TotalSegmentator/blob/master/resources/improvements_in_v2.md


