Angelou0516 commited on
Commit
6fc89f2
·
verified ·
1 Parent(s): 972e195

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +127 -0
README.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-sa-4.0
3
+ task_categories:
4
+ - image-segmentation
5
+ tags:
6
+ - medical
7
+ - CT
8
+ - lung
9
+ - segmentation
10
+ - Medical Segmentation Decathlon
11
+ size_categories:
12
+ - n<1K
13
+ configs:
14
+ - config_name: default
15
+ data_files:
16
+ - split: train
17
+ path: train.jsonl
18
+ - split: test
19
+ path: test.jsonl
20
+ ---
21
+
22
+ # Medical Segmentation Decathlon: Lung
23
+
24
+ ## Dataset Description
25
+
26
+ This is the **Lung** dataset from the Medical Segmentation Decathlon (MSD) challenge. The dataset contains CT scans with segmentation annotations for lung tumor segmentation.
27
+
28
+ ### Dataset Details
29
+
30
+ - **Modality**: CT
31
+ - **Task**: Task06_Lung
32
+ - **Target**: lung cancer
33
+ - **Format**: NIfTI (.nii.gz)
34
+
35
+ ### Dataset Structure
36
+
37
+ Each sample in the JSONL file contains:
38
+ ```json
39
+ {
40
+ "image": "path/to/image.nii.gz",
41
+ "mask": "path/to/mask.nii.gz",
42
+ "label": ["label1", "label2", ...],
43
+ "modality": "CT",
44
+ "dataset": "MSD_Lung",
45
+ "official_split": "train",
46
+ "patient_id": "patient_id"
47
+ }
48
+ ```
49
+
50
+ ### Data Organization
51
+
52
+ ```
53
+ Task06_Lung/
54
+ ├── imagesTr/ # Training images
55
+ │ └── *.nii.gz
56
+ └── labelsTr/ # Training labels
57
+ └── *.nii.gz
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ ### Load Metadata
63
+
64
+ ```python
65
+ from datasets import load_dataset
66
+
67
+ # Load the dataset
68
+ ds = load_dataset("Angelou0516/msd-lung")
69
+
70
+ # Access a sample
71
+ sample = ds['train'][0]
72
+ print(f"Image: {sample['image']}")
73
+ print(f"Mask: {sample['mask']}")
74
+ print(f"Labels: {sample['label']}")
75
+ print(f"Modality: {sample['modality']}")
76
+ ```
77
+
78
+ ### Load Images
79
+
80
+ ```python
81
+ from huggingface_hub import snapshot_download
82
+ import nibabel as nib
83
+ import os
84
+
85
+ # Download the full dataset
86
+ local_path = snapshot_download(
87
+ repo_id="Angelou0516/msd-lung",
88
+ repo_type="dataset"
89
+ )
90
+
91
+ # Load a sample
92
+ sample = ds['train'][0]
93
+ image = nib.load(os.path.join(local_path, sample['image']))
94
+ mask = nib.load(os.path.join(local_path, sample['mask']))
95
+
96
+ # Get numpy arrays
97
+ image_data = image.get_fdata()
98
+ mask_data = mask.get_fdata()
99
+
100
+ print(f"Image shape: {image_data.shape}")
101
+ print(f"Mask shape: {mask_data.shape}")
102
+ ```
103
+
104
+ ## Citation
105
+
106
+ If you use this dataset, please cite the Medical Segmentation Decathlon paper:
107
+
108
+ ```bibtex
109
+ @article{antonelli2022medical,
110
+ title={A large annotated medical image dataset for the development and evaluation of segmentation algorithms},
111
+ author={Antonelli, Michela and Reinke, Annika and Bakas, Spyridon and others},
112
+ journal={Nature Communications},
113
+ volume={13},
114
+ number={1},
115
+ pages={1--13},
116
+ year={2022},
117
+ publisher={Nature Publishing Group}
118
+ }
119
+ ```
120
+
121
+ ## License
122
+
123
+ CC-BY-SA-4.0
124
+
125
+ ## Dataset Homepage
126
+
127
+ http://medicaldecathlon.com/