Dataset Viewer
Auto-converted to Parquet Duplicate
The dataset viewer is not available for this split.
The number of columns (1394) exceeds the maximum supported number of columns (1000). This is a current limitation of the datasets viewer. You can reduce the number of columns if you want the viewer to work.
Error code:   TooManyColumnsError

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.

Gastric-X

Multi-phase abdominal CT cohort paired with structured laboratory panels and free-text radiology reports, in proficient medical English with the original Simplified Chinese preserved alongside.

Patients (golden core) 1403
With bonus arterial phase 688
CT phases non_contrast + venous + delayed (required) + arterial (optional)
NIfTI files 4897 (~155 GB)
Lab records 1394 / 1403
Report records 1388 / 1403 (ct_report + diagnosis)
Bbox annotations (lesion / nodule / stomach_body, arterial-phase) 877 / 1403
VQA items 7223 questions across 1394 patients
License CC BY-NC 4.0 -- research / non-commercial only

Folder layout

Gastric-X/
+-- README.md
+-- LICENSE
+-- load_hu.py               HU recovery helper (see "Reading the CT and bbox")
+-- metadata/
|   +-- EN/
|   |   +-- Meta.json        per-patient labs (English)
|   |   +-- Reports.json     per-patient ct_report + diagnosis (English)
|   |   +-- VQA.json         per-patient visual-QA items (English)
|   +-- CN/
|       +-- Meta.json        per-patient labs (Simplified Chinese)
|       +-- Reports.json     per-patient ct_report + diagnosis (Simplified Chinese)
|       +-- VQA.json         per-patient visual-QA items (Simplified Chinese)
+-- assets/                  4-phase preview PNGs (bbox + sample VQA), 6 patients
+-- imaging/<GX####>/
    +-- non_contrast.nii.gz
    +-- venous.nii.gz
    +-- delayed.nii.gz
    +-- arterial.nii.gz      (688 of 1403 patients)
    +-- bbox.json            (877 of 1403 patients, arterial-phase aligned)

