saiteja33 commited on
Commit
4874d3b
·
verified ·
1 Parent(s): 09bb7f6

Create README_LGG_MedThinkSeg.md

Browse files
Files changed (1) hide show
  1. lgg/README_LGG_MedThinkSeg.md +107 -0
lgg/README_LGG_MedThinkSeg.md ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # LGG MRI Segmentation (TCGA-LGG / Kaggle “lgg-mri-segmentation”) — packaged in `saiteja33/MedThink-Seg/lgg`
2
+
3
+ This README documents:
4
+ 1) **The original LGG MRI Segmentation dataset** (what it contains, size, and original file structure), and
5
+ 2) **How it is organized inside this Hugging Face repo** (`saiteja33/MedThink-Seg`, under the `lgg/` directory).
6
+
7
+ ---
8
+
9
+ ## 1) Original dataset (source)
10
+
11
+ **Original Kaggle dataset:** “Brain MRI segmentation” (`mateuszbuda/lgg-mri-segmentation`)
12
+ **Link:** https://www.kaggle.com/datasets/mateuszbuda/lgg-mri-segmentation
13
+
14
+ **Underlying cohort:** TCGA lower-grade glioma (**TCGA-LGG**) cases from **The Cancer Imaging Archive (TCIA)**.
15
+
16
+ **Primary references (as listed with the Kaggle dataset):**
17
+ - Buda, Saha, Mazurowski (2019), *Computers in Biology and Medicine* — DOI: **10.1016/j.compbiomed.2019.05.002**.
18
+ - Mazurowski et al. (2017), *Journal of Neuro-Oncology* — DOI: **10.1007/s11060-017-2420-1**.
19
+
20
+ ### What images are in the dataset?
21
+ - **Modality:** brain **MRI** (axial 2D slices) with segmentation masks.
22
+ - **Resolution:** **256 × 256** pixels per slice.
23
+ - **Channels / sequences:** images are stored as **3-channel** slices corresponding to **pre-contrast**, **FLAIR**, **post-contrast** (in that order).
24
+ - Some cases have a missing sequence; missing channels are replaced with the available FLAIR sequence so all images remain 3-channel.
25
+ - **Masks:** **binary, 1-channel** masks that segment the **FLAIR abnormality**.
26
+
27
+ ### Dataset size and counts
28
+ - **Patients:** **110**.
29
+ - **Total slice-level pairs:** **3,929** axial slices with corresponding masks.
30
+ - **Slices per patient:** varies by patient (reported range **20–88** slices per volume).
31
+
32
+ ### Labels and annotations
33
+ - **Segmentation label:** tumor-related **FLAIR abnormality region** (binary mask).
34
+
35
+ **Naming convention (original):**
36
+ - Image: `TCGA_<institution-code>_<patient-id>_<slice-number>.tif`
37
+ - Mask: same name with **`_mask`** suffix, e.g. `..._<slice-number>_mask.tif`
38
+
39
+ ### License
40
+ The Kaggle dataset is commonly redistributed under **CC BY-NC-SA 4.0**.
41
+
42
+ ---
43
+
44
+ ## 2) Organization inside this Hugging Face repo (`saiteja33/MedThink-Seg`)
45
+
46
+ This repo packages the dataset under the `lgg/` directory with a flat image/mask layout plus a separate **normal** split (as shown in the HF file browser).
47
+
48
+ ### Directory structure (this repo)
49
+ ```
50
+ lgg/
51
+ ├─ images/ # MRI slices (tumor / abnormality present)
52
+ ├─ masks/ # corresponding binary masks (paired with images/)
53
+ └─ normal/
54
+ ├─ images/ # MRI slices with no abnormality (normal)
55
+ └─ masks/ # corresponding masks (typically empty/all-black)
56
+ ```
57
+
58
+ ### Pairing rule
59
+ - Each image in `images/` has a corresponding mask in `masks/` with the **same base filename** (or the original `_mask` suffix pattern).
60
+ - Similarly, each file in `normal/images/` pairs with a file in `normal/masks/`.
61
+
62
+ > Note: In the original Kaggle distribution, every slice typically has an associated mask file (some masks may be empty). In this HF packaging, those “empty-mask” slices are separated into `normal/`.
63
+
64
+ ---
65
+
66
+ ## How to download / use (recommended)
67
+
68
+ ### A) Download the raw files for `lgg/` from this HF repo
69
+ ```python
70
+ from huggingface_hub import snapshot_download
71
+
72
+ local_dir = snapshot_download(
73
+ repo_id="saiteja33/MedThink-Seg",
74
+ repo_type="dataset",
75
+ allow_patterns=["lgg/**"], # only pull the lgg subdir
76
+ )
77
+ print(local_dir)
78
+ ```
79
+
80
+ ### B) Load with 🤗 Datasets (try these options)
81
+
82
+ **Option 1 — load from the repo (works if the repo has a compatible dataset layout/metadata):**
83
+ ```python
84
+ from datasets import load_dataset
85
+
86
+ ds = load_dataset("saiteja33/MedThink-Seg", data_dir="lgg")
87
+ print(ds)
88
+ ```
89
+
90
+ **Option 2 — treat it as an image-folder dataset (useful for quick inspection):**
91
+ ```python
92
+ from datasets import load_dataset
93
+
94
+ ds = load_dataset("imagefolder", data_dir="lgg")
95
+ print(ds)
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Citation
101
+ If you use this dataset, please cite the papers associated with the Kaggle release:
102
+
103
+ - Mateusz Buda, Ashirbani Saha, Maciej A. Mazurowski. *Association of Genomic Subtypes of Lower-Grade Gliomas with Shape Features Automatically Extracted by a Deep Learning Algorithm.* Computers in Biology and Medicine (2019). DOI: **10.1016/j.compbiomed.2019.05.002**.
104
+ - Maciej A. Mazurowski et al. *Radiogenomics of lower-grade glioma: algorithmically-assessed tumor shape is associated with tumor genomic subtypes and patient outcomes in a multi-institutional study with The Cancer Genome Atlas data.* Journal of Neuro-Oncology (2017). DOI: **10.1007/s11060-017-2420-1**.
105
+
106
+ And cite the Kaggle dataset record:
107
+ - **Kaggle:** `mateuszbuda/lgg-mri-segmentation` (Brain MRI segmentation).