1aurent commited on
Commit
63b8d95
1 Parent(s): ed8d41e

Delete NCT-CRC-HE.py

Browse files
Files changed (1) hide show
  1. NCT-CRC-HE.py +0 -102
NCT-CRC-HE.py DELETED
@@ -1,102 +0,0 @@
1
- import pathlib
2
- import datasets
3
-
4
- _DL_URL = "https://zenodo.org/record/1214456/files/"
5
-
6
- _BASE_URLS = {
7
- "CRC_VAL_HE_7K": f"{_DL_URL}/CRC-VAL-HE-7K.zip",
8
- "NCT_CRC_HE_100K": f"{_DL_URL}/NCT-CRC-HE-100K.zip",
9
- "NCT_CRC_HE_100K_NONORM": f"{_DL_URL}/NCT-CRC-HE-100K-NONORM.zip",
10
- }
11
-
12
- # _MD5_CHECKSUMS = {
13
- # "CRC_VAL_HE_7K": "2fd1651b4f94ebd818ebf90ad2b6ce06",
14
- # "NCT_CRC_HE_100K": "035777cf327776a71a05c95da6d6325f",
15
- # "NCT_CRC_HE_100K_NONORM": "6fd702d11df6292bc054397ae038a464",
16
- # }
17
-
18
- _HOMEPAGE = "https://zenodo.org/record/1214456"
19
-
20
- _DESCRIPTION = """
21
- This is a set of non-overlapping image patches from hematoxylin & eosin (H&E) stained histological images of human colorectal cancer (CRC) and normal tissue.
22
- All images are 224x224 pixels (px) at 0.5 microns per pixel (MPP). All images are color-normalized using Macenko's method (http://ieeexplore.ieee.org/abstract/document/5193250/, DOI 10.1109/ISBI.2009.5193250).
23
- Tissue classes are: Adipose (ADI), background (BACK), debris (DEB), lymphocytes (LYM), mucus (MUC), smooth muscle (MUS), normal colon mucosa (NORM), cancer-associated stroma (STR), colorectal adenocarcinoma epithelium (TUM).
24
- These images were manually extracted from N=86 H&E stained human cancer tissue slides from formalin-fixed paraffin-embedded (FFPE) samples from the NCT Biobank (National Center for Tumor Diseases, Heidelberg, Germany) and the UMM pathology archive (University Medical Center Mannheim, Mannheim, Germany). Tissue samples contained CRC primary tumor slides and tumor tissue from CRC liver metastases; normal tissue classes were augmented with non-tumorous regions from gastrectomy specimen to increase variability.
25
- """
26
-
27
- _LICENSE = "CC BY 4.0"
28
-
29
- _VERSION = datasets.Version("0.1.0")
30
-
31
- _CITATION = """
32
- @dataset{kather_jakob_nikolas_2018_1214456,
33
- author = {Kather, Jakob Nikolas and Halama, Niels and Marx, Alexander},
34
- title = {{100,000 histological images of human colorectal cancer and healthy tissue}},
35
- month = apr,
36
- year = 2018,
37
- publisher = {Zenodo},
38
- version = {v0.1},
39
- doi = {10.5281/zenodo.1214456},
40
- url = {https://doi.org/10.5281/zenodo.1214456}
41
- }
42
- """
43
-
44
- _NAMES = [
45
- "ADI", # Adipose
46
- "BACK", # Background
47
- "DEB", # Debris
48
- "LYM", # Lymphocytes
49
- "MUC", # Mucus
50
- "MUS", # Smooth muscle
51
- "NORM", # Normal colon mucosa
52
- "STR", # Cancer-associated stroma
53
- "TUM", # Colorectal adenocarcinoma epithelium
54
- ]
55
-
56
- class NCT_CRC_HE(datasets.GeneratorBasedBuilder):
57
- """NCT-CRC-HE (7k, 100k, 100k_nonorm) dataset."""
58
-
59
- def _info(self):
60
- return datasets.DatasetInfo(
61
- homepage=_HOMEPAGE,
62
- description=_DESCRIPTION,
63
- citation=_CITATION,
64
- license=_LICENSE,
65
- version=_VERSION,
66
- features=datasets.Features(
67
- {
68
- "image": datasets.Image(),
69
- "label": datasets.ClassLabel(names=_NAMES),
70
- }
71
- ),
72
- supervised_keys=(
73
- "image",
74
- "label",
75
- ),
76
- task_templates=[
77
- datasets.tasks.ImageClassification(
78
- image_column="image",
79
- label_column="label",
80
- ),
81
- ],
82
- )
83
-
84
- def _split_generators(self, dl_manager):
85
- return [
86
- datasets.SplitGenerator(
87
- name=datasets.NamedSplit(name),
88
- gen_kwargs={
89
- "data_dir": dl_manager.download_and_extract(url)
90
- },
91
- )
92
- for name, url in _BASE_URLS.items()
93
- ]
94
-
95
- def _generate_examples(self, data_dir):
96
- """Generate images and labels for splits."""
97
- tif_images = pathlib.Path(data_dir).rglob("*.tif")
98
- for index, filepath in enumerate(tif_images):
99
- yield index, {
100
- "image": str(filepath),
101
- "label": filepath.parent.name,
102
- }