The dataset viewer is not available for this dataset.
Cannot get the config names for the dataset.
Error code:   ConfigNamesError
Exception:    ImportError
Message:      To be able to use cdoswald/SPIDER, you need to install the following dependencies: skimage, SimpleITK.
Please install them using 'pip install skimage SimpleITK' for instance.
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 66, in compute_config_names_response
                  config_names = get_dataset_config_names(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 347, in get_dataset_config_names
                  dataset_module = dataset_module_factory(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1914, in dataset_module_factory
                  raise e1 from None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1880, in dataset_module_factory
                  return HubDatasetModuleFactoryWithScript(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1504, in get_module
                  local_imports = _download_additional_modules(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 354, in _download_additional_modules
                  raise ImportError(
              ImportError: To be able to use cdoswald/SPIDER, you need to install the following dependencies: skimage, SimpleITK.
              Please install them using 'pip install skimage SimpleITK' for instance.

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Spine Segmentation: Discs, Vertebrae and Spinal Canal (SPIDER)

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

Original data are available on Zenodo. More information can be found at SPIDER Grand Challenge.

Example MRI Image
Example MRI scan (at three different depths)
Example MRI Image with Segmentation Mask
Example MRI scan with segmentation masks

Tutorials

In addition to the information in this README, several detailed tutorials for this dataset are provided in the tutorials folder:

  1. Loading the SPIDER Dataset from HuggingFace
  2. Building a U-Net CNN Model for Magnetic Resonance Imaging (MRI) Segmentation

Table of Contents (TOC)

  1. Getting Started

  2. Dataset Summary

  3. Data Modifications

  4. Dataset Structure

  5. Image Resolution

  6. Additional Information


Getting Started

First, you will need to install the following dependencies:

  • datasets >= 2.18.0
  • scikit-image >= 0.19.3
  • SimpleITK >= 2.3.1

Then you can load the SPIDER dataset as follows:

from datasets import load_dataset
dataset = load_dataset("cdoswald/SPIDER, name="default", trust_remote_code=True)

See the Loading the Dataset tutorial for more information.

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.

Data Modifications

This version of the SPIDER dataset (i.e., available through the HuggingFace datasets library) differs from the original data available on Zenodo in two key ways:

  1. Image Rescaling/Resizing: The original 3D volumetric MRI data are stored as .mha files and do not have a standardized height, width, depth, and image resolution. To enable the data to be loaded through the HuggingFace datasets library, all 447 MRI series are standardized to have height and width of (512, 512) and (unsigned) 16-bit integer resolution. Segmentation masks have the same height and width dimension but are (unsigned) 8-bit integer resolution. The depth dimension has not been modified; rather, each scan is formatted as a sequence of (512, 512) grayscale images, where the index in the sequence indicates the depth value. N-dimensional interpolation is used to resize and/or rescale the images (via the skimage.transform.resize and skimage.img_as_uint functions). If you need a different standardization, you have two options:

    i. Pass your preferred height and width size as a Tuple[int, int] to the resize_shape argument in load_dataset (see the LoadData Tutorial); OR

    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. The local cache file path is provided for each example when iterating over the dataset (again, see the LoadData Tutorial).

  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 and 39 (15%) studies for the SPIDER Grand Challenge hidden test set. To enable users to train, validate, and test their models prior to submitting 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 for each study (i.e., training or validation set) is recorded in the OrigSubset variable in the study's linked metadata.

Dataset Structure

Data Instances

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

Data Schema

The format for each generated data instance is as follows:

  1. patient_id: a unique ID number indicating the specific patient (note that many patients have more than one scan in the data)

  2. scan_type: an indicator for whether the image is a T1-weighted, T2-weighted, or T2-SPACE MRI

  3. image: a sequence of 2-dimensional grayscale images of the MRI scan

  4. mask: a sequence of 2-dimensional values indicating the following segmented anatomical feature(s):

    • 0 = background
    • 1-25 = vertebrae (numbered from the bottom, i.e., L5 = 1)
    • 100 = spinal canal
    • 101-125 = partially visible vertebrae
    • 201-225 = intervertebral discs (numbered from the bottom, i.e., L5/S1 = 201)

    See the SPIDER Grand Challenge documentation for more details.

  5. image_path: path to the local cache containing the original (non-rescaled and non-resized) MRI image

  6. mask_path: path to the local cache containing the original (non-rescaled and non-resized) segementation mask

  7. metadata: a dictionary of metadata of image, patient, and scanner characteristics:

    • number of vertebrae
    • number of discs
    • biological sex
    • age
    • 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
  8. rad_gradings: radiological gradings by an expert musculoskeletal radiologist indicating specific degenerative changes at all intervertebral disc (IVD) levels (see page 3 of the original paper 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 are ratings while others are binary indicators. For consistency, each list will have 10 elements, but some IVD levels may not be applicable to every image (which will be indicated with an empty string).

Data Splits

The dataset is split as follows:

  • Training set:
    • 149 unique patients
    • 304 total images
      • Sagittal T1: 133 images
      • Sagittal T2: 145 images
      • Sagittal T2-SPACE: 26 images
  • Validation set:
    • 37 unique patients
    • 75 total images
      • Sagittal T1: 34 images
      • Sagittal T2: 34 images
      • Sagittal T2-SPACE: 7 images
  • Test set:
    • 32 unique patients
    • 68 total images
      • Sagittal T1: 29 images
      • Sagittal T2: 31 images
      • Sagittal T2-SPACE: 8 images

An additional hidden test set provided by the paper authors (i.e., not available via HuggingFace) is available on the SPIDER Grand Challenge.

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. (https://spider.grand-challenge.org/data/)

Note that all images are rescaled to have unsigned 16-bit integer resolution for compatibility with the HuggingFace datasets library. If you want to use the original resolution, you can load the original images from the local cache indicated in each example's image_path and mask_path features. See the tutorial for more information.

Additional Information

License

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

Citation

Disclaimer

I am not affiliated in any way with the aforementioned paper, researchers, or organizations. Please validate any findings using this curated dataset against the original data provided by the researchers on Zenodo.

Known Issues/Bugs

  1. Serializing data into Apache Arrow format is required to make the dataset available via HuggingFace's datasets library. However, it can introduce some segmentation mask integer values that do not map exactly to a defined anatomical feature category. See the data loading tutorial for more information and temporary work-arounds.
Downloads last month
461