Datasets:
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: UnexpectedError
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.
token string | position string | config string | match_type string | lstv_label string | ok bool | error null | alignment_ok bool | has_l6 bool | n_lumbar_labels int64 | ct_file string | label_file string | qc_file string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | unknown | fused | fused | normal | true | null | true | false | 5 | 0005_unknown_ct.nii.gz | 0005_unknown_label.nii.gz | 0005_unknown_qc.png |
15 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0015_unknown_pelvic_ct.nii.gz | 0015_unknown_pelvic_label.nii.gz | 0015_unknown_pelvic_qc.png |
9 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0009_unknown_pelvic_ct.nii.gz | 0009_unknown_pelvic_label.nii.gz | 0009_unknown_pelvic_qc.png |
7 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0007_unknown_spine_ct.nii.gz | 0007_unknown_spine_label.nii.gz | 0007_unknown_spine_qc.png |
19 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0019_unknown_pelvic_ct.nii.gz | 0019_unknown_pelvic_label.nii.gz | 0019_unknown_pelvic_qc.png |
7 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0007_unknown_pelvic_ct.nii.gz | 0007_unknown_pelvic_label.nii.gz | 0007_unknown_pelvic_qc.png |
18 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0018_unknown_spine_ct.nii.gz | 0018_unknown_spine_label.nii.gz | 0018_unknown_spine_qc.png |
12 | unknown | spine_only | spine_only | normal | true | null | true | false | 5 | 0012_unknown_ct.nii.gz | 0012_unknown_label.nii.gz | 0012_unknown_qc.png |
15 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0015_unknown_spine_ct.nii.gz | 0015_unknown_spine_label.nii.gz | 0015_unknown_spine_qc.png |
1 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0001_unknown_pelvic_ct.nii.gz | 0001_unknown_pelvic_label.nii.gz | 0001_unknown_pelvic_qc.png |
4 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0004_unknown_pelvic_ct.nii.gz | 0004_unknown_pelvic_label.nii.gz | 0004_unknown_pelvic_qc.png |
18 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0018_unknown_pelvic_ct.nii.gz | 0018_unknown_pelvic_label.nii.gz | 0018_unknown_pelvic_qc.png |
6 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0006_unknown_pelvic_ct.nii.gz | 0006_unknown_pelvic_label.nii.gz | 0006_unknown_pelvic_qc.png |
6 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0006_unknown_spine_ct.nii.gz | 0006_unknown_spine_label.nii.gz | 0006_unknown_spine_qc.png |
21 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0021_unknown_spine_ct.nii.gz | 0021_unknown_spine_label.nii.gz | 0021_unknown_spine_qc.png |
4 | unknown | spine_only | separate | normal | true | null | true | true | 6 | 0004_unknown_spine_ct.nii.gz | 0004_unknown_spine_label.nii.gz | 0004_unknown_spine_qc.png |
21 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0021_unknown_pelvic_ct.nii.gz | 0021_unknown_pelvic_label.nii.gz | 0021_unknown_pelvic_qc.png |
11 | unknown | spine_only | spine_only | normal | true | null | true | false | 5 | 0011_unknown_ct.nii.gz | 0011_unknown_label.nii.gz | 0011_unknown_qc.png |
2 | unknown | fused | fused | normal | true | null | true | false | 5 | 0002_unknown_ct.nii.gz | 0002_unknown_label.nii.gz | 0002_unknown_qc.png |
17 | unknown | fused | fused | normal | true | null | true | false | 5 | 0017_unknown_ct.nii.gz | 0017_unknown_label.nii.gz | 0017_unknown_qc.png |
9 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0009_unknown_spine_ct.nii.gz | 0009_unknown_spine_label.nii.gz | 0009_unknown_spine_qc.png |
20 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0020_unknown_pelvic_ct.nii.gz | 0020_unknown_pelvic_label.nii.gz | 0020_unknown_pelvic_qc.png |
8 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0008_unknown_spine_ct.nii.gz | 0008_unknown_spine_label.nii.gz | 0008_unknown_spine_qc.png |
13 | unknown | fused | fused | normal | true | null | true | false | 5 | 0013_unknown_ct.nii.gz | 0013_unknown_label.nii.gz | 0013_unknown_qc.png |
14 | unknown | fused | fused | normal | true | null | true | false | 5 | 0014_unknown_ct.nii.gz | 0014_unknown_label.nii.gz | 0014_unknown_qc.png |
8 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0008_unknown_pelvic_ct.nii.gz | 0008_unknown_pelvic_label.nii.gz | 0008_unknown_pelvic_qc.png |
23 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0023_unknown_pelvic_ct.nii.gz | 0023_unknown_pelvic_label.nii.gz | 0023_unknown_pelvic_qc.png |
22 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0022_unknown_pelvic_ct.nii.gz | 0022_unknown_pelvic_label.nii.gz | 0022_unknown_pelvic_qc.png |
1 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0001_unknown_spine_ct.nii.gz | 0001_unknown_spine_label.nii.gz | 0001_unknown_spine_qc.png |
3 | unknown | fused | fused | normal | true | null | true | false | 5 | 0003_unknown_ct.nii.gz | 0003_unknown_label.nii.gz | 0003_unknown_qc.png |
19 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0019_unknown_spine_ct.nii.gz | 0019_unknown_spine_label.nii.gz | 0019_unknown_spine_qc.png |
26 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0026_unknown_spine_ct.nii.gz | 0026_unknown_spine_label.nii.gz | 0026_unknown_spine_qc.png |
26 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0026_unknown_pelvic_ct.nii.gz | 0026_unknown_pelvic_label.nii.gz | 0026_unknown_pelvic_qc.png |
20 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0020_unknown_spine_ct.nii.gz | 0020_unknown_spine_label.nii.gz | 0020_unknown_spine_qc.png |
28 | unknown | fused | fused | normal | true | null | true | false | 5 | 0028_unknown_ct.nii.gz | 0028_unknown_label.nii.gz | 0028_unknown_qc.png |
16 | unknown | spine_only | spine_only | normal | true | null | true | false | 5 | 0016_unknown_ct.nii.gz | 0016_unknown_label.nii.gz | 0016_unknown_qc.png |
27 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0027_unknown_spine_ct.nii.gz | 0027_unknown_spine_label.nii.gz | 0027_unknown_spine_qc.png |
25 | unknown | fused | fused | normal | true | null | true | false | 5 | 0025_unknown_ct.nii.gz | 0025_unknown_label.nii.gz | 0025_unknown_qc.png |
27 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0027_unknown_pelvic_ct.nii.gz | 0027_unknown_pelvic_label.nii.gz | 0027_unknown_pelvic_qc.png |
30 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0030_unknown_pelvic_ct.nii.gz | 0030_unknown_pelvic_label.nii.gz | 0030_unknown_pelvic_qc.png |
30 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0030_unknown_spine_ct.nii.gz | 0030_unknown_spine_label.nii.gz | 0030_unknown_spine_qc.png |
23 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0023_unknown_spine_ct.nii.gz | 0023_unknown_spine_label.nii.gz | 0023_unknown_spine_qc.png |
24 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0024_unknown_pelvic_ct.nii.gz | 0024_unknown_pelvic_label.nii.gz | 0024_unknown_pelvic_qc.png |
33 | unknown | fused | fused | normal | true | null | true | false | 5 | 0033_unknown_ct.nii.gz | 0033_unknown_label.nii.gz | 0033_unknown_qc.png |
24 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0024_unknown_spine_ct.nii.gz | 0024_unknown_spine_label.nii.gz | 0024_unknown_spine_qc.png |
22 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0022_unknown_spine_ct.nii.gz | 0022_unknown_spine_label.nii.gz | 0022_unknown_spine_qc.png |
10 | unknown | fused | fused | normal | true | null | true | false | 5 | 0010_unknown_ct.nii.gz | 0010_unknown_label.nii.gz | 0010_unknown_qc.png |
34 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0034_unknown_pelvic_ct.nii.gz | 0034_unknown_pelvic_label.nii.gz | 0034_unknown_pelvic_qc.png |
34 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0034_unknown_spine_ct.nii.gz | 0034_unknown_spine_label.nii.gz | 0034_unknown_spine_qc.png |
37 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0037_unknown_pelvic_ct.nii.gz | 0037_unknown_pelvic_label.nii.gz | 0037_unknown_pelvic_qc.png |
35 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0035_unknown_spine_ct.nii.gz | 0035_unknown_spine_label.nii.gz | 0035_unknown_spine_qc.png |
35 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0035_unknown_pelvic_ct.nii.gz | 0035_unknown_pelvic_label.nii.gz | 0035_unknown_pelvic_qc.png |
42 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0042_unknown_spine_ct.nii.gz | 0042_unknown_spine_label.nii.gz | 0042_unknown_spine_qc.png |
37 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0037_unknown_spine_ct.nii.gz | 0037_unknown_spine_label.nii.gz | 0037_unknown_spine_qc.png |
32 | unknown | fused | fused | normal | true | null | true | false | 5 | 0032_unknown_ct.nii.gz | 0032_unknown_label.nii.gz | 0032_unknown_qc.png |
39 | unknown | fused | fused | normal | true | null | true | false | 5 | 0039_unknown_ct.nii.gz | 0039_unknown_label.nii.gz | 0039_unknown_qc.png |
43 | unknown | fused | fused | normal | true | null | true | false | 5 | 0043_unknown_ct.nii.gz | 0043_unknown_label.nii.gz | 0043_unknown_qc.png |
31 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0031_unknown_pelvic_ct.nii.gz | 0031_unknown_pelvic_label.nii.gz | 0031_unknown_pelvic_qc.png |
44 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0044_unknown_pelvic_ct.nii.gz | 0044_unknown_pelvic_label.nii.gz | 0044_unknown_pelvic_qc.png |
41 | unknown | fused | fused | normal | true | null | true | false | 5 | 0041_unknown_ct.nii.gz | 0041_unknown_label.nii.gz | 0041_unknown_qc.png |
42 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0042_unknown_pelvic_ct.nii.gz | 0042_unknown_pelvic_label.nii.gz | 0042_unknown_pelvic_qc.png |
38 | unknown | fused | fused | normal | true | null | true | false | 5 | 0038_unknown_ct.nii.gz | 0038_unknown_label.nii.gz | 0038_unknown_qc.png |
31 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0031_unknown_spine_ct.nii.gz | 0031_unknown_spine_label.nii.gz | 0031_unknown_spine_qc.png |
46 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0046_unknown_spine_ct.nii.gz | 0046_unknown_spine_label.nii.gz | 0046_unknown_spine_qc.png |
40 | unknown | fused | fused | normal | true | null | true | false | 5 | 0040_unknown_ct.nii.gz | 0040_unknown_label.nii.gz | 0040_unknown_qc.png |
36 | unknown | fused | fused | normal | true | null | true | false | 5 | 0036_unknown_ct.nii.gz | 0036_unknown_label.nii.gz | 0036_unknown_qc.png |
47 | unknown | fused | fused | normal | true | null | true | false | 5 | 0047_unknown_ct.nii.gz | 0047_unknown_label.nii.gz | 0047_unknown_qc.png |
48 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0048_unknown_spine_ct.nii.gz | 0048_unknown_spine_label.nii.gz | 0048_unknown_spine_qc.png |
50 | unknown | fused | fused | normal | true | null | true | false | 5 | 0050_unknown_ct.nii.gz | 0050_unknown_label.nii.gz | 0050_unknown_qc.png |
29 | unknown | fused | fused | normal | true | null | true | false | 5 | 0029_unknown_ct.nii.gz | 0029_unknown_label.nii.gz | 0029_unknown_qc.png |
48 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0048_unknown_pelvic_ct.nii.gz | 0048_unknown_pelvic_label.nii.gz | 0048_unknown_pelvic_qc.png |
49 | unknown | fused | fused | normal | true | null | true | false | 5 | 0049_unknown_ct.nii.gz | 0049_unknown_label.nii.gz | 0049_unknown_qc.png |
45 | unknown | fused | fused | normal | true | null | true | false | 5 | 0045_unknown_ct.nii.gz | 0045_unknown_label.nii.gz | 0045_unknown_qc.png |
46 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0046_unknown_pelvic_ct.nii.gz | 0046_unknown_pelvic_label.nii.gz | 0046_unknown_pelvic_qc.png |
51 | unknown | fused | fused | normal | true | null | true | false | 5 | 0051_unknown_ct.nii.gz | 0051_unknown_label.nii.gz | 0051_unknown_qc.png |
53 | unknown | fused | fused | normal | true | null | true | false | 5 | 0053_unknown_ct.nii.gz | 0053_unknown_label.nii.gz | 0053_unknown_qc.png |
44 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0044_unknown_spine_ct.nii.gz | 0044_unknown_spine_label.nii.gz | 0044_unknown_spine_qc.png |
54 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0054_unknown_spine_ct.nii.gz | 0054_unknown_spine_label.nii.gz | 0054_unknown_spine_qc.png |
57 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0057_unknown_spine_ct.nii.gz | 0057_unknown_spine_label.nii.gz | 0057_unknown_spine_qc.png |
59 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0059_unknown_pelvic_ct.nii.gz | 0059_unknown_pelvic_label.nii.gz | 0059_unknown_pelvic_qc.png |
64 | unknown | spine_only | spine_only | normal | true | null | true | false | 4 | 0064_unknown_ct.nii.gz | 0064_unknown_label.nii.gz | 0064_unknown_qc.png |
62 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0062_unknown_spine_ct.nii.gz | 0062_unknown_spine_label.nii.gz | 0062_unknown_spine_qc.png |
52 | unknown | fused | fused | normal | true | null | true | false | 5 | 0052_unknown_ct.nii.gz | 0052_unknown_label.nii.gz | 0052_unknown_qc.png |
60 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0060_unknown_pelvic_ct.nii.gz | 0060_unknown_pelvic_label.nii.gz | 0060_unknown_pelvic_qc.png |
55 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0055_unknown_spine_ct.nii.gz | 0055_unknown_spine_label.nii.gz | 0055_unknown_spine_qc.png |
59 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0059_unknown_spine_ct.nii.gz | 0059_unknown_spine_label.nii.gz | 0059_unknown_spine_qc.png |
61 | unknown | pelvic_native | pelvic_only | normal | true | null | true | false | 0 | 0061_unknown_ct.nii.gz | 0061_unknown_label.nii.gz | 0061_unknown_qc.png |
62 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0062_unknown_pelvic_ct.nii.gz | 0062_unknown_pelvic_label.nii.gz | 0062_unknown_pelvic_qc.png |
55 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0055_unknown_pelvic_ct.nii.gz | 0055_unknown_pelvic_label.nii.gz | 0055_unknown_pelvic_qc.png |
63 | unknown | fused | fused | normal | true | null | true | false | 5 | 0063_unknown_ct.nii.gz | 0063_unknown_label.nii.gz | 0063_unknown_qc.png |
57 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0057_unknown_pelvic_ct.nii.gz | 0057_unknown_pelvic_label.nii.gz | 0057_unknown_pelvic_qc.png |
84 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0084_unknown_spine_ct.nii.gz | 0084_unknown_spine_label.nii.gz | 0084_unknown_spine_qc.png |
56 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0056_unknown_pelvic_ct.nii.gz | 0056_unknown_pelvic_label.nii.gz | 0056_unknown_pelvic_qc.png |
72 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0072_unknown_spine_ct.nii.gz | 0072_unknown_spine_label.nii.gz | 0072_unknown_spine_qc.png |
67 | unknown | spine_only | separate | normal | true | null | true | true | 6 | 0067_unknown_spine_ct.nii.gz | 0067_unknown_spine_label.nii.gz | 0067_unknown_spine_qc.png |
67 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0067_unknown_pelvic_ct.nii.gz | 0067_unknown_pelvic_label.nii.gz | 0067_unknown_pelvic_qc.png |
68 | unknown | fused | fused | normal | true | null | true | false | 5 | 0068_unknown_ct.nii.gz | 0068_unknown_label.nii.gz | 0068_unknown_qc.png |
54 | unknown | pelvic_native | separate | normal | true | null | true | false | 0 | 0054_unknown_pelvic_ct.nii.gz | 0054_unknown_pelvic_label.nii.gz | 0054_unknown_pelvic_qc.png |
60 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0060_unknown_spine_ct.nii.gz | 0060_unknown_spine_label.nii.gz | 0060_unknown_spine_qc.png |
74 | unknown | spine_only | separate | normal | true | null | true | false | 5 | 0074_unknown_spine_ct.nii.gz | 0074_unknown_spine_label.nii.gz | 0074_unknown_spine_qc.png |
CTSpinoPelvic1K
A large-scale CT dataset for unified lumbar spine and pelvis segmentation, with dedicated coverage of lumbosacral transitional vertebrae (LSTV).
Derived from CTSpine1K and CTPelvic1K, fused into a single 10-class label scheme and matched to original TCIA DICOM series using world-space affine registration. Every volume pair is guaranteed to be voxel-aligned with identical affines — no resampling needed at training time.
At a Glance
| Property | Value |
|---|---|
| Modality | CT (computed tomography) |
| Anatomy | Lumbar spine (L1–L6) + sacrum + bilateral hips |
| Label format | NIfTI-1 .nii.gz, integer labels, single file per case |
| Orientation | PIR — Posterior · Inferior · Right (canonical) |
| Voxel grid | Native TCIA DICOM resolution (typically 512×512×N, 0.625–0.977 mm in-plane, 0.8–1.0 mm slice) |
| Alignment | CT and label saved with identical affines — zero-cost overlay |
| LSTV coverage | Sacralization, lumbarization, and semi-LSTV cases explicitly labelled |
| Splits | 70/15/15 train/val/test, LSTV-stratified, seed-fixed |
| License | CC BY-NC 4.0 |
Label Scheme
Every label volume uses a unified 10-class integer scheme:
| Value | Structure | Notes |
|---|---|---|
0 |
Background | |
1 |
L1 | |
2 |
L2 | |
3 |
L3 | |
4 |
L4 | |
5 |
L5 | |
6 |
L6 | LSTV only — lumbarized S1 in lumbarization phenotype |
7 |
Sacrum | Pelvic sacrum label takes priority over spine sacrum |
8 |
Left hip | Ilium/acetabulum |
9 |
Right hip | Ilium/acetabulum |
LSTV note: In sacralization cases, L5 (class
5) is fused to the sacrum and no L6 exists. In lumbarization cases, the transitional segment is labeled L6 (class6). In both phenotypes, the sacrum (class7) is always present. Thehas_l6field in the manifest flags lumbarization cases explicitly.
Orientation
All volumes are stored in PIR orientation (Posterior–Inferior–Right):
Axis 0 → P (Posterior) — coronal axis
Axis 1 → I (Inferior) — axial/slice axis
Axis 2 → R (Right) — sagittal axis
This is the canonical orientation produced by nibabel's as_reoriented(). Tensor shape after loading is (P, I, R). When adding a channel dimension for a model: ct[None] → (1, P, I, R).
Repository Layout
CTSpinoPelvic1K/
├── ct/
│ ├── 0001_supine_ct.nii.gz
│ ├── 0002_supine_ct.nii.gz
│ └── ...
├── labels/
│ ├── 0001_supine_label.nii.gz
│ ├── 0002_supine_label.nii.gz
│ └── ...
├── manifest.json # per-case metadata (token, config, LSTV label, splits, etc.)
├── manifest.csv # same as manifest.json, CSV format
├── splits.json # train/val/test file lists (LSTV-stratified)
└── dataset_interface.py # self-contained Python interface (no extra dependencies)
QC figures (
qc/) are excluded from this repository to minimize download size. They can be regenerated locally usingexport_hf.py --skip_export --out_dir <path>.
Installation
pip install nibabel numpy huggingface_hub
# Optional: 3–5× faster downloads
pip install hf_transfer
No other dependencies are required to load and iterate the dataset. MONAI or PyTorch are only needed for the training helper functions.
Quick Start
Load from HuggingFace (recommended)
from dataset_interface import CTSpinoPelvic1K
# Download and load in one line
# Files are cached at ~/.cache/huggingface/datasets/CTSpinoPelvic1K
ds = CTSpinoPelvic1K.from_hub()
# Specify a custom local directory
ds = CTSpinoPelvic1K.from_hub(local_dir="/data/ctspinopelvic1k")
# Private or gated repo
ds = CTSpinoPelvic1K.from_hub(token="hf_xxx")
# or: export HF_TOKEN=hf_xxx
Load from a local export directory
from dataset_interface import CTSpinoPelvic1K
ds = CTSpinoPelvic1K("/data/ctspinopelvic1k")
print(ds.stats())
Load a single case
case = ds[0]
# Arrays — ct.shape == lbl.shape guaranteed
ct, lbl = case.load()
print(ct.shape, lbl.shape, ct.dtype, lbl.dtype)
# → (512, 512, 347) (512, 512, 347) float32 int16
# nibabel images (with affine)
ct_img, lbl_img = case.load_nib()
print(ct_img.affine)
Case Metadata
Each Case object exposes the following fields:
case.token # str — patient identifier (de-identified)
case.position # str — "supine" | "prone" | "unknown"
case.config # str — "fused" | "spine_only" | "pelvic_native"
case.match_type # str — original placement: "fused" | "separate" |
# "spine_only" | "pelvic_only"
case.lstv_label # str — "normal" | "sacralization" | "lumbarization" | "semi"
case.has_l6 # bool — True if L6 label present (lumbarization only)
case.n_lumbar_labels # int — number of lumbar classes present (1–6)
case.alignment_ok # bool — CT/label affine alignment check passed
case.is_lstv # bool — any LSTV phenotype
case.is_fused # bool — full 10-class ground truth available
case.ct_path # Path
case.label_path # Path
case.qc_path # Path | None (None when qc/ not present)
case.exists() # bool — both files present on disk
Filtering
# By export config
fused = ds.filter(config="fused") # full 10-class ground truth
spine_only = ds.filter(config="spine_only") # lumbar labels only
pelvic_native = ds.filter(config="pelvic_native") # sacrum + hip labels only
# By original placement match_type
# "separate" = spine and pelvic placed on DIFFERENT CTs (prone/supine mismatch)
# These export as two entries sharing the same patient token
separate = ds.filter(match_type="separate")
# By LSTV phenotype
lstv = ds.filter(lstv=True)
normal = ds.filter(lstv=False)
sacralization = ds.filter(lstv_class="sacralization")
lumbarization = ds.filter(lstv_class="lumbarization")
semi = ds.filter(lstv_class="semi")
# Combined filters
fused_lstv = ds.filter(config="fused", lstv=True)
fused_sacral = ds.filter(config="fused", lstv_class="sacralization")
# Patient position
supine = ds.filter(position="supine")
prone = ds.filter(position="prone")
# Cases with L6 label (lumbarization)
has_l6 = ds.filter(has_l6=True)
# By patient token — returns all entries for one patient
patient_cases = ds.by_token("42")
# Exclude missing files (default: True)
present = ds.filter(config="fused", present_only=True)
Splits
Splits are 70/15/15 LSTV-stratified with a fixed random seed for reproducibility. Val and test contain fused cases only (full 10-class ground truth). Train contains fused + all partial cases.
train, val, test = ds.splits()
print(f"Train: {len(train)} Val: {len(val)} Test: {len(test)}")
# Inspect LSTV balance
from collections import Counter
print(Counter(c.lstv_label for c in test))
Training Integration
Phase 1 — Fused ground truth (full supervision)
from dataset_interface import CTSpinoPelvic1K, make_monai_datalist
from monai.data import CacheDataset, DataLoader
from monai.transforms import (
Compose, LoadImaged, EnsureChannelFirstd,
ScaleIntensityRanged, RandCropByPosNegLabeld,
RandFlipd, RandRotate90d, ToTensord,
)
ds = CTSpinoPelvic1K.from_hub()
train, val, _ = ds.splits()
# MONAI datalist: {"image": str, "label": str, "weight": float, "meta": dict}
train_list = make_monai_datalist(train, pseudo_weight=1.0)
transforms = Compose([
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys=["image", "label"]),
ScaleIntensityRanged(
keys=["image"], a_min=-175, a_max=250,
b_min=0.0, b_max=1.0, clip=True,
),
RandCropByPosNegLabeld(
keys=["image", "label"],
label_key="label", spatial_size=(96, 96, 96),
pos=1, neg=1, num_samples=4,
),
RandFlipd(keys=["image", "label"], prob=0.5, spatial_axis=0),
RandRotate90d(keys=["image", "label"], prob=0.5, max_k=3),
ToTensord(keys=["image", "label"]),
])
dataset = CacheDataset(train_list, transform=transforms, cache_rate=0.1)
dataloader = DataLoader(dataset, batch_size=2, shuffle=True, num_workers=4)
Phase 2 — Curriculum with pseudo-label partials
In Phase 2, partial cases (spine_only, pelvic_native) are included with a reduced loss weight to provide soft supervision for their labelled classes while ignoring unlabelled regions.
from dataset_interface import CTSpinoPelvic1K, make_monai_datalist
ds = CTSpinoPelvic1K.from_hub()
train, val, _ = ds.splits()
# All cases: fused get weight=1.0, partials get weight=0.5
phase2_list = make_monai_datalist(ds.all(), pseudo_weight=0.5)
# Access per-sample weight in your loss function
for sample in dataloader:
image = sample["image"] # (B, 1, P, I, R)
label = sample["label"] # (B, 1, P, I, R)
weight = sample["weight"] # (B,) — 1.0 for fused, 0.5 for partials
loss = criterion(pred, label)
loss = (loss * weight.view(-1, 1, 1, 1, 1)).mean()
loss.backward()
PyTorch Dataset (no MONAI)
from dataset_interface import CTSpinoPelvic1K, make_torch_dataset
import torch
from torch.utils.data import DataLoader
ds = CTSpinoPelvic1K.from_hub()
train, val, _ = ds.splits()
torch_ds = make_torch_dataset(train, pseudo_weight=0.5)
loader = DataLoader(torch_ds, batch_size=2, shuffle=True, num_workers=4)
for batch in loader:
image = batch["image"] # (B, 1, P, I, R) float32
label = batch["label"] # (B, 1, P, I, R) int64
weight = batch["weight"] # (B,) float32
meta = batch["meta"] # dict of per-sample metadata
Custom transforms
import torch
from monai.transforms import MapTransform
class MaskUnlabelledClasses(MapTransform):
"""
Zero-out classes not present in a partial case before computing loss.
Prevents the model from learning background for unlabelled regions.
"""
def __call__(self, data):
config = data["meta"]["config"]
label = data["label"]
if config == "spine_only":
# Mask out pelvic classes (7, 8, 9) — not labelled in this case
label[(label == 7) | (label == 8) | (label == 9)] = 0
elif config == "pelvic_native":
# Mask out lumbar classes (1–6) — not labelled in this case
label[(label >= 1) & (label <= 6)] = 0
data["label"] = label
return data
Evaluation
Evaluate a directory of predictions
from dataset_interface import (
CTSpinoPelvic1K,
evaluate_predictions,
print_results_table,
)
ds = CTSpinoPelvic1K.from_hub()
# Evaluate on fused test set (ground truth)
_, _, test = ds.splits()
results = evaluate_predictions(ds, pred_dir="data/predictions", subset=test)
print_results_table(results)
Output: ```
Evaluation (172 cases)
Mean DSC by class: L1 (1) 0.942 ████████████████████████████ L2 (2) 0.951 ████████████████████████████ L3 (3) 0.953 ████████████████████████████ L4 (4) 0.948 ████████████████████████████ L5 (5) 0.931 ███████████████████████████ L6 (6) 0.887 ██████████████████████████ sacrum (7) 0.912 ███████████████████████████ left_hip (8) 0.963 █████████████████████████████ right_hip (9) 0.961 █████████████████████████████
Junction DSC (L5/S1 ±40mm): 0.924
Mean DSC by LSTV class: SACRALIZATION L5=0.918 L6=nan sacrum=0.905 LUMBARIZATION L5=0.912 L6=0.887 sacrum=0.898 NORMAL L5=0.936 sacrum=0.917
### Evaluate LSTV subgroups separately
```python
# LSTV only
lstv_results = evaluate_predictions(
ds, pred_dir="data/predictions",
subset=ds.filter(config="fused", lstv=True),
)
# Sacralization specifically
sacral_results = evaluate_predictions(
ds, pred_dir="data/predictions",
subset=ds.filter(config="fused", lstv_class="sacralization"),
)
# Junction Dice — L5/sacrum boundary (clinically critical)
print(f"Junction DSC: {lstv_results['junction_dsc']:.3f}")
Score a single case
from dataset_interface import score_case, junction_dice, CLASS_NAMES
dsc = score_case(
pred_path="data/predictions/0001_supine_label.nii.gz",
gt_path="data/ctspinopelvic1k/labels/0001_supine_label.nii.gz",
)
for cls_id, dice in sorted(dsc.items()):
print(f" {CLASS_NAMES[cls_id]:12s} Dice={dice:.3f}")
# L5/S1 junction Dice (±40mm window)
jxn = junction_dice(
pred_path="data/predictions/0001_supine_label.nii.gz",
gt_path="data/ctspinopelvic1k/labels/0001_supine_label.nii.gz",
window_mm=40.0,
)
print(f"Junction DSC: {jxn}")
Dataset Statistics
ds = CTSpinoPelvic1K.from_hub()
print(ds.stats())
CTSpinoPelvic1K (/home/user/.cache/huggingface/datasets/CTSpinoPelvic1K)
Total cases : 1165
By config (export):
fused : 804
spine_only : 180
pelvic_native : 181
By match_type (original placement):
fused : 761
separate : 43 (prone/supine mismatch — 2 entries each)
spine_only : 137
pelvic_only : 138
LSTV total : 89 (7.6%)
Has L6 (lumbar.) : 41
LSTV breakdown : {'NORMAL': 1076, 'SACRALIZATION': 48, 'LUMBARIZATION': 41, ...}
Positions : {'supine': 1021, 'prone': 87, 'unknown': 57}
Alignment fails : 0
Train split : 901
Val split : 132 (fused only)
Test split : 132 (fused only)
Data Construction
CTSpinoPelvic1K was constructed from three public TCIA datasets:
| Source | Cohort | Cases | Content |
|---|---|---|---|
| CTSpine1K | COLONOG | ~1000 | Lumbar vertebrae (VerSe IDs 20–26) |
| CTPelvic1K | COLONOG + CTC | ~1000 | Sacrum + bilateral hips (4-class) |
| TCIA COLONOG/CTC | — | ~825 | Reference CT DICOM series |
Matching pipeline:
- Each CTSpine1K/CTPelvic1K mask is matched to the TCIA DICOM series that maximises bone coverage (HU > 200) under the placed label, via world-space affine nearest-neighbour resampling across all candidate series per patient.
- For patients where spine and pelvic masks land on the same series (
match_type=fused), a single merged 10-class label is produced. For patients where they land on different series — typically prone vs. supine acquisitions (match_type=separate) — two independent entries are created. - All label maps are remapped to the unified 10-class scheme, reoriented to PIR, and stripped of DICOM PHI.
Label merge priority:
Pelvic sacrum/hips are written first; lumbar classes L1–L6 overwrite; spine sacrum only fills background voxels. This ensures no lumbar label is lost in the junction region.
Separate Cases (Prone/Supine Mismatch)
match_type="separate" cases are patients for whom the spine CTSpine1K mask and the CTPelvic1K mask were registered to different CT acquisitions of the same patient (typically one supine, one prone). These cases export as two independent entries sharing the same token:
# Find all cases for a separate patient
separate_patients = {c.token for c in ds.filter(match_type="separate")}
# Inspect a specific patient's two entries
tok = list(separate_patients)[0]
for case in ds.by_token(tok):
print(f" {case.config:20s} pos={case.position} n_labels={case.n_lumbar_labels}")
# → spine_only pos=prone n_labels=5
# → pelvic_native pos=supine n_labels=0
These cases are valuable for multi-view / multi-position training, but val/test sets contain only fused cases for clean benchmark comparisons.
Manifest Fields
manifest.json is a list of records, one per case:
{
"token": "42",
"position": "supine",
"config": "fused",
"match_type": "fused",
"lstv_label": "sacralization",
"has_l6": false,
"n_lumbar_labels": 5,
"alignment_ok": true,
"ct_file": "0042_supine_ct.nii.gz",
"label_file": "0042_supine_label.nii.gz",
"qc_file": "0042_supine_qc.png"
}
Licence and Attribution
This dataset is released under CC BY-NC 4.0 (non-commercial research use).
It is derived from:
- CTSpine1K — Liu et al., 2021, CC BY 3.0
- CTPelvic1K — Liu et al., 2021, CC BY 3.0
- TCIA COLONOG — Clark et al., 2013, CC BY 3.0
- TCIA CTC — TCIA standard terms of use
If you use CTSpinoPelvic1K in your research, please cite:
@dataset{ctspinopelvic1k_2025,
title = {{CTSpinoPelvic1K}: A Unified CT Dataset for Lumbar Spine
and Pelvis Segmentation with {LSTV} Coverage},
author = {Anonymous},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/datasets/anonymous-mlhc/CTSpinoPelvic1K}
}
Please also cite the source datasets:
@article{liu2021ctspine1k,
title = {{CTSpine1K}: A Large-Scale Dataset for Spinal Vertebrae Segmentation in Diverse {CT} Scenarios},
author = {Liu, Yang and others},
journal = {arXiv preprint arXiv:2105.14711},
year = {2021}
}
@article{liu2021ctpelvic1k,
title = {{CTPelvic1K}: A Large-Scale Benchmark for Pelvic Bone Segmentation in {CT} Images},
author = {Liu, Yang and others},
journal = {arXiv preprint arXiv:2101.07011},
year = {2021}
}
Known Issues
- Token 85 — degenerate dcm2niix output (2-slice localizer series), excluded from the final dataset.
- A small number of
spine_onlyandpelvic_nativecases havealignment_ok=Falsedue to affine inconsistencies in the source TCIA DICOM series. These are filtered out by default inds.filter(aligned_only=True). - LSTV classification is derived from CTPelvic1K filename metadata and has not been independently verified by a radiologist for all cases. Use
lstv_labelas a weakly supervised signal, not a ground truth clinical diagnosis.
Contact
Dataset curation: anonymous submission. For issues with dataset loading or the interface script, open a discussion on the HuggingFace repository page.
- Downloads last month
- 1