Chris Oswald
commited on
Commit
·
b31174f
1
Parent(s):
a23ca77
added description of dataset
Browse files
SPIDER.py
CHANGED
|
@@ -81,8 +81,7 @@ _CITATION = """\
|
|
| 81 |
}
|
| 82 |
"""
|
| 83 |
|
| 84 |
-
#
|
| 85 |
-
# You can copy an official description
|
| 86 |
_DESCRIPTION = """\
|
| 87 |
This is a large publicly available multi-center lumbar spine magnetic resonance \
|
| 88 |
imaging (MRI) dataset with reference segmentations of vertebrae, intervertebral \
|
|
@@ -114,7 +113,11 @@ following degenerative changes:
|
|
| 114 |
|
| 115 |
7. Pfirrman grade (grade 1 to 5).
|
| 116 |
|
| 117 |
-
All radiological gradings are provided per IVD level.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
_HOMEPAGE = "https://zenodo.org/records/10159290"
|
| 120 |
|
|
@@ -165,7 +168,8 @@ class CustomBuilderConfig(datasets.BuilderConfig):
|
|
| 165 |
|
| 166 |
|
| 167 |
class SPIDER(datasets.GeneratorBasedBuilder):
|
| 168 |
-
"""
|
|
|
|
| 169 |
|
| 170 |
# Class attributes
|
| 171 |
DEFAULT_WRITER_BATCH_SIZE = 16 # PyArrow default is too large for image data
|
|
@@ -183,19 +187,6 @@ class SPIDER(datasets.GeneratorBasedBuilder):
|
|
| 183 |
]
|
| 184 |
DEFAULT_CONFIG_NAME = "default"
|
| 185 |
|
| 186 |
-
# def __init__(
|
| 187 |
-
# self,
|
| 188 |
-
# *args,
|
| 189 |
-
# scan_types: List[str] = DEFAULT_SCAN_TYPES,
|
| 190 |
-
# resize_shape: Tuple[int, int, int] = DEFAULT_RESIZE,
|
| 191 |
-
# shuffle: bool = True,
|
| 192 |
-
# **kwargs,
|
| 193 |
-
# ):
|
| 194 |
-
# super().__init__(*args, **kwargs)
|
| 195 |
-
# self.scan_types = self.scan_types
|
| 196 |
-
# self.resize_shape = self.resize_shape
|
| 197 |
-
# self.shuffle = self.shuffle
|
| 198 |
-
|
| 199 |
def _info(self):
|
| 200 |
"""Specify datasets.DatasetInfo object containing information and typing
|
| 201 |
for the dataset."""
|
|
@@ -211,46 +202,6 @@ class SPIDER(datasets.GeneratorBasedBuilder):
|
|
| 211 |
k:datasets.Value(v) for k,v in
|
| 212 |
self.config.var_types['metadata'].items()
|
| 213 |
},
|
| 214 |
-
# {
|
| 215 |
-
# "num_vertebrae": datasets.Value("int16"),
|
| 216 |
-
# "num_discs": datasets.Value("int16"),
|
| 217 |
-
# "sex": datasets.Value("string"),
|
| 218 |
-
# "birth_date": datasets.Value("string"),
|
| 219 |
-
# "AngioFlag": datasets.Value("string"),
|
| 220 |
-
# "BodyPartExamined": datasets.Value("string"),
|
| 221 |
-
# "DeviceSerialNumber": datasets.Value("string"),
|
| 222 |
-
# "EchoNumbers": datasets.Value("float32"),
|
| 223 |
-
# "EchoTime": datasets.Value("float32"),
|
| 224 |
-
# "EchoTrainLength": datasets.Value("float32"),
|
| 225 |
-
# "FlipAngle": datasets.Value("float32"),
|
| 226 |
-
# "ImagedNucleus": datasets.Value("string"),
|
| 227 |
-
# "ImagingFrequency": datasets.Value("float32"),
|
| 228 |
-
# "InPlanePhaseEncodingDirection": datasets.Value("string"),
|
| 229 |
-
# "MRAcquisitionType": datasets.Value("string"),
|
| 230 |
-
# "MagneticFieldStrength": datasets.Value("float32"),
|
| 231 |
-
# "Manufacturer": datasets.Value("string"),
|
| 232 |
-
# "ManufacturerModelName": datasets.Value("string"),
|
| 233 |
-
# "NumberOfPhaseEncodingSteps": datasets.Value("int32"),
|
| 234 |
-
# "PercentPhaseFieldOfView": datasets.Value("float64"),
|
| 235 |
-
# "PercentSampling": datasets.Value("float64"),
|
| 236 |
-
# "PhotometricInterpretation": datasets.Value("string"),
|
| 237 |
-
# "PixelBandwidth": datasets.Value("int32"),
|
| 238 |
-
# "PixelSpacing": datasets.Sequence(datasets.Value("float32")),
|
| 239 |
-
# "RepetitionTime": datasets.Value("float64"),
|
| 240 |
-
# "SAR": datasets.Value("float64"),
|
| 241 |
-
# "SamplesPerPixel": datasets.Value("int32"),
|
| 242 |
-
# "ScanningSequence": datasets.Value("string"),
|
| 243 |
-
# "SequenceName": datasets.Value("string"),
|
| 244 |
-
# "SeriesDescription": datasets.Value("string"),
|
| 245 |
-
# "SliceThickness": datasets.Value("float32"),
|
| 246 |
-
# "SoftwareVersions": datasets.Sequence(datasets.Value("string")),
|
| 247 |
-
# "SpacingBetweenSlices": datasets.Value("float32"),
|
| 248 |
-
# "SpecificCharacterSet": datasets.Value("string"),
|
| 249 |
-
# "TransmitCoilName": datasets.Value("string"),
|
| 250 |
-
# "WindowCenter": datasets.Value("float32"),
|
| 251 |
-
# "WindowWidth": datasets.Value("float32"),
|
| 252 |
-
# "OrigSubset":datasets.Value("string"),
|
| 253 |
-
# },
|
| 254 |
"rad_gradings": {
|
| 255 |
"IVD label": datasets.Sequence(datasets.Value("string")),
|
| 256 |
"Modic": datasets.Sequence(datasets.Value("string")),
|
|
|
|
| 81 |
}
|
| 82 |
"""
|
| 83 |
|
| 84 |
+
# Official description
|
|
|
|
| 85 |
_DESCRIPTION = """\
|
| 86 |
This is a large publicly available multi-center lumbar spine magnetic resonance \
|
| 87 |
imaging (MRI) dataset with reference segmentations of vertebrae, intervertebral \
|
|
|
|
| 113 |
|
| 114 |
7. Pfirrman grade (grade 1 to 5).
|
| 115 |
|
| 116 |
+
All radiological gradings are provided per IVD level.
|
| 117 |
+
|
| 118 |
+
Repository: https://zenodo.org/records/10159290
|
| 119 |
+
Paper: https://www.nature.com/articles/s41597-024-03090-w
|
| 120 |
+
"""
|
| 121 |
|
| 122 |
_HOMEPAGE = "https://zenodo.org/records/10159290"
|
| 123 |
|
|
|
|
| 168 |
|
| 169 |
|
| 170 |
class SPIDER(datasets.GeneratorBasedBuilder):
|
| 171 |
+
"""Resized/rescaled 3-dimensional volumetric arrays of lumbar spine MRIs \
|
| 172 |
+
with corresponding scanner/patient metadata and radiological gradings."""
|
| 173 |
|
| 174 |
# Class attributes
|
| 175 |
DEFAULT_WRITER_BATCH_SIZE = 16 # PyArrow default is too large for image data
|
|
|
|
| 187 |
]
|
| 188 |
DEFAULT_CONFIG_NAME = "default"
|
| 189 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
def _info(self):
|
| 191 |
"""Specify datasets.DatasetInfo object containing information and typing
|
| 192 |
for the dataset."""
|
|
|
|
| 202 |
k:datasets.Value(v) for k,v in
|
| 203 |
self.config.var_types['metadata'].items()
|
| 204 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
"rad_gradings": {
|
| 206 |
"IVD label": datasets.Sequence(datasets.Value("string")),
|
| 207 |
"Modic": datasets.Sequence(datasets.Value("string")),
|