File size: 6,227 Bytes
c50e2dd
 
a5c185b
 
 
 
 
 
 
c50e2dd
a5c185b
 
 
9f2c9aa
a5c185b
 
 
2070ac8
a5c185b
9f2c9aa
 
 
f603b8a
22ffa45
f603b8a
22ffa45
a5c185b
 
b64741a
22ffa45
a5c185b
 
9f2c9aa
22ffa45
9f2c9aa
a5c185b
 
9f2c9aa
 
9f413e7
 
9f2c9aa
9f413e7
 
 
a5c185b
 
 
 
 
9f413e7
 
9f2c9aa
a5c185b
878c3dd
 
9f413e7
878c3dd
 
9f413e7
 
 
878c3dd
 
 
 
 
9f413e7
 
 
878c3dd
9f413e7
 
878c3dd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a5c185b
 
9f413e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a5c185b
 
9f413e7
 
 
 
 
 
 
 
 
a5c185b
 
 
 
878c3dd
f4ed7d1
 
 
 
 
9f413e7
a5c185b
 
 
 
2070ac8
 
a5c185b
9f2c9aa
 
 
f4ed7d1
c5eade3
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
license: cc-by-4.0
language:
- en
tags:
- medical
- MRI
- spine
- segmentation
---

# Dataset Card for Spine Segmentation: Discs, Vertebrae and Spinal Canal (SPIDER)

The SPIDER data set contains lumbar spine magnetic resonance images (MRI) and segmentation masks described in the following paper:

Jasper W. van der Graaf, Miranda L. van Hooff, Constantinus F. M. Buckens, Matthieu Rutten, 
Job L. C. van Susante, Robert Jan Kroeze, Marinus de Kleuver, Bram van Ginneken, Nikolas Lessmann. (2023).
*Lumbar spine segmentation in MR images: a dataset and a public benchmark.* https://arxiv.org/abs/2306.12217.

The data were made publicly available through [Zenodo](https://zenodo.org/records/8009680), an open repository operated by CERN, and posted on 
[Grand Challenge](https://spider.grand-challenge.org/).

(***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 
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
particular data set should be validated against the original data provided by the researchers on [Zenodo](https://zenodo.org/records/8009680).*)

## Table of Contents

(Placeholder--to be filled in at end of project)

## Dataset Description

- **Paper:** [Lumbar spine segmentation in MR images: a dataset and a public benchmark](https://arxiv.org/abs/2306.12217)
- **Repository:** [Zenodo](https://zenodo.org/records/8009680)

### Dataset Summary

The dataset includes 447 sagittal T1 and T2 MRI series collected from 218 patients across four hospitals.
Segmentation masks indicating the vertebrae, intervertebral discs (IVDs), and spinal canal are also included.
Segmentation masks were created manually by a medical trainee under the supervision of
a medical imaging expert and an experienced musculoskeletal radiologist.

In addition to MR images and segmentation masks, additional metadata (e.g., scanner manufacturer, pixel bandwidth, etc.), limited
patient characteristics (biological sex and age, when available), and radiological gradings indicating specific degenerative
changes can be loaded with the corresponding image data.

## Dataset Structure

### Data Instances

There are 447 images and corresponding segmentation masks for 218 unique patients.

### Data Fields

The following list includes the data fields available for importing:

- Numeric representation of image
  
- Numeric representation of segmentation mask
  - vertebrae
  - intervertebral discs
  - spinal canal
    
- Image characteristics
  - number of vertebrae
  - number of discs
    
- Patient characteristics
  - biological sex
  - age
    
- Scanner characteristics
  - manufacturer
  - manufacturer model name
  - serial number
  - software version
  - echo numbers
  - echo time
  - echo train length
  - flip angle
  - imaged nucleus
  - imaging frequency
  - inplane phase encoding direction
  - MR acquisition type
  - magnetic field strength
  - number of phase encoding steps
  - percent phase field of view
  - percent sampling
  - photometric interpretation
  - pixel bandwidth
  - pixel spacing
  - repetition time
  - specific absorption rate (SAR)
  - samples per pixel
  - scanning sequence
  - sequence name
  - series description
  - slice thickness
  - spacing between slices
  - specific character set
  - transmit coil name
  - window center
  - window width

(TODO: Will add variable descriptions after proposal approval)

### Data Splits

The training set contains [x] images distributed as follows:

- Unique individuals: [x]

- Standard sagittal T1 images: [x]
- Standard sagittal T2 images: [y]
- Standard sagittal T2 SPACE images: [z]
- 
The validation set contains 87 images distributed as follows:

- Unique individuals: [x]

- Standard sagittal T1 images: [x]
- Standard sagittal T2 images: [y]
- Standard sagittal T2 SPACE images: [z]

An additional hidden test set (not available through Hugging Face) is available on the [SPIDER Grand Challenge](spider.grand-challenge.org).

## Image Resolution

Standard sagittal T1 and T2 image resolution ranges from 3.3 x 0.33 x 0.33 mm to 4.8 x 0.90 x 0.90 mm. 
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.
[Source](https://spider.grand-challenge.org/data/)

## Dataset Curation

The data have been curated to enable users to load any of the following:

- Raw image files
- Raw segmentation masks
- Numeric representations of images in tensor format
- Numeric representations of segmentation masks in tensor format
- Linked patient characteristics (limited to sex and age, if available)
- Linked scanner characteristics
  
### Source Data

### Processing Steps

(Specifics to be determined, but will include:)

1. Conversion of .mha files to numeric representations
2. Linking of segmentation mask numeric representations to image files
3. Linking of patient and scanner characteristics to image files
4. Cleaning of patient and scanner characteristics

## Additional Information

### License

The dataset is published under a CC-BY 4.0 license: https://creativecommons.org/licenses/by/4.0/legalcode.

### Citation

Jasper W. van der Graaf, Miranda L. van Hooff, Constantinus F. M. Buckens, Matthieu Rutten, 
Job L. C. van Susante, Robert Jan Kroeze, Marinus de Kleuver, Bram van Ginneken, Nikolas Lessmann. (2023).
*Lumbar spine segmentation in MR images: a dataset and a public benchmark.* https://arxiv.org/abs/2306.12217.




# Rescale mask intensities to [0, 255] and cast as UInt8 type
mask = sitk.Cast(sitk.RescaleIntensity(sitk.ReadImage(mask_path)), sitk.sitkUInt8)
# Rescale image intensities to [0, 255] and cast as UInt8 type
image = sitk.Cast(sitk.RescaleIntensity(image), sitk.sitkUInt8)

            # NOTE: since the original array shape is not standardized, cannot return in dataset

# Images and masks are resized to (512, 512, 30) and rescaled to [0, 255] (unisgned 8-bit integers); paths to original
.mha images and masks are also provided if you would prefer to load original image (for example, using SimpleSITK library)