Datasets:
The dataset viewer is not available for this split.
Error code: TransformRowsProcessingError
Exception: TypeError
Message: could not determine the type of the data cell.
Traceback: Traceback (most recent call last):
File "/src/libs/libapi/src/libapi/rows_utils.py", line 37, in _transform_row
transformed_row[featureName] = get_cell_value(
~~~~~~~~~~~~~~^
dataset=dataset,
^^^^^^^^^^^^^^^^
...<9 lines>...
hf_token=hf_token,
^^^^^^^^^^^^^^^^^^
)
^
File "/src/libs/libcommon/src/libcommon/viewer_utils/features.py", line 587, in get_cell_value
raise TypeError("could not determine the type of the data cell.")
TypeError: could not determine the type of the data cell.Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
CTSpinoPelvic1K
A fused spine + pelvis 3D CT segmentation dataset built for one job the common tools get wrong: numbering the lumbar spine correctly in patients with a lumbosacral transitional vertebra (LSTV).
802 CT volumes with voxel-aligned, radiologist-grounded label maps spanning the thoracolumbar spine, sacrum, hips, femurs, ribs and — new in this release — surgical instrumentation. Every transitional case carries an expert Castellvi grade.
| Records | 802 CT / label pairs (one .nii.gz each) |
| Size | ~195 GB |
| Label classes | 67 (ids 0–66, contiguous), VerSe-native vertebra ids; no sentinel |
| Orientation | PIR, CT and label share one affine — no resampling needed |
| Transitional cases | 31 flagged by lstv_class, 33 expert Castellvi-graded |
| Instrumented cases | 11, radiologist-confirmed |
| Splits | patient-level 5-fold CV + held-out test, LSTV-stratified |
| Release | v6 (main) |
Why this dataset exists
You cannot tell L5 from L6 by looking at one vertebra. Level identity is a counting problem, and in roughly 1 in 5 people the count is ambiguous because the lumbosacral junction is transitional — the last lumbar vertebra is partly or wholly fused to the sacrum (sacralization), or the first sacral segment is partly or wholly free (lumbarization). Segmenters trained on non-transitional anatomy silently mislabel these, and a mislabelled level is a wrong-level operation waiting to happen.
CTSpinoPelvic1K is built so a model can learn the count from anatomy that is actually in the field of view:
- Vertebrae are radiologist ground truth, full stop. No pseudolabelled spine is ever shipped. The L1–L6 calls and the transitional adjudications come from CTSpine1K's radiologists.
- Two counting anchors, rostral and caudal. The lumbar column is bracketed by two fixed
landmarks, which makes the count — hence L5-vs-L6 — deterministic:
- Rostral: T12 (id
19), the last rib-bearing vertebra, directly above ground-truth L1. - Caudal: S1 (id
29), the first sacral body, cut from the ground-truth sacrum by a plane square to the patient (see The S1 carve) — the bottom bracket, and the endplate landmark for sacral slope and pelvic incidence.
- Rostral: T12 (id
- LSTV read from both ends, and graded. Vertebral count (CTSpine1K) and pelvic annotation (CTPelvic1K), independently, with an agreement flag and an expert Castellvi type.
- Honest about the pelvis. Real where fused, pseudolabelled (leak-safe) for
spine_onlyrecords, withprov_spine/prov_pelvisnaming the origin of every side of every record.
Sources
Built by patient-level crosswalk between three public datasets — no registration, no resampling of annotations:
| Source | Contributes |
|---|---|
| TCIA CT COLONOGRAPHY | the CT volumes (prone + supine per patient) |
| CTSpine1K (COLONOG subset) | VerSe-convention vertebral masks, radiologist GT |
| CTPelvic1K (dataset2) | sacrum + bilateral hip masks |
Annotations are placed onto the TCIA volume with the highest bone coverage (HU > 200),
separately per anatomy. For most patients both land on the same series (fused); for the
rest, spine and pelvic labels target different prone/supine acquisitions (separate,
exported as two records — one spine_only, one pelvic_native). Femurs come from
TotalSegmentator; ribs are numbered off the ground-truth thoracic column.
Quickstart
Grab one case first (don't pull 195 GB to look around)
from huggingface_hub import hf_hub_download
import nibabel as nib
REPO = "OpenSpineConsortium/CTSpinoPelvic1K"
ct = nib.load(hf_hub_download(REPO, "ct/0007_ct.nii.gz", repo_type="dataset"))
lbl = nib.load(hf_hub_download(REPO, "labels/0007_label.nii.gz", repo_type="dataset"))
assert ct.shape == lbl.shape
assert (ct.affine == lbl.affine).all() # true for every pair in the dataset
print(ct.shape, nib.aff2axcodes(ct.affine)) # -> PIR
Metadata only (a few MB, no imaging)
from huggingface_hub import snapshot_download
import json, pathlib
meta = snapshot_download(
"OpenSpineConsortium/CTSpinoPelvic1K", repo_type="dataset",
allow_patterns=["*.json", "*.csv", "*.py", "*.md"],
)
records = json.loads((pathlib.Path(meta) / "manifest.json").read_text())
print(len(records), "records")
# every transitional case, with its expert grade
lstv = [r for r in records if r["castellvi_type"]]
for r in lstv[:5]:
print(r["volume_id"], r["lstv_label"], r["castellvi_type"], r["castellvi_notes"])
A subset — e.g. only the transitional cases
import json, pathlib
from huggingface_hub import snapshot_download
records = json.loads((pathlib.Path(meta) / "manifest.json").read_text())
want = [r for r in records if r["lstv_class"] != 0 or r["castellvi_type"]]
patterns = [r["ct_file"] for r in want] + [r["label_file"] for r in want]
root = snapshot_download("OpenSpineConsortium/CTSpinoPelvic1K", repo_type="dataset",
allow_patterns=patterns)
The whole thing
from huggingface_hub import snapshot_download
root = snapshot_download("OpenSpineConsortium/CTSpinoPelvic1K", repo_type="dataset",
max_workers=8) # ~195 GB, resumable
PyTorch
dataset_interface.py ships in the repo root and has no torch dependency of its own;
CTSpinoPelvicDataset is the torch adapter.
import sys; sys.path.insert(0, root)
from dataset_interface import CTSpinoPelvicDataset
from torch.utils.data import DataLoader
ds = CTSpinoPelvicDataset(root=root, split=("fold", 0, "train"))
dl = DataLoader(ds, batch_size=1, shuffle=True)
for batch in dl:
ct, label = batch["ct"], batch["label"] # (B,1,Z,Y,X) / (B,Z,Y,X)
Other split values: "trainval", "test", ("fold", i, "val").
MONAI
from monai.transforms import (Compose, RandCropByPosNegLabeld, RandFlipd,
NormalizeIntensityd)
from dataset_interface import CTSpinoPelvicDataset
transforms = Compose([
NormalizeIntensityd(keys="ct", subtrahend=0, divisor=1000),
RandCropByPosNegLabeld(keys=("ct", "label"), label_key="label",
spatial_size=(96, 96, 96), pos=2, neg=1, num_samples=2),
RandFlipd(keys=("ct", "label"), prob=0.5, spatial_axis=(0, 1, 2)),
])
ds = CTSpinoPelvicDataset(root=root, split=("fold", 0, "train"), transform=transforms)
Repository layout
ct/<volume_id>_ct.nii.gz 802 CT volumes (PIR, PHI-stripped)
labels/<volume_id>_label.nii.gz 802 label maps (voxel-aligned, same affine)
manifest.json 802 records x 51 fields (see below)
manifest.csv the same, tabular
splits_5fold.json patient-level 5-fold CV + test holdout (schema v4)
dataset_labels.json id -> name, with per-class notes
label_occupancy.json how many cases actually carry each id
lstv_phenotypes.csv the 33 expert Castellvi gradings, with notes
hardware_qc.csv per-case instrumentation review outcome
s1_carve_qc.csv per-case S1 cut geometry + implausible-fraction flag
dataset_interface.py loader (directory-backed + PyTorch adapter)
CITATION.cff citation metadata
LICENSE Apache-2.0 (applies to the code; see Licensing)
Filenames are self-describing
fused ct/<id>_ct.nii.gz labels/<id>_label.nii.gz
spine-side ct/<id>_spine_ct.nii.gz labels/<id>_spine_label.nii.gz
pelvic-side ct/<id>_pelvic_ct.nii.gz labels/<id>_pelvic_label.nii.gz
A bare <id>_ct.nii.gz therefore unambiguously means a fused case — spine and pelvis in one
mask. ct_file and label_file in the manifest carry the subdirectory prefix, so
root / rec["ct_file"] resolves directly.
Labels — VerSe-native scheme
The spine keeps its VerSe ids verbatim (C1–C7 = 1–7, T1–T12 = 8–19, L1–L6 = 20–25,
sacrum = 26, coccyx = 27, T13 = 28); every non-VerSe structure takes a fixed id above the
VerSe range. dataset_labels.json is the machine-readable source of truth.
cases below is measured, not declared — it is the number of the 802 volumes that
actually contain at least one voxel of that id (label_occupancy.json).
| id | class | source | cases (of 802) |
|---|---|---|---|
| 1–7 | C1–C7 | CTSpine1K (VerSe 1–7) | 0–2 |
| 8–18 | T1–T11 | CTSpine1K (VerSe 8–18) | 0–798 |
| 19 | T12 — rostral counting anchor | CTSpine1K (VerSe 19) | 801 |
| 20 | L1 | CTSpine1K (VerSe 20) | 802 |
| 21 | L2 | CTSpine1K (VerSe 21) | 802 |
| 22 | L3 | CTSpine1K (VerSe 22) | 802 |
| 23 | L4 | CTSpine1K (VerSe 23) | 802 |
| 24 | L5 | CTSpine1K (VerSe 24) | 793 |
| 25 | L6 / LSTV | CTSpine1K (VerSe 25) — lumbarized S1 | 18 |
| 26 | sacrum | CTPelvic1K (dataset2 1 → 26) | 802 |
| 27 | coccyx | CTSpine1K (VerSe 27) | 0 — declared, unused |
| 28 | T13 — supernumerary thoracic | CTSpine1K (VerSe 28) | 0 — declared, unused |
| 29 | S1 — caudal counting anchor | planar cut of the GT sacrum | 801 |
| 30–31 | left_hip / right_hip | CTPelvic1K (dataset2 2,3 → 30,31) | 802 |
| 32–33 | femur_left / femur_right | TotalSegmentator | 802 |
| 34–45 | rib_left_1 … rib_left_12 | numbered off GT thoracic column | 0–802 |
| 46–57 | rib_right_1 … rib_right_12 | numbered off GT thoracic column | 0–802 |
| 58–59 | rib_left_lumbar / rib_right_lumbar | a rib on a lumbar vertebra | 13–16 |
| 60 | hardware — subtype not distinguished | radiologist-confirmed | 0 |
| 61 | hardware_cage | radiologist-confirmed | 1 |
| 62 | hardware_screw_rod | radiologist-confirmed | 0 |
| 63 | hardware_plate | radiologist-confirmed | 0 |
| 64 | hardware_arthroplasty — replaces a joint | radiologist-confirmed | 8 |
| 65 | hardware_si_screw | radiologist-confirmed | 1 |
| 66 | hardware_osteosynthesis — same bone | radiologist-confirmed | 1 |
CTPelvic1K's sacrum takes priority over CTSpine1K's (VerSe 26) so the two conventions cannot collide on a transitional vertebra.
Five things in that table are worth reading twice:
- The identifier space is contiguous, 0–66, and bone-and-hardware only (v9). Through
v8 the lumbar ribs were 74–75 and the hardware 76–82, above a never-populated block
reserved for soft tissue, and a
255sentinel was declared and never used; v9 renumbers the two blocks to 58–59 and 60–66 and drops the sentinel. No voxel changed class. The remap isOLD_TO_NEW_V9inscripts/label_scheme.py. Six ids are declared and carry no voxel: 27 (coccyx), 28 (T13), 60, 62, 63 and the cervical/upper-thoracic levels the field of view never reaches. Readlabel_occupancy.jsonbefore you build a class list. - The thoracic column and rib cage are FOV-limited. These are abdominopelvic acquisitions. T12 appears in 801 of 802 volumes, T10 in 765, T8 in 545, T5 in 34 — and ribs 1 and 2 never appear at all, rib 3 in 5 cases. The id range is not the per-case extent. Check the volume, not the scheme.
- A few ids carry only speckle. C1 appears in 2 cases totalling 2 voxels, C6 in 1 case (109 voxels), T3 in 1 case (63 voxels). These are stray voxels at the edge of the field of view, not usable cervical annotation. Treat any class under a few hundred voxels as absent.
rib_left_lumbar/rib_right_lumbar(58, 59) are a rib articulating with a lumbar vertebra — 13 and 16 cases. They get their own class rather than being forced to be "rib 12", because a thirteenth rib is a finding in its own right, and numbering it as the twelfth consumes the id the T12 rib needs. This is the rib-side signature of transitional anatomy.- Hardware (60–66) outranks bone. Where an implant lay inside a vertebra, hip or femur label, the voxel belongs to the implant.
The S1 carve
S1 (id 29) is the caudal counting anchor and the endplate landmark for sacral slope and
pelvic incidence, so how the sacrum is divided is a measurement decision rather than a
cosmetic one.
How it is defined. The sacrum's outer boundary is radiologist ground truth and is never altered. S1 is the cranial slab of that bone, cut by a plane:
- the plane's normal is the sacrum's own cranio-caudal axis — the principal component most aligned with superior–inferior, not a voxel axis, because the sacrum is nearly as wide as it is tall;
- that axis is made orthogonal to the patient's left–right axis, measured as the normal of the sacrum's best mirror-symmetry plane, so scanner roll does not tilt the cut;
- the level is set so S1 keeps the volume the underlying TotalSegmentator
vertebrae_S1intersection gave it.
Why it changed. Earlier releases took S1 as (GT sacrum) ∩ (TS vertebrae_S1) directly.
That boundary is the edge of a network's blob rather than a plane: it wandered, it was
unstable between identical runs — one case produced 190,451 and 103,467 voxels on two runs of
the same code — and it inherited scanner roll, which across this corpus has a median of
4.5° and reaches 16.1°, with 508 of 801 records rolled more than 3°. Read against the
sacral foramina, the old cut ran tangential on one side while leaving clearance on the other.
Per-case geometry ships in s1_carve_qc.csv. Across the 801 records with both a sacrum
and an S1:
| mirror-symmetry Dice, before → after | 0.807 → 0.906 |
| planarity of the new boundary (0 = perfectly flat) | median 0.004 |
| ant-post tilt (follows sacral slope) | median 38.2°, IQR 32.9–41.8° |
| S1 volume change | 0 voxels, in every record |
Because volume is preserved exactly, this changes the shape and orientation of the S1/S2 boundary, not how much of the sacrum is called S1.
Known limitation — pre-existing, not introduced by the recarve. In 100 records the inherited S1 occupies more than half the sacrum, or under 15% of it, and no first sacral segment does either. Those are flagged
implausible_fractionins1_carve_qc.csv. The volume comes from TotalSegmentator, and correcting it is a radiologist's judgement rather than a heuristic's, so it is reported rather than silently adjusted. If you are computing sacral slope or pelvic incidence, filter on that column.
LSTV, and how it is graded
Transitional status is read independently from both ends, so the two signals can be compared rather than blended:
| field | meaning |
|---|---|
lstv_vertebral |
from counting lumbar labels in CTSpine1K GT (4 → sacralization, 5 → normal, 6 → lumbarization) |
lstv_pelvic |
from the CTPelvic1K filename qualifier |
lstv_agreement |
True when both agree, False when they disagree, None when either is uninformative |
lstv_confusion_zone |
True at the sacralization ↔ lumbarization boundary, flagged for audit |
lstv_class |
0 = normal, 1 = lumbarization, 2 = semi-sacralization, 3 = sacralization |
castellvi_type |
expert Castellvi grade (Ia/Ib/IIa/IIb/IIIa/IIIb/IV) |
castellvi_second_read |
independent second read, where one was done |
castellvi_agreement |
exact agreement between the two reads |
castellvi_notes |
the reader's free text (e.g. "IIa on right and IIIa on left") |
lstv_phenotype |
the reader's phenotype call, independent of lstv_class |
non_rib_bearing_vertebrae |
the reader's count (4, 5 or 6) |
The vertebral calls match CTSpine1K's published cohort case-for-case (16 lumbarizations + 9 sacralizations on COLONOG); 8 further sacralization / semi-sacralization cases come from the CTPelvic1K pelvic annotations. 33 cases carry an expert Castellvi grade, of which 5 were independently double-read (3 of 5 in exact agreement on type — Castellvi typing is genuinely hard at the Ib/IIb and IIIa/IIIb boundaries, and this number is reported rather than smoothed).
Known discrepancy, deliberately not patched. Two cases (tokens
22and120) carry a radiologist phenotype of semi-sacralization butlstv_class == 0(normal), and no record in this release carrieslstv_class == 2even though the value is defined. The automatic class is derived from lumbar-label counting, which does not see a partial unilateral transition. The expert grade is shipped alongside rather than overwriting the derived class, and these are queued for re-read. If you are studying semi-sacralization, filter oncastellvi_type/lstv_phenotype, not onlstv_class.
Surgical instrumentation
Identifiers 60–66 name instrumentation: generic (60), cage (61), screw and rod (62), plate (63), arthroplasty (64), sacroiliac screw (65) and osteosynthesis (66).
11 of the 802 records carry instrumentation. In every one, the metal had been absorbed into the bone label beside it — a segmenter handed a bright object against a cortical surface takes it for bone — so naming the implant reclaims voxels rather than adding them: 1,538,852 across the eleven.
| id | class | cases |
|---|---|---|
| 64 | hardware_arthroplasty |
8 |
| 66 | hardware_osteosynthesis |
1 |
| 65 | hardware_si_screw |
1 |
| 61 | hardware_cage |
1 |
64 and 66 are the two arms of one clinical decision and must not be confused. Osteosynthesis (66) holds parts of the same bone together; arthroplasty (64) replaces a joint. Fixation leaves the patient's own femoral head; a prosthesis does not. Pelvic incidence and pelvic tilt are measured from that head, so in 9 cases the landmark is an implant, and any spinopelvic parameter computed from them was measured on metal.
Why this matters for the transitional-anatomy use case. An iatrogenic fusion is
indistinguishable from a congenital one to a distance measurement: a cage-bridged interspace
reads as "no gap" exactly as a congenitally fused transitional vertebra does. Filter on
hardware_labelled before running any gap-based analysis.
Detection is not the hard part; interpretation is. A threshold at 1800 HU flags 84
records. At 2500 HU — the lower of the two values validated in the metal-segmentation
literature — 52 keep a component above a 40-voxel floor. A radiologist read all 52 and
confirmed 11, rejecting 41 as contrast, calcification and reconstruction artefact. True
prevalence is 1.4%, not 10.5%. Saturation does not separate the two: both groups reach the
3071 HU scanner ceiling, and 4 rejected proposals exceed it, peaking at 11,798 HU — values
above the ceiling being reconstruction overshoot, not denser metal. Per-case outcomes are in
hardware_qc.csv.
Cohort and acquisition
Per-case metadata in manifest.json (51 fields). Beyond the label and LSTV fields:
| Demographics | age (709/802), age_band, sex (749/802) |
| Acquisition | manufacturer, manufacturer_model, kvp, slice_thickness, convolution_kernel, position |
| Origin | prov_spine, prov_pelvis (manual vs pseudo), spine_series_uid, pelvic_series_uid |
| Geometry QC | alignment_ok, ct_resampled_to_mask, spine_bone_pct, pelvic_bone_pct |
position is prone 377 / supine 422 / decubitus 3. It rides in the manifest, not in the
filename — the prone/supine classifier rarely succeeded, and config is what downstream
consumers actually filter on.
Record types
config |
n | meaning |
|---|---|---|
fused |
342 | both masks on the same series; spine + sacrum + hips present |
spine_only |
440 | lumbar labels only; sacrum/hips absent or pseudolabelled |
pelvic_native |
20 | sacrum + hip labels only; lumbar absent |
match_type |
n | meaning |
|---|---|---|
fused |
342 | spine + pelvic masks land on the same TCIA series |
separate |
351 | they target different series; the patient appears twice |
spine_only |
89 | only a spine mask exists |
pelvic_only |
20 | only a pelvic mask exists |
separatecases share a patient across two records. Any split you make yourself must be patient-level, not record-level, or the same patient lands in train and test. The shipped splits already handle this.
Splits
splits_5fold.json (schema v4): patient-level stratified 5-fold CV with a held-out test set.
Patients are binned by <lstv_subtype>|<match_type>; rare buckets coalesce by dropping the
match_type qualifier first, so the LSTV signal survives. Generation asserts
patient-level disjointness, fold coverage, no train/test overlap, and ≥3 lumbarization cases
in every fold's validation split — without which a fold can score well while never having
been asked the question the dataset exists to pose.
Limitations
- The pelvis is pseudolabelled on
spine_onlyrecords.prov_pelvissays which. Quality is reported as held-out Dice on thepelvic_nativescans. Never treat apseudopelvis as ground truth for evaluation. - The thoracic column is FOV-limited (~T8 down on most scans). See the labels section.
lstv_classhas no value 2, and disagrees with the expert grade on two cases. See the LSTV section.- Case
1035: the sacroiliac screws cross the joint and leave both hip labels genuinely fragmented — the largest connected component holds 66% and 84%. Recorded rather than repaired, because the fragmentation is anatomically real. - 351 separate-mode pelvic acquisitions are held out by design and are not part of the 802.
- Single source cohort. All imaging is CT colonography from one TCIA collection: supine and prone abdominopelvic scans of a screening population. It is not a trauma, paediatric, or deformity cohort, and generalisation beyond that has not been established here.
- Research use only. Not a medical device; not for clinical decision-making.
Citation
Please cite this dataset and all three source datasets.
@misc{ctspinopelvic1k,
title = {{CTSpinoPelvic1K}: A CT-Native Benchmark for Lumbosacral
Transitional Vertebra Segmentation},
author = {Schwing, Gregory and the OpenSpine Consortium},
year = {2026},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/datasets/OpenSpineConsortium/CTSpinoPelvic1K}},
}
@misc{smith2015ctcolonography,
author = {Smith, K. and Clark, K. and Bennett, W. and Nolan, T. and
Kirby, J. and Wolfsberger, M. and Moulton, J. and
Vendt, B. and Freymann, J.},
title = {Data From CT COLONOGRAPHY},
year = {2015},
publisher = {The Cancer Imaging Archive},
doi = {10.7937/K9/TCIA.2015.NWTESAY1},
}
@article{deng2021ctspine1k,
title = {{CTSpine1K}: A Large-Scale Dataset for Spinal Vertebrae Segmentation
in Computed Tomography},
author = {Deng, Yang and Wang, Ce and Hui, Yuan and Li, Qian and Li, Jun and
Luo, Shiwei and Sun, Mengke and Quan, Quan and Yang, Shuxin and
Hao, You and Liu, Pengbo and Xiao, Honghu and Zhao, Chunpeng and
Wu, Xinbao and Zhou, S. Kevin},
journal = {Machine Learning for Biomedical Imaging},
volume = {3},
pages = {824--832},
year = {2021},
doi = {10.59275/j.melba.2025-gf84},
}
@article{liu2021ctpelvic1k,
title = {Deep Learning to Segment Pelvic Bones: Large-Scale {CT} Datasets and
Baseline Models},
author = {Liu, Pengbo and Han, Hu and Du, Yuanqi and Zhu, Heqin and Li, Yinhao and
Gu, Feng and Xiao, Honghu and Li, Jun and Zhao, Chunpeng and Xiao, Li and
Wu, Xinbao and Zhou, S. Kevin},
journal = {International Journal of Computer Assisted Radiology and Surgery},
volume = {16},
pages = {749--756},
year = {2021},
}
Licensing
Two licences apply, to two different things:
- The labels, splits and metadata in this repository: CC BY-NC 4.0 (non-commercial). This is the licence declared in the card metadata and it governs the data you download here.
- The code —
dataset_interface.pyand the build pipeline in the project repository — Apache-2.0, per the shippedLICENSEandNOTICE.
The source datasets retain their own licences, and they bind you independently of the above: CT COLONOGRAPHY (TCIA), CTSpine1K, and CTPelvic1K. Check each before redistribution or any commercial use.
Research use only. These labels are not a medical device and must not be used for clinical decision-making.
Maintainers
Published by the OpenSpine Consortium. Corrections, disagreements with a grade, and re-read requests are welcome — open a discussion on this repository.
- Downloads last month
- 58