PanSegData / README.md
Parth1503's picture
Upload dataset
a9d6ad6 verified
|
Raw
History Blame Contribute Delete
17.1 kB
---
license: cc-by-nc-4.0
task_categories:
- image-segmentation
tags:
- medical
- mri
- abdomen
- pancreas
- t1-weighted
- t2-weighted
- multi-center
- pansegdata
- pansegnet
pretty_name: PanSegData - Multi-center Abdominal MRI Pancreas Segmentation
size_categories:
- n<1K
configs:
- config_name: default
data_files:
- split: t1_train
path: data/t1_train-*
- split: t1_test
path: data/t1_test-*
- split: t2_train
path: data/t2_train-*
- split: t2_test
path: data/t2_test-*
dataset_info:
features:
- name: case_id
dtype: string
- name: modality
dtype: string
- name: center
dtype: string
- name: center_name
dtype: string
- name: split
dtype: string
- name: patient_uid
dtype: string
- name: paired_case_id
dtype: string
- name: image
dtype: image
- name: mask
dtype: image
- name: overlay
dtype: image
- name: slice_index
dtype: int32
- name: slice_selection
dtype: string
- name: n_slices
dtype: int32
- name: shape_xyz
dtype: string
- name: spacing_xyz
dtype: string
- name: slice_thickness_mm
dtype: float32
- name: axcodes_image
dtype: string
- name: axcodes_mask
dtype: string
- name: mask_affine_unreliable
dtype: bool
- name: fg_voxels
dtype: int64
- name: fg_fraction
dtype: float64
- name: n_fg_slices
dtype: int32
- name: fg_slice_fraction
dtype: float32
- name: gender
dtype: string
- name: age
dtype: int32
- name: mri_brand
dtype: string
- name: magnet_strength_t
dtype: float32
splits:
- name: t1_train
num_bytes: 30193255
num_examples: 313
- name: t1_test
num_bytes: 10035546
num_examples: 72
- name: t2_train
num_bytes: 32647077
num_examples: 312
- name: t2_test
num_bytes: 11753532
num_examples: 70
download_size: 84568706
dataset_size: 84629410
---
# PanSegData — Multi-center Abdominal MRI Pancreas Segmentation
**767 abdominal MRI volumes (385 T1W + 382 T2W) with manual pancreas masks**, collected
across **five US institutions** between March 2004 and November 2022 and released by the
Machine & Hybrid Intelligence Lab at Northwestern University. This is the MRI half of the
PanSegNet study, and it is one of the very few large, multi-center, *manually annotated*
pancreas MRI resources in existence.
The pancreas is among the hardest abdominal organs to segment — small, soft-tissue-isointense,
and highly variable in shape and position. Here the foreground is on average **0.44 % of voxels**.
## ⚠️ What this mirror contains — read first
> **MRI only. There is no CT here.** The paper is titled *"Large-scale multi-center **CT and
> MRI** segmentation of pancreas"*, but only the MRI is the authors' own releasable data.
> The paper's 1,350 CT scans are third-party public datasets (AbdomenCT-1K 1000, AMOS 200,
> WORD 120, BTCV 30) used only for benchmarking — they are not part of PanSegData and are not
> redistributed here. If you expected 2,117 volumes, you get **767**.
> **Do not join `t1` and `t2` by filename.** The two modalities were renumbered
> *independently*, so the same released id means **different patients** in 259 of the 370
> ids that exist in both. Use the `patient_uid` column. See
> [Cross-modality identity](#-cross-modality-identity-the-single-biggest-trap).
> **Do not reorient the masks by their own affine.** 66 of the 385 T1 masks carry a
> sign-flipped direction matrix. See [Mask affine defect](#-mask-affine-defect-66-t1-cases).
## Dataset Details
| Field | Value |
|---|---|
| Modality | Abdominal MRI — **T1-weighted (385)** and **T2-weighted (382)** |
| Body part | Abdomen — **pancreas**, single foreground class |
| Labels | `0` background · `1` pancreas (verified: the only values present in all 767 masks) |
| Patients | **405 distinct**, of whom **362 were imaged in both modalities** |
| Centers | 5 — NYU, Mayo Clinic Florida, Northwestern, Allegheny Health Network, Mayo Clinic Arizona |
| Acquisition window | March 2004 – November 2022 |
| Format | `.nii.gz` (NIfTI-1), nnU-Net v1 raw layout upstream |
| Geometry | **not resampled, not cropped, not co-registered** — native per-case |
| In-plane | 0.53 – 1.80 mm · **166 distinct shapes (T1)**, 165 (T2) |
| Slice thickness | **1.8 – 10.4 mm** — strongly anisotropic, typical 2D-acquired abdominal MRI |
| Slices per volume | 20 – 148 (T1), 20 – 102 (T2) |
| Foreground | **0.44 % of voxels**; present on only **~43.5 % of slices** |
| Empty masks | **none** — every one of the 767 volumes has annotated pancreas |
| License | **CC BY-NC 4.0** — redistribution explicitly permitted, non-commercial only |
| Paper | Zhang et al., *Medical Image Analysis* **99**:103382 (2025) · doi:10.1016/j.media.2024.103382 |
| Official source | https://osf.io/kysnj/ (author-controlled; md5s verified against the OSF API) |
### Per-center composition (matches paper Table 2 cell-for-cell)
| Center | Code | T1W | T2W | Split |
|---|---|---|---|---|
| NYU Medical Center | `NYU` | 162 | 162 | train |
| Mayo Clinic Florida | `MCF` | 151 | 150 | train |
| Northwestern University | `NWU` | 30 | 19 | test |
| Allegheny Health Network | `AHN` | 17 | 28 | test |
| Mayo Clinic Arizona | `MCA` | 25 | 23 | test |
| **Total** | | **385** | **382** | |
## Splits — center-based, and why it has to be
The official release has **no split file**: all 767 volumes ship under `imagesTr/` + `labelsTr/`.
This mirror materialises the **paper's own protocol** — centers 1–2 (NYU, Mayo FL) as the
internal cohort, centers 3–5 (NWU, AHN, MCA) held out as the external test set:
| Config | train | test | total |
|---|---|---|---|
| `t1` | 313 | 72 | 385 |
| `t2` | 312 | 70 | 382 |
This is not merely convention. **Center is a property of the patient**, so a center-based
split is automatically *patient-disjoint across modalities as well*. A random split would put
some of the 362 dual-modality patients in `t1/train` and their other scan in `t2/test`. The
`center` column is preserved so you can re-derive any other split, including the paper's
5-fold CV over the internal cohort.
## ⚠️ Cross-modality identity — the single biggest trap
The released ids (`NYU_0001`, `MCF_0042`, …) were assigned **independently per modality**.
Each excluded scan shifts every subsequent number, and the two modalities excluded different
scans (64 from T1, 58 from T2). Measured on this mirror:
| | |
|---|---|
| released ids present in both `t1` and `t2` | **370** |
| …that refer to the **same** patient | **111** |
| …that refer to a **different** patient | **259** |
Mismatches by center: NYU 158, MCF 48, NWU 19, AHN 17, MCA 17.
Example: `AHN_0001` is original `AHN05` in T1 but `ahn_02` in T2.
**Use `patient_uid`.** It is derived from the authors' official `T1-name_mapping.json` /
`T2-name_mapping.json` by folding case, separators and leading zeros
(`AHN05` and `ahn_05``ahn5`). Verified globally unique: **no original id is used by more
than one center**, and within a modality every patient contributes exactly one scan.
> A note for anyone comparing against other write-ups: **AHN *is* joinable across
> modalities.** T1 spells it `AHN05` and T2 spells it `ahn_05`; that is a formatting
> difference, not a missing key. All 17 T1 AHN patients are present in T2. Patients imaged
> in both modalities, by center: NYU 161, MCF 150, NWU 19, AHN 17, MCA 15 = **362**.
`metadata/patient_crossref.csv` gives the full `patient_uid ↔ (t1 id, t2 id)` table.
### Unreconciled count
The paper states *"767 scans from 499 adult participants"*. Tracing all 767 released scans
back through the official mapping files yields **405** distinct original patient ids, not 499.
The mapping files list 889 original scans of which 122 are marked `"Not included"`. The most
plausible reading is that **499 counts the full collected cohort while 405 is what was actually
released**, but the paper attributes 499 directly to the 767, so this is flagged rather than
silently resolved. Nothing downstream depends on it; `patient_uid` is derived from the released
scans only.
## ⚠️ Mask affine defect — 66 T1 cases
**In 66 of 385 T1 cases the mask's affine disagrees with the image's.** The images are
`LPS` while the masks read `RAS` (28 cases) or `RAI` (38 cases) — all of them in the MCF
center. T2 is unaffected (0 cases).
The affines differ **only in the sign of the diagonal**, with identical zooms and identical
array shapes:
```
MCF_0001 image affine diag = [-1.484, -1.484, 7.7] zooms (1.484, 1.484, 7.7)
mask affine diag = [+1.484, +1.484, 7.7] zooms (1.484, 1.484, 7.7)
```
That is the signature of a mask written without direction cosines, **not** of genuinely
reordered voxel data. Measured here to confirm it, using the fact that MRI background outside
the body is ≈0 — a correctly aligned pancreas mask must not sit on air:
| Alignment | mean fraction of mask voxels below the body/air threshold |
|---|---|
| **Raw voxel grid** (ignore the mask affine) | **0.109** ✅ |
| Reorient each by its own affine | 0.312 ❌ |
| *Control: concordant cases, raw* | *0.248 mean / 0.085 median* |
Raw voxel alignment wins in **64 of 66** cases. (The 2 exceptions, `MCF_0052` and `MCF_0107`,
score >0.69 under *both* alignments — the heuristic simply fails on them; the control's p90 of
0.85 shows such values occur in perfectly concordant cases too. They are not counter-evidence.)
> **What to do:** take geometry from the **image**, and apply the **same** transform to the
> mask. Never call `nib.as_closest_canonical()` — or any reorientation — on the mask
> independently. Doing so is the natural way to handle this dataset's mixed `LPI`/`LPS`/`RAS`
> orientations, and it silently corrupts **17 % of the T1 set**.
The headers are **deliberately not patched**, so this mirror stays byte-identical to the
official release. The affected cases are flagged by `mask_affine_unreliable: true` in the jsonl.
## Other geometry gotchas
- **Mixed orientation across cases**: T1 is `LPI` 223 / `LPS` 143 / `RAS` 19; T2 is `LPI` 251 /
`LPS` 131. Reorient to a canonical frame *using the image affine* or L/R and S/I flip
silently between cases.
- **Mixed image dtype**: T1 `float32` 330, `int16` 35, `uint16` 19, `float64` 1;
T2 `int16` 362, `uint16` 19, `float32` 1. Masks are `uint16` (766) / `uint8` (1).
Do not assume a dtype; do not assume a fixed intensity range (no upstream normalisation).
- **Sparse foreground**: 0.44 % of voxels, and only ~43.5 % of slices carry any pancreas
(min 10.8 %). A slice sampler with a small budget can easily draw only empty slices.
- **Anisotropy**: through-plane spacing is 1.8–10.4 mm against 0.53–1.80 mm in-plane. Any
3D model or physical-unit metric must read real spacing from the header.
## Ground truth — single tier, 100 % manual
> *"Five radiologists (one per center) manually segmented the pancreas on axial T1W and T2W
> MRI scans using ITK-SNAP. A senior radiologist double-checked the annotations for quality
> and consistency."* — paper §3.3
There is exactly **one mask per volume** and no alternative rater tier is distributed. **No
AI-assisted, semi-automatic, or pseudo-labelled masks anywhere** — PanSegNet is trained *on*
these labels and was never used to produce them. Annotation took ≈25 min per scan, following
a protocol agreed among the radiologists beforehand.
**Human ceiling** (the authors' own sub-studies; the repeat annotations are *not* released):
| | T1W | T2W |
|---|---|---|
| Inter-observer Dice (50 scans) | 0.8014 | 0.8058 |
| Inter-observer Cohen's κ | 0.624 | 0.638 |
| Intra-observer Dice (20 scans, 4-week washout) | 0.960 | 0.936 |
Inter-observer agreement is only *moderate* by the authors' own description — a model at
Dice ≈0.80 is already at the human agreement ceiling.
## ✅ Cross-dataset overlap: none
Unusually clean for a pancreas dataset. The 767 MRI volumes are **newly collected,
IRB-approved private hospital data**, not curated from any public archive. They therefore
**cannot** overlap NIH Pancreas-CT, MSD Task07_Pancreas, AbdomenCT-1K, FLARE22/23, AMOS,
WORD, BTCV, or PANORAMA — every one of those is CT, and the AMOS MRI subset is a disjoint
public cohort.
The overlap risk in the *paper* lives entirely in the CT half, which is not shipped here:
AbdomenCT-1K is itself curated from 12 centers **including NIH and MSD**, so it transitively
contains both NIH Pancreas-CT and MSD Task07_Pancreas. Keep that in mind if you ever pair
this MRI set with those CT benchmarks.
## Structure
```
t1/train/images/NYU_0001_0000.nii.gz # 313 T1W volumes (NYU + MCF)
t1/train/masks/NYU_0001.nii.gz # 313 masks, same voxel grid
t1/test/images/ t1/test/masks/ # 72 T1W volumes (NWU + AHN + MCA)
t2/train/... t2/test/... # 312 / 70 T2W volumes
t1_train.jsonl t1_test.jsonl # per-case metadata
t2_train.jsonl t2_test.jsonl
metadata/T1-name_mapping.json # official, verbatim from OSF
metadata/T2-name_mapping.json
metadata/t2_info_osf.xlsx # official T2 demographics (408 rows)
metadata/patient_crossref.csv # patient_uid <-> t1 id <-> t2 id (derived here)
metadata/demographics.csv # xlsx joined onto released ids via patient_uid
data/*.parquet # display-only preview, see below
README.md LICENSE.txt
```
Filenames are the **official** ones, including the nnU-Net `_0000` channel suffix on images.
### jsonl columns
| Column | Meaning |
|---|---|
| `case_id` | released id, e.g. `"NYU_0001"` |
| `center`, `center_name` | `"NYU"` … / full institution name |
| `modality` | `"T1W"` or `"T2W"` |
| `image`, `mask` | repo-relative paths |
| `split` | `"train"` (NYU+MCF) or `"test"` (NWU+AHN+MCA) |
| **`patient_uid`** | **cross-modality patient key — group on this, never on `case_id`** |
| `original_name` | the pre-anonymisation filename from the official mapping |
| `paired_case_id` | the same patient's id in the *other* modality, or `null` |
| `has_other_modality` | whether this patient also appears in the other config |
| `n_slices`, `shape_xyz` | geometry |
| `spacing_xyz`, `slice_thickness_mm` | **real spacing from the header** |
| `axcodes_image`, `axcodes_mask` | orientation as declared by each file |
| **`mask_affine_unreliable`** | **`true` for the 66 sign-flipped T1 masks** |
| `image_dtype`, `mask_dtype` | not constant — see gotchas |
| `intensity_min`, `intensity_max` | per case, never renormalised |
| `label_values` | always `[0, 1]` |
| `fg_voxels`, `fg_fraction` | pancreas volume in voxels / fraction |
| `n_fg_slices`, `fg_slice_fraction` | how many slices carry pancreas |
| `demographics` | `{gender, age, mri_brand, magnet_strength}` where known, else `null` |
### The parquet preview layer is display-only
`data/*.parquet` exists so the HF Dataset Viewer can render this dataset. Each row holds one
slice of one volume as PNG: `image` (grayscale, percentile-windowed), `mask`, and `overlay`.
> **The preview renders the slice with the LARGEST pancreas area, not the middle slice.**
> With foreground on only ~43.5 % of slices, a middle-slice preview would show an empty mask
> for over half the dataset. `slice_index` records which slice was rendered.
> **Do not train or evaluate on the preview.** Its intensities are percentile-windowed to
> 8-bit for display and it holds one slice per volume. The real data is the byte-identical
> `.nii.gz` at the repo root.
## Source & Citation
- Official data: https://osf.io/kysnj/ — CC BY-NC 4.0, anonymous download, no registration.
- Code (PanSegNet): https://github.com/NUBagciLab/PaNSegNet
- The medsam-datasetlist entry records the license as "GPL 3.0"; that is **wrong** — see
`LICENSE.txt` in this repo for the evidence.
```bibtex
@article{zhang2025pansegnet,
author = {Zhang, Zheyuan and Keles, Elif and Durak, Gorkem and Taktak, Yavuz and
Susladkar, Onkar and Gorade, Vandan and Jha, Debesh and
Ormeci, Asli C. and Medetalibeyoglu, Alpaslan and Yao, Lanhong and
Wang, Bin and Isler, Ilkin Sevgi and Peng, Linkai and Pan, Hongyi and
Vendrami, Camila L. and Bourhani, Amir and Velichko, Yury and
Gong, Boqing and Spampinato, Concetto and Pyrros, Ayis and
Tiwari, Pallavi and Klatte, Derk C. F. and Engels, Megan and
Hoogenboom, Sanne and Bolan, Candice W. and Agarunov, Emil and
Harfouch, Nassier and Huang, Chenchan and Bruno, Marco J. and
Schoots, Ivo and Keswani, Rajesh N. and Miller, Frank H. and
Gonda, Tamas and Yazici, Cemal and Tirkes, Temel and
Turkbey, Baris and Wallace, Michael B. and Bagci, Ulas},
title = {Large-scale multi-center CT and MRI segmentation of pancreas with deep learning},
journal = {Medical Image Analysis},
volume = {99},
pages = {103382},
year = {2025},
doi = {10.1016/j.media.2024.103382}
}
```