Files changed (1) hide show
  1. LyNoS.py +75 -0
LyNoS.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """LyNoS: Mediastinal lymph nodes segmentation using 3D convolutional neural network ensembles and anatomical priors guiding."""
2
+
3
+
4
+ import datasets
5
+
6
+ _DESCRIPTION = """\
7
+ LyNoS: Mediastinal lymph nodes segmentation using 3D convolutional neural network ensembles and anatomical priors guiding.
8
+ """
9
+
10
+ _HOMEPAGE = "https://github.com/raidionics/LyNoS"
11
+
12
+ _LICENSE = "MIT"
13
+
14
+ _CITATION = """\
15
+ @article{bouget2023mediastinal,
16
+ title={Mediastinal lymph nodes segmentation using 3D convolutional neural network ensembles and anatomical priors guiding},
17
+ author={Bouget, David and Pedersen, Andr{\'e} and Vanel, Johanna and Leira, Haakon O and Lang{\o}, Thomas},
18
+ journal={Computer Methods in Biomechanics and Biomedical Engineering: Imaging \& Visualization},
19
+ volume={11},
20
+ number={1},
21
+ pages={44--58},
22
+ year={2023},
23
+ publisher={Taylor \& Francis}
24
+ }
25
+
26
+ """
27
+
28
+ _URLS = [
29
+ {
30
+ "ct": f"data/Pat{i}/Pat{i}_data.nii.gz",
31
+ "azygos": f"data/Pat{i}/Pat{i}_labels_Azygos.nii.gz",
32
+ "brachiocephalicveins": f"data/Pat{i}/Pat{i}_labels_BrachiocephalicVeins.nii.gz",
33
+ "esophagus": f"data/Pat{i}/Pat{i}_labels_Esophagus.nii.gz",
34
+ "lymphnodes": f"data/Pat{i}/Pat{i}_labels_LymphNodes.nii.gz",
35
+ "subclaviancarotidarteries": f"data/Pat{i}/Pat{i}_labels_SubCarArt.nii.gz",
36
+ }
37
+ for i in range(1, 15)
38
+ ]
39
+
40
+
41
+ class LyNoS(datasets.GeneratorBasedBuilder):
42
+ """A segmentation benchmark dataset for enlarged lymph nodes in patients with primary lung cancer."""
43
+
44
+ VERSION = datasets.Version("1.0.0")
45
+
46
+ def _info(self):
47
+ features = datasets.Features(
48
+ {
49
+ "ct": datasets.Value("string"),
50
+ "lymphnodes": datasets.Value("string"),
51
+ }
52
+ )
53
+ return datasets.DatasetInfo(
54
+ description=_DESCRIPTION,
55
+ features=features,
56
+ homepage=_HOMEPAGE,
57
+ license=_LICENSE,
58
+ citation=_CITATION,
59
+ )
60
+
61
+ def _split_generators(self, dl_manager):
62
+ data_dirs = dl_manager.download(_URLS)
63
+ return [
64
+ datasets.SplitGenerator(
65
+ name=datasets.Split.TEST,
66
+ # These kwargs will be passed to _generate_examples
67
+ gen_kwargs={
68
+ "data_dirs": data_dirs,
69
+ },
70
+ ),
71
+ ]
72
+
73
+ def _generate_examples(self, data_dirs):
74
+ for key, patient in enumerate(data_dirs):
75
+ yield key, patient