metadata/EN/*.json and metadata/CN/*.json are paired: every patient key in the English file is present in the Chinese file with the same schema and equivalent content. Patient IDs are synthetic, anonymous GX0001..GX1403; they are the same key across imaging/ and every file under metadata/.

Annotation details

  • bbox.json (per-patient): 3-D bounding boxes for lesion, nodule, and stomach_body, annotated on the arterial-phase volume. Each file carries multiple "cases" plus an arterial_case_index pointing to the case whose shape matches arterial.nii.gz. Coordinates are corner-to-corner voxel indices into the NIfTI array, zyx_min/zyx_max = [axis0, axis1, axis2] (axis2 = slice). Read them in this native order -- no rotation or flip. See "Reading the CT and bbox" below.
  • VQA.json (root): {patient_id: [{question_id, question, answer, phase_mask, slices: {phase: [slice_idx, ...]}}]}. 22 question templates spanning T-stage, tumour location, serosal invasion, early-cancer status, and regional lymph nodes. Slice indices refer to Z-positions in the corresponding <phase>.nii.gz volume.

How to load

Option A -- pull a single patient (fast, partial download)

from huggingface_hub import snapshot_download
import json, nibabel as nib
from pathlib import Path

ROOT = Path(snapshot_download(
    repo_id="HaoChen2/Gastric-X",
    repo_type="dataset",
    allow_patterns=["metadata/EN/*", "imaging/GX0001/*"],
))

reports = json.load(open(ROOT / "metadata" / "EN" / "Reports.json"))
meta    = json.load(open(ROOT / "metadata" / "EN" / "Meta.json"))

pid = "GX0001"
venous = nib.load(str(ROOT / "imaging" / pid / "venous.nii.gz")).get_fdata()
print("venous shape:", venous.shape)
print("diagnosis :", reports[pid].get("diagnosis", ""))
print("labs sample:", dict(list(meta.get(pid, {}).items())[:5]))

Option B -- structured tables via datasets

from datasets import load_dataset
reports = load_dataset("HaoChen2/Gastric-X", name="reports_en")["train"]
labs    = load_dataset("HaoChen2/Gastric-X", name="meta_en")["train"]
vqa     = load_dataset("HaoChen2/Gastric-X", name="vqa_en")["train"]
# Chinese mirrors: reports_cn / meta_cn / vqa_cn

Option C -- full mirror (~155 GB)

huggingface-cli download HaoChen2/Gastric-X --repo-type dataset \
    --local-dir ./Gastric-X

Reading the CT and bbox

Hounsfield Units. NIfTI rescale slope/intercept are unset; volumes are stored as raw 12-bit (HU + 1024), and some carry negative corner padding (e.g. -2000) that fools a naive min >= 0 test (leaving the image over-bright). Decide the convention from the non-padding voxels. True voxel spacing is in bbox.json spacing_zyx_mm (slice-first: [slice, axis1, axis0]) -- the NIfTI affine is identity, so use that, not the header.

import numpy as np, nibabel as nib

def to_hu(vol):
    v = vol.astype(np.float32)
    core = v[v > -1500]                       # ignore corner padding
    if core.size and np.percentile(core, 1) >= -200:
        v = v - 1024.0                        # HU+1024 convention (air sits >= ~0)
    return np.clip(v, -1024.0, None)

def window(hu, wl=40, ww=500):                # abdomen L40/W500 -> [0,1]
    return np.clip((hu - (wl - ww/2)) / ww, 0, 1)

Bounding boxes (lesion / nodule / stomach_body) are annotated on the arterial phase. The file stores each box as two voxel-index corners zyx_min / zyx_max, each [axis0, axis1, axis2] (axis2 = slice):

// imaging/<GX####>/bbox.json
{
  "arterial_case_index": 0,
  "cases": [
    {
      "shape_zyx": [512, 512, 53],          // matches arterial.nii.gz
      "spacing_zyx_mm": [5.0, 0.668, 0.668], // slice-first
      "bbox": {
        "lesion":       { "zyx_min": [213, 170, 21], "zyx_max": [376, 297, 36] },
        "nodule":       { "zyx_min": [264, 181, 18], "zyx_max": [370, 294, 30] },
        "stomach_body": { "zyx_min": [127, 155, 18], "zyx_max": [347, 393, 50] }
      }
    }
    // ... more cases (other series); use cases[arterial_case_index]
  ]
}

Coordinate convention (exact).

  • Load the volume as vol = np.asanyarray(nib.load(...).dataobj); its shape is shape_zyx = (axis0, axis1, axis2).
  • Despite the zyx name, the three numbers are the literal array axes in order [axis0, axis1, axis2] -- not semantic z, y, x. axis2 is the through-plane slice index; axis0 and axis1 are in-plane.
  • zyx_min and zyx_max are inclusive voxel-index corners; the box occupies vol[axis0_min:axis0_max+1, axis1_min:axis1_max+1, axis2_min:axis2_max+1].
  • When a slice is shown with imshow(vol[:, :, z], origin="upper"): axis1 is horizontal (column), axis0 is vertical (row), origin top-left. The box is visible on slices axis2_min <= z <= axis2_max.
  • Apply no rotation, flip, or transpose.

That fully defines the 3-D box — there is nothing else to apply.

For visualization only, draw a 2-D rectangle on any slice z in [axis2_min, axis2_max]: rectangle at column axis1_min, row axis0_min, with width axis1_max - axis1_min and height axis0_max - axis0_min. E.g. the lesion above on its mid-slice z = (21 + 36)//2 = 28:

import json, matplotlib.pyplot as plt, matplotlib.patches as patches

b    = json.load(open("imaging/GX0651/bbox.json"))
case = b["cases"][b["arterial_case_index"]]   # the case matching arterial.nii.gz
hu   = to_hu(np.asanyarray(nib.load("imaging/GX0651/arterial.nii.gz").dataobj).astype("float32"))

les  = case["bbox"]["lesion"]
z    = (les["zyx_min"][2] + les["zyx_max"][2]) // 2   # a slice inside the lesion
plt.imshow(window(hu[:, :, z]), cmap="gray", origin="upper")
for name, color in {"lesion": "red", "nodule": "yellow", "stomach_body": "cyan"}.items():
    s = case["bbox"].get(name)
    if not s or not (s["zyx_min"][2] <= z <= s["zyx_max"][2]):
        continue
    x, y = s["zyx_min"][1], s["zyx_min"][0]                # column=axis1, row=axis0
    w, h = s["zyx_max"][1] - x, s["zyx_max"][0] - y        # width, height
    plt.gca().add_patch(patches.Rectangle((x, y), w, h, lw=2, edgecolor=color, facecolor="none"))
plt.axis("off"); plt.show()

Boxes are deliberately coarse 3-D regions around the stomach, not tight masks. Sample previews are under assets/ (e.g. assets/GX0651_overview.png).

How to use

  • Vision-language pre-training / fine-tuning with paired CT volumes and bilingual radiology reports.
  • Multimodal modelling combining imaging, structured labs (TNM stage, tumor markers, blood counts, biochemistry) and free text.
  • Cross-lingual NLP: Reports.json / Reports_CN.json and Meta.json / Meta_CN.json form a high-quality parallel corpus of clinical Chinese <-> medical English.
  • Multi-phase imaging tasks: segmentation, classification, contrast-phase modelling, foundation-model pre-training.

Not for clinical or diagnostic deployment. Research and education only. Users agree not to attempt re-identification of any subject.

Citation

@inproceedings{lu2026gastric,
  title     = {Gastric-X: A Multimodal Multi-Phase Benchmark Dataset for
               Advancing Vision-Language Models in Gastric Cancer Analysis},
  author    = {Lu, Sheng and Chen, Hao and Yin, Rui and Ba, Juyan and
               Zhang, Yu and Li, Yuanzhe},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision
               and Pattern Recognition (CVPR) 2026},
  year      = {2026}
}
Downloads last month
1,507