cdoswald commited on
Commit
61b7c11
·
verified ·
1 Parent(s): 47626df

update README.md

Browse files
Files changed (1) hide show
  1. README.md +140 -116
README.md CHANGED
@@ -11,18 +11,35 @@ tags:
11
 
12
  # Dataset Card for Spine Segmentation: Discs, Vertebrae and Spinal Canal (SPIDER)
13
 
14
- The SPIDER data set contains lumbar spine magnetic resonance images (MRI) and segmentation masks described in the following paper:
15
 
16
- Jasper W. van der Graaf, Miranda L. van Hooff, Constantinus F. M. Buckens, Matthieu Rutten,
17
- Job L. C. van Susante, Robert Jan Kroeze, Marinus de Kleuver, Bram van Ginneken, Nikolas Lessmann. (2023).
18
- *Lumbar spine segmentation in MR images: a dataset and a public benchmark.* https://arxiv.org/abs/2306.12217.
19
 
20
- The data were made publicly available through [Zenodo](https://zenodo.org/records/8009680), an open repository operated by CERN, and posted on
21
- [Grand Challenge](https://spider.grand-challenge.org/).
22
 
23
- (***Disclaimer**: I am not affiliated in any way with the aforementioned paper, researchers, or organizations. My only contribution is to curate the SPIDER data set
24
- here on Hugging Face to increase accessibility. While I have taken care to curate the data in a way that maintains the integrity of the original data, any findings using this
25
- particular data set should be validated against the original data provided by the researchers on [Zenodo](https://zenodo.org/records/8009680).*)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  ## Table of Contents
28
 
@@ -30,99 +47,133 @@ particular data set should be validated against the original data provided by th
30
 
31
  ## Dataset Description
32
 
33
- - **Paper:** [Lumbar spine segmentation in MR images: a dataset and a public benchmark](https://arxiv.org/abs/2306.12217)
34
  - **Repository:** [Zenodo](https://zenodo.org/records/8009680)
 
35
 
36
  ### Dataset Summary
37
 
38
  The dataset includes 447 sagittal T1 and T2 MRI series collected from 218 patients across four hospitals.
39
  Segmentation masks indicating the vertebrae, intervertebral discs (IVDs), and spinal canal are also included.
40
- Segmentation masks were created manually by a medical trainee under the supervision of
41
- a medical imaging expert and an experienced musculoskeletal radiologist.
42
 
43
  In addition to MR images and segmentation masks, additional metadata (e.g., scanner manufacturer, pixel bandwidth, etc.), limited
44
  patient characteristics (biological sex and age, when available), and radiological gradings indicating specific degenerative
45
  changes can be loaded with the corresponding image data.
46
 
47
- ## Dataset Structure
48
 
49
- ### Data Instances
 
50
 
51
- There are 447 images and corresponding segmentation masks for 218 unique patients.
 
 
 
52
 
53
- ### Data Fields
54
-
55
- The following list includes the data fields available for importing:
56
-
57
- - Numeric representation of image
58
-
59
- - Numeric representation of segmentation mask
60
- - vertebrae
61
- - intervertebral discs
62
- - spinal canal
63
-
64
- - Image characteristics
65
- - number of vertebrae
66
- - number of discs
67
-
68
- - Patient characteristics
69
- - biological sex
70
- - age
71
-
72
- - Scanner characteristics
73
- - manufacturer
74
- - manufacturer model name
75
- - serial number
76
- - software version
77
- - echo numbers
78
- - echo time
79
- - echo train length
80
- - flip angle
81
- - imaged nucleus
82
- - imaging frequency
83
- - inplane phase encoding direction
84
- - MR acquisition type
85
- - magnetic field strength
86
- - number of phase encoding steps
87
- - percent phase field of view
88
- - percent sampling
89
- - photometric interpretation
90
- - pixel bandwidth
91
- - pixel spacing
92
- - repetition time
93
- - specific absorption rate (SAR)
94
- - samples per pixel
95
- - scanning sequence
96
- - sequence name
97
- - series description
98
- - slice thickness
99
- - spacing between slices
100
- - specific character set
101
- - transmit coil name
102
- - window center
103
- - window width
104
-
105
- (TODO: Will add variable descriptions after proposal approval)
106
 
107
- ### Data Splits
108
 
109
- The training set contains [x] images distributed as follows:
110
 
111
- - Unique individuals: [x]
112
 
113
- - Standard sagittal T1 images: [x]
114
- - Standard sagittal T2 images: [y]
115
- - Standard sagittal T2 SPACE images: [z]
116
- -
117
- The validation set contains 87 images distributed as follows:
118
 
119
- - Unique individuals: [x]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
 
121
- - Standard sagittal T1 images: [x]
122
- - Standard sagittal T2 images: [y]
123
- - Standard sagittal T2 SPACE images: [z]
124
 
125
- An additional hidden test set (not available through Hugging Face) is available on the [SPIDER Grand Challenge](spider.grand-challenge.org).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  ## Image Resolution
128
 
@@ -130,27 +181,10 @@ Standard sagittal T1 and T2 image resolution ranges from 3.3 x 0.33 x 0.33 mm to
130
  Sagittal T2 SPACE sequence images had a near isotropic spatial resolution with a voxel size of 0.90 x 0.47 x 0.47 mm.
131
  [Source](https://spider.grand-challenge.org/data/)
132
 
133
- ## Dataset Curation
134
-
135
- The data have been curated to enable users to load any of the following:
136
-
137
- - Raw image files
138
- - Raw segmentation masks
139
- - Numeric representations of images in tensor format
140
- - Numeric representations of segmentation masks in tensor format
141
- - Linked patient characteristics (limited to sex and age, if available)
142
- - Linked scanner characteristics
143
-
144
- ### Source Data
145
-
146
- ### Processing Steps
147
-
148
- (Specifics to be determined, but will include:)
149
-
150
- 1. Conversion of .mha files to numeric representations
151
- 2. Linking of segmentation mask numeric representations to image files
152
- 3. Linking of patient and scanner characteristics to image files
153
- 4. Cleaning of patient and scanner characteristics
154
 
155
  ## Additional Information
156
 
@@ -160,19 +194,9 @@ The dataset is published under a CC-BY 4.0 license: https://creativecommons.org/
160
 
161
  ### Citation
162
 
163
- Jasper W. van der Graaf, Miranda L. van Hooff, Constantinus F. M. Buckens, Matthieu Rutten,
164
- Job L. C. van Susante, Robert Jan Kroeze, Marinus de Kleuver, Bram van Ginneken, Nikolas Lessmann. (2023).
165
- *Lumbar spine segmentation in MR images: a dataset and a public benchmark.* https://arxiv.org/abs/2306.12217.
166
-
167
-
168
-
169
-
170
- # Rescale mask intensities to [0, 255] and cast as UInt8 type
171
- mask = sitk.Cast(sitk.RescaleIntensity(sitk.ReadImage(mask_path)), sitk.sitkUInt8)
172
- # Rescale image intensities to [0, 255] and cast as UInt8 type
173
- image = sitk.Cast(sitk.RescaleIntensity(image), sitk.sitkUInt8)
174
 
175
- # NOTE: since the original array shape is not standardized, cannot return in dataset
176
 
177
- # Images and masks are resized to (512, 512, 30) and rescaled to [0, 255] (unisgned 8-bit integers); paths to original
178
- .mha images and masks are also provided if you would prefer to load original image (for example, using SimpleSITK library)
 
11
 
12
  # Dataset Card for Spine Segmentation: Discs, Vertebrae and Spinal Canal (SPIDER)
13
 
14
+ The SPIDER dataset contains (human) lumbar spine magnetic resonance images (MRI) and segmentation masks described in the following paper:
15
 
16
+ - **van der Graaf, J.W., van Hooff, M.L., Buckens, C.F.M. et al. *Lumbar spine segmentation in MR images: a dataset and a public benchmark.*
17
+ Sci Data 11, 264 (2024). https://doi.org/10.1038/s41597-024-03090-w**
 
18
 
19
+ Original data are available on [Zenodo](https://zenodo.org/records/8009680). More information can be found at [SPIDER Grand Challenge](https://spider.grand-challenge.org/).
 
20
 
21
+ ![Example MRI Image](docs/ex1.png)
22
+
23
+ ![Example MRI Image with Segmentation Mask](docs/ex2.png)
24
+
25
+ ## Getting Started
26
+
27
+ First, you will need to install the following dependencies:
28
+
29
+ * `datasets >= 2.18.0`
30
+ * `scikit-image >= 0.19.3`
31
+ * `SimpleITK >= 2.3.1`
32
+
33
+ Then you can load the SPIDER dataset as follows:
34
+
35
+ ```python
36
+ from datasets import load_dataset
37
+
38
+ dataset = load_dataset("cdoswald/SPIDER, name="default", trust_remote_code=True)
39
+ ```
40
+
41
+ More detailed examples for [loading](tutorials/load_data.ipynb) the dataset with different configurations
42
+ and using the dataset for [segmentation tasks](tutorials/segment_anything.ipynb) are provided in the [tutorials](tutorials) folder.
43
 
44
  ## Table of Contents
45
 
 
47
 
48
  ## Dataset Description
49
 
50
+ - **Paper:** [Lumbar spine segmentation in MR images: a dataset and a public benchmark](https://www.nature.com/articles/s41597-024-03090-w)
51
  - **Repository:** [Zenodo](https://zenodo.org/records/8009680)
52
+ - **Grand Challenge:** [SPIDER Grand Challenge](https://spider.grand-challenge.org/)
53
 
54
  ### Dataset Summary
55
 
56
  The dataset includes 447 sagittal T1 and T2 MRI series collected from 218 patients across four hospitals.
57
  Segmentation masks indicating the vertebrae, intervertebral discs (IVDs), and spinal canal are also included.
58
+ Segmentation masks were created manually by a medical trainee under the supervision of a medical imaging expert and an experienced musculoskeletal radiologist.
 
59
 
60
  In addition to MR images and segmentation masks, additional metadata (e.g., scanner manufacturer, pixel bandwidth, etc.), limited
61
  patient characteristics (biological sex and age, when available), and radiological gradings indicating specific degenerative
62
  changes can be loaded with the corresponding image data.
63
 
64
+ ### Modifications to Original Data
65
 
66
+ This version of the SPIDER dataset (i.e., available through the HuggingFace `datasets` library) differs from the original
67
+ data available on [Zenodo](https://zenodo.org/records/8009680) in two key ways:
68
 
69
+ 1. Image Rescaling/Resizing: The original 3D volumetric MRI data (images and masks) are stored as .mha files and do not have a standardized height, width, depth, and image resolution.
70
+ To enable the data to be loaded through the HuggingFace `datasets` library, all 447 MRI series and masks are standardized to have size `(512, 512, 30)` and resolution `[0, 255]` (unisgned 8-bit integers); therefore,
71
+ n-dimensional interpolation is used to resize and/or rescale the images (via the `skimage.transform.resize` and `skimage.img_as_ubyte` functions).
72
+ If you need a different standardization, you have two options:
73
 
74
+ i. Pass your preferred standardization size as a `Tuple[int, int, int]` to the `resize_shape` argument in `load_dataset` (see the [LoadData Tutorial](placeholder)); OR
75
+
76
+ ii. After loading the dataset from HuggingFace, use the `SimpleITK` library to import each image using the file path of the locally cached .mha file.
77
+ The local cache file path is provided for each example when iterating over the dataset (again, see the [LoadData Tutorial](placeholder)).
78
+
79
+ 2. Train, Validation, and Test Set: The original dataset contained 257 unique studies (i.e., patients) that were partitioned into 218 (85%) studies for the public training/validation set
80
+ and 39 (15%) studies for the SPIDER Grand Challenge [hidden test set](https://spider.grand-challenge.org/data/). To enable users to train, validate, and test their models prior to submitting
81
+ their models to the SPIDER Grand Challenge, the original 218 studies that comprised the public training/validation set were further partitioned using a 60%/20%/20% split. The original split
82
+ for each study (i.e., training or validation set) is recorded in the `OrigSubset` variable in the study's linked metadata.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
 
84
 
85
+ ## Dataset Structure
86
 
87
+ ### Data Instances
88
 
89
+ There are 447 images and corresponding segmentation masks for 218 unique patients.
 
 
 
 
90
 
91
+ ### Data Format/Fields
92
+
93
+ The format for each generated data instance is as follows:
94
+
95
+ 1. **patient_id**: a unique ID number indicating the specific patient (note that many patients have more than one scan in the data)
96
+
97
+ 2. **scan_type**: an indicator for whether the image is a T1-weighted, T2-weighted, or T2-SPACE MRI
98
+
99
+ 3. **image**: a 3-dimensional volumetric array (height, width, depth) of values indicating pixel intensities of MRI scan
100
+
101
+ 4. **mask**: a 3-dimensional volumetric array (height, width, depth) of values indicating manually segmented feature of interest
102
+
103
+ 5. **image_path**: path to the local cache containing the original (non-rescaled and non-resized) MRI image
104
+
105
+ 6. **mask_path**: path to the local cache containing the original (non-rescaled and non-resized) segementation mask
106
+
107
+ 7. **metadata**: a dictionary of metadata of image, patient, and scanner characteristics:
108
+
109
+ - number of vertebrae
110
+ - number of discs
111
+ - biological sex
112
+ - age
113
+ - manufacturer
114
+ - manufacturer model name
115
+ - serial number
116
+ - software version
117
+ - echo numbers
118
+ - echo time
119
+ - echo train length
120
+ - flip angle
121
+ - imaged nucleus
122
+ - imaging frequency
123
+ - inplane phase encoding direction
124
+ - MR acquisition type
125
+ - magnetic field strength
126
+ - number of phase encoding steps
127
+ - percent phase field of view
128
+ - percent sampling
129
+ - photometric interpretation
130
+ - pixel bandwidth
131
+ - pixel spacing
132
+ - repetition time
133
+ - specific absorption rate (SAR)
134
+ - samples per pixel
135
+ - scanning sequence
136
+ - sequence name
137
+ - series description
138
+ - slice thickness
139
+ - spacing between slices
140
+ - specific character set
141
+ - transmit coil name
142
+ - window center
143
+ - window width
144
+
145
+ 9. **rad_gradings**: radiological gradings by an expert musculoskeletal radiologist indicating specific degenerative
146
+ changes at all intervertebral disc (IVD) levels (see page 3 of the [original paper](https://www.nature.com/articles/s41597-024-03090-w)
147
+ for more details). The data are provided as a dictionary of lists; an element's position in the list indicates the IVD level. Some elements
148
+ are ratings while others are binary indicators. For consistency, each list will have 10 elements, but some IVD levels may not be applicable
149
+ to every image (which will be indicated with an empty string).
150
 
151
+ ### Data Splits
 
 
152
 
153
+ The dataset is split as follows:
154
+
155
+ - Training set:
156
+ - 218 unique patients
157
+ - 304 images
158
+ - Standard sagittal T1: [x]
159
+ - Standard sagittal T2: [y]
160
+ - Standard sagittal T2 SPACE: [z]
161
+ - Validation set:
162
+ - [X] unique patients
163
+ - 75 images
164
+ - Standard sagittal T1: [x]
165
+ - Standard sagittal T2: [y]
166
+ - Standard sagittal T2 SPACE: [z]
167
+ - Test set:
168
+ - [X] unique patients
169
+ - 68 images
170
+ - Standard sagittal T1: [x]
171
+ - Standard sagittal T2: [y]
172
+ - Standard sagittal T2 SPACE: [z]
173
+
174
+ An additional hidden test set provided by the paper authors
175
+ (i.e., not available via HuggingFace) is available on the
176
+ [SPIDER Grand Challenge](https://spider.grand-challenge.org/spiders-challenge/).
177
 
178
  ## Image Resolution
179
 
 
181
  Sagittal T2 SPACE sequence images had a near isotropic spatial resolution with a voxel size of 0.90 x 0.47 x 0.47 mm.
182
  [Source](https://spider.grand-challenge.org/data/)
183
 
184
+ Note that all images are rescaled to have a resolution in the range `[0, 255]` (i.e., unsigned 8-bit integers)
185
+ for compatibility with HuggingFace `datasets` library. If you want to use the original resolution, you can
186
+ load the original images from the local cache paths indicated in the `image_path` and `mask_path` features.
187
+ See the data loading [tutorial](tutorials/load_data.ipynb) for more information.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
  ## Additional Information
190
 
 
194
 
195
  ### Citation
196
 
197
+ - van der Graaf, J.W., van Hooff, M.L., Buckens, C.F.M. et al. Lumbar spine segmentation in MR images: a dataset and a public benchmark. Sci Data 11, 264 (2024). https://doi.org/10.1038/s41597-024-03090-w.
 
 
 
 
 
 
 
 
 
 
198
 
199
+ ### Disclaimer
200
 
201
+ I am not affiliated in any way with the aforementioned paper, researchers, or organizations. Please validate any findings using this curated dataset
202
+ against the original data provided by the researchers on [Zenodo](https://zenodo.org/records/8009680).)