msd-liver / README.md
Angelou0516's picture
Upload README.md with huggingface_hub
2d83a31 verified
metadata
license: cc-by-sa-4.0
task_categories:
  - image-segmentation
tags:
  - medical
  - CT
  - liver
  - segmentation
  - Medical Segmentation Decathlon
size_categories:
  - n<1K
configs:
  - config_name: default
    data_files:
      - split: train
        path: train.jsonl
      - split: test
        path: test.jsonl

Medical Segmentation Decathlon: Liver

Dataset Description

This is the Liver dataset from the Medical Segmentation Decathlon (MSD) challenge. The dataset contains CT scans with segmentation annotations for liver and liver tumor segmentation.

Dataset Details

  • Modality: CT
  • Task: Task03_Liver
  • Target: liver and liver tumors
  • Format: NIfTI (.nii.gz)

Dataset Structure

Each sample in the JSONL file contains:

{
  "image": "path/to/image.nii.gz",
  "mask": "path/to/mask.nii.gz",
  "label": ["label1", "label2", ...],
  "modality": "CT",
  "dataset": "MSD_Liver",
  "official_split": "train",
  "patient_id": "patient_id"
}

Data Organization

Task03_Liver/
├── imagesTr/          # Training images
│   └── *.nii.gz
└── labelsTr/          # Training labels
    └── *.nii.gz

Usage

Load Metadata

from datasets import load_dataset

# Load the dataset
ds = load_dataset("Angelou0516/msd-liver")

# Access a sample
sample = ds['train'][0]
print(f"Image: {sample['image']}")
print(f"Mask: {sample['mask']}")
print(f"Labels: {sample['label']}")
print(f"Modality: {sample['modality']}")

Load Images

from huggingface_hub import snapshot_download
import nibabel as nib
import os

# Download the full dataset
local_path = snapshot_download(
    repo_id="Angelou0516/msd-liver",
    repo_type="dataset"
)

# Load a sample
sample = ds['train'][0]
image = nib.load(os.path.join(local_path, sample['image']))
mask = nib.load(os.path.join(local_path, sample['mask']))

# Get numpy arrays
image_data = image.get_fdata()
mask_data = mask.get_fdata()

print(f"Image shape: {image_data.shape}")
print(f"Mask shape: {mask_data.shape}")

Citation

If you use this dataset, please cite the Medical Segmentation Decathlon paper:

@article{antonelli2022medical,
  title={A large annotated medical image dataset for the development and evaluation of segmentation algorithms},
  author={Antonelli, Michela and Reinke, Annika and Bakas, Spyridon and others},
  journal={Nature Communications},
  volume={13},
  number={1},
  pages={1--13},
  year={2022},
  publisher={Nature Publishing Group}
}

License

CC-BY-SA-4.0

Dataset Homepage

http://medicaldecathlon.com/