DKFZ logo IMSY logo ISRU logo NCT logo UKHD logo UMM logo
RGB HSI
RGB image HSI cube

Python Python Python Python Python

Heidelberg Rodent HyperSPECTRAL Imaging Dataset (HeiRodSPECTRAL)

Welcome to the HeiRodSPECTRAL dataset! Here you can find 7875 hyperspectral imaging (HSI) cubes of 31 physiological organ classes across 13 rats annotated by 3 medical experts. For each organ, there are about 36 recordings per rat: 4 different intraoperative situations (situs) were imaged from 3 different angles (angle) for 3 times (repetition). The HSI cubes were acquired with the Tivita® Tissue camera system from Diaspective Vision. Each data cube has the dimensions (480, 640, 100) = (height, width, channels) with the 100 non-overlapping spectral channels being in the range from 500 nm to 1000 nm at a spectral resolution of around 5 nm. This repository contains the raw data, related metadata as well as the preprocessed files. The figures from the paper and example visualizations for each image are available at https://spectralverse-heidelberg.org/heirodspectral/figures/.

This Dataset is similar to the HeiPorSPECTRAL dataset containing HSI cubes of 20 physiological organ classes across 11 pigs, which were recorded under the same standardized protocol as the HeiRodSPECTRAL dataset. The HeiPorSPECTRAL website also contains information about the technical validation of the camera used to create the HeiRodSPECTRAL dataset.

Download

The full dataset can be downloaded at:

We do not recommend downloading the zip archive via the browser due to the large size of 1,11 TiB. Instead, you may use a download manager of your choice or wget as in the example below. This will allow you to interrupt the download and continue it at a later point. Please make sure beforehand that you have enough free storage to both download the zip archive and decompress the content (around 1.3 TiB). Prior to decompression, it is recommended to verify the checksum of the downloaded file:

# Example for Unix-based systems
# Best to be run in a screen environment (e.g. https://linuxize.com/post/how-to-use-linux-screen/)

# Download all the data
wget --continue https://e130-hyperspectal-tissue-classification.s3.dkfz.de/data/HeiRodSPECTRAL.zip

# Verify the checksum of the downloaded file
curl https://e130-hyperspectal-tissue-classification.s3.dkfz.de/data/HeiRodSPECTRAL.sha256 | sha256sum -c -

An exemplary version of the dataset (ZIP download) is also available for exploring without the need to download the full dataset. It only contains the two images R016#2023_10_05_18_18_44 (cartilage & patellar ligament) and R018#2023_10_11_09_03_55 (colon). The zip file has a size of 411 MB and the unzipped file of 606 MB.

In addition, a medium-sized version of the dataset is available for environments with restricted storage space. Instead of 1.3 TiB for the full dataset, it only takes up 71 GiB. It contains two images per organ of each rat, including all three annotations. The zip file has a size of 62 GiB. The medium-sized dataset can be downloaded at:

Usage

Logo

We recommend using the data with the htc framework, which offers:

Installation (example for Unix-based systems):

# Make the dataset available
export PATH_Tivita_HeiRodSPECTRAL=/mnt/nvme_4tb/HeiRodSPECTRAL

# Install the htc package
pip install imsy-htc

As a teaser, this is how you can use the htc framework to read a data cube, corresponding annotation and parameter images:

import numpy as np
from htc import DataPath, LabelMapping

# You can load every image based on its unique name
path = DataPath.from_image_name('R019#2023_10_15_11_45_50#0202-00118')

# HSI cube format: (height, width, channels)
print(path.read_cube().shape)
# (480, 640, 100)

# Annotated region of the selected annotator
mask = path.read_segmentation("polygon#annotator1")
print(mask.shape)
# (480, 640)

# Additional meta information about the image
print(path.meta("label_meta"))
# {'fur': {'situs': 1, 'angle': 0, 'repetition': 3}, 'skin': {'situs': 1, 'angle': 0, 'repetition': 3}}

# Tivita parameter images are available as well
sto2 = path.compute_sto2()
print(sto2.shape)
# (480, 640)

# Example: average StO2 value of the annotated skin area for annotator1
# The dataset_settings.json file defines the global name to index mapping
skin_index = LabelMapping.from_path(path).name_to_index("skin")
print(round(np.mean(sto2[mask == skin_index]), 2))
# 0.63

Dataset Structure

This dataset contains raw data, annotations, as well as preprocessed data. Annotations were performed by 3 different annotators using a polygon tool. Furthermore, the meta parameters situs, angle and repetition were annotated during image acquisition (see also the JSON Schema file for a meta description of these attributes). Preprocessed data (intermediates) is computed based on the data folder and contains aggregated information and file formats optimized for neural network training. The filename part '0202-00118' specifies that the images have been taken with a Halogen light source. So far, this is true for all images in the HeiRodSPECTRAL dataset. In the following, we explain the structure of this dataset in more detail:

.
โ”œโ”€โ”€ data/  % Primary animal data (raw data and annotations)
โ”‚   โ”œโ”€โ”€ subjects_halogen/  % Individual animal experiments using a halogen light source
โ”‚   โ”‚   โ”œโ”€โ”€ RXXX/  % Folder with all images for this subject (the dataset_settings.json file contains the mapping of the three digit subject identifier used in the dataset to the two digit identifier used in the paper)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS/  % Image data of one recording
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_DICOM.dcm  % DICOM file containing the RGB image and parameter images
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_meta.log  % Meta information about the recording (e.g. software version, exposure time)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_NIR-Perfusion.png  % NIR perfusion image
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_OHI.png  % Organ Hemoglobin Index (OHI)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_Oxygenation.png  % Oxygenation (StO2)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_Parameter.png  % Collage with RGB, StO2, NIR, OHI and TWI images
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_RGB-Image.png  % RGB image
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_SpecCube.dat  % Hyperspectral image data cube (float32 binary data of the 30720000 reflectance values)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_THI.png  % Tissue Hemoglobin Index (THI)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_TLI.png  % Tissue Lipid Index (TLI)
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_TWI.png  % Tissue Water Index (TWI)
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ annotations/  % Available annotations for this image
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS_meta.json  % Structured meta annotation (situs, angle, repetition)
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator1#label#binary.png  % Binary segmentation mask of the polygon from annotator 1 (white = annotated region)
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator1#label#coordinates.csv  % Polygon coordinates for the mask from annotator 1 (col, row)
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator2#label#binary.png  % Binary segmentation mask of the polygon from annotator 2 (white = annotated region)
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator2#label#coordinates.csv  % Polygon coordinates for the mask from annotator 2 (col, row)
โ”‚   โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator3#label#binary.png  % Binary segmentation mask of the polygon from annotator 3 (white = annotated region)
โ”‚   โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ YYYY_MM_DD_HH_MM_SS#polygon#annotator3#label#coordinates.csv  % Polygon coordinates for the mask from annotator 3 (col, row)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ [more images]
โ”‚   โ”‚   โ””โ”€โ”€ [more subjects]
โ”‚   โ”œโ”€โ”€ extra_label_symbols/  % Label symbols used in the visualizations as PDF and PNG files
โ”‚   โ”‚   โ”œโ”€โ”€ Cat_00_stomach.pdf
โ”‚   โ”‚   โ”œโ”€โ”€ Cat_00_stomach.png
โ”‚   โ”‚   โ”œโ”€โ”€ Cat_00_stomach.svg
โ”‚   โ”‚   โ””โ”€โ”€ [more labels]
โ”‚   โ”œโ”€โ”€ dataset_settings.json  % Structured information about the dataset (e.g. label mapping for the blosc segmentations below)
โ”‚   โ””โ”€โ”€ meta.schema  % JSON Schema defining the structure of the *_meta.json annotation files (possible attributes and types)
โ”‚
โ””โ”€โ”€ intermediates/ % Processed animal data
    โ”œโ”€โ”€ preprocessing/  % Preprocessed files per image
    โ”‚   โ”œโ”€โ”€ L1/  % L1 normalized data cubes as float16 suitable for network training
    โ”‚   โ”‚   โ”œโ”€โ”€ RXXX#YYYY_MM_DD_HH_MM_SS#0202-00118.blosc  % Compressed binary data
    โ”‚   โ”‚   โ””โ”€โ”€ [more images]
    โ”‚   โ””โ”€โ”€ parameter_images/  % Tissue parameter images as dictionary of float32 data (StO2, NIR, TWI, OHI, TLI, THI, background)
    โ”‚       โ”œโ”€โ”€ RXXX#YYYY_MM_DD_HH_MM_SS#0202-00118.blosc  % Dictionary of compressed binary data
    โ”‚       โ””โ”€โ”€ [more images]
    โ”œโ”€โ”€ profiles/  % pdf documents with visualizations comparable to the paper (supplement figure 5+, referred to as profiles), but per image instead of aggregated over the dataset
    โ”‚   โ”œโ”€โ”€ polygon#annotator1/  % Profile documents for annotator 1
    โ”‚   โ”‚   โ”œโ”€โ”€ polygon#annotator1@00_stomach.pdf  % Profiles for all stomach images of annotator 1
    โ”‚   โ”‚   โ””โ”€โ”€ [more labels]
    โ”‚   โ”œโ”€โ”€ polygon#annotator2  % Profile documents for annotator 2
    โ”‚   โ””โ”€โ”€ polygon#annotator3  % Profile documents for annotator 3
    โ”œโ”€โ”€ rgb_crops/  % Same RGB images as in the data folder but without the black border (shape 480 x 640)
    โ”‚   โ”œโ”€โ”€ RXXX/
    โ”‚   โ”‚   โ”œโ”€โ”€ RXXX#YYYY_MM_DD_HH_MM_SS#0202-00118.png
    โ”‚   โ”‚   โ””โ”€โ”€ [more images]
    โ”‚   โ””โ”€โ”€ [more subjects]
    โ”œโ”€โ”€ segmentations/  % Annotation masks per image as dictionary with annotation name as key and label mask as value. The label mask is an np.ndarray of type uint8 and shape 480 x 640. It contains a unique label index for each pixel and combines all available annotations for this image (in case more than one label is annotated). The dataset_settings.json file describes the meaning of the label indices
    โ”‚   โ”œโ”€โ”€ RXXX#YYYY_MM_DD_HH_MM_SS#0202-00118.blosc
    โ”‚   โ””โ”€โ”€ [more subjects]
    โ”œโ”€โ”€ tables/  % Tables with aggregated data
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator1.csv  % Table with precomputed median spectra (unnormalized, L1-normalized and standard deviation). One row corresponds to a single label of one image annotated by annotator 1. Additional meta information is included as well (e.g. meta information about the recording)
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator1.feather  % Same table as the above CSV file but stored in the feather format (smaller file size and faster to read from within Python)
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator2.csv
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator2.feather
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator3.csv
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@median_spectra@polygon#annotator3.feather
    โ”‚   โ”œโ”€โ”€ HeiRodSPECTRAL@meta.csv
    โ”‚   โ””โ”€โ”€ HeiRodSPECTRAL@meta.feather  % Structured meta information about an image. This table is required by the htc framework and there is usually no need to load it manually (the median spectra tables includes the meta information as well)
    โ””โ”€โ”€ view_organs/  % Interactive visualizations for each image showing the annotated polygons for all annotators and the corresponding median spectra. You can open any document and use the navigation bar to open any image from the dataset
        โ”œโ”€โ”€ xx_organ/  % All images which contain this organ (an image may be part of two organ folders if it contains multiple annotated regions)
        โ”‚   โ”œโ”€โ”€ RXXX#YYYY_MM_DD_HH_MM_SS#0202-00118.html
        โ”‚   โ””โ”€โ”€ [more images]
        โ””โ”€โ”€ [more labels]

Please also have a look at the file reference tutorial from the HeiPorSPECTRAL Dataset, which contains detailed information about the different file formats and examples of how to read them in Python.

Frequently Asked Questions

Where can I find the raw spectral data?
The YYYY_MM_DD_HH_MM_SS_SpecCube.dat file (contained within data/subjects/R0xx/YYYY_MM_DD_HH_MM_SS) is the file that contains the raw spectral data with reflectance values for each band and pixel position. Each data cube has the dimensions (480, 640, 100) = (height, width, channels) with the 100 spectral channels being in the range from 500 nm to 1000 nm at a spectral resolution of around 5 nm.
Why are the individual rats (subjects) named R002 to R024 in the dataset, but not in the figures of the manuscript?
The published data is part of a prospectively growing database for hyperspectral recordings in rats. In the future, we plan to make more data accessible. In order to allow other research groups to continuously make use of our published datasets and even combine these, it is essential to precisely indicate which datasets have been obtained from which uniquely identifiable animal. In the manuscript and the figures, animals were labeled R01 to R13 in order to avoid confusion for the regular reader. The following table maps each subject identifier from the paper to the subject identifier in the dataset. This table is also provided on the repository website.
subject identifier (manuscript) subject identifier (dataset) date of recordings number of organs recorded sex
R01 R002 2023_09_19 30 f
R02 R003 2023_09_20 31 f
R03 R014 2023_10_03 31 f
R04 R015 2023_10_04 31 f
R05 R016 2023_10_05 31 f
R06 R017 2023_10_10 31 f
R07 R018 2023_10_11 31 f
R08 R019 2023_10_15 31 f
R09 R020 2023_10_19 31 f
R10 R021 2023_10_24 31 f
R11 R022 2023_10_25 31 f
R12 R023 2023_10_26 31 f
R13 R024 2023_10_31 31 f
Do I need licensed software to work with the dataset?
The TIVITAยฎ software is proprietary and especially the underlying formulas for the parameter image computation are unfortunately protected. However, by providing the (numerical) parameter images, extensive interactive visualizations of the data and our code repository, we made sure that the TIVITAยฎ software is not needed for working with our dataset.
What is L1-normalization and why do you use it for all your analysis?
L1-normalization describes a normalization technique that accounts for multiplicative illumination changes arising, for example, from fluctuations in the measurement distance. Given a vector with 100 reflectance values, L1 normalization divides by the L1-norm of the spectra, i.e., the absolute sum of every reflectance value. In Numpy, this can be achieved via
# data.shape = [480, 640, 100]
data = data / np.linalg.norm(data, ord=1, axis=-1, keepdims=True)
data = np.nan_to_num(data, copy=False)

As a consequence, the sum of absolute values for each spectrum will be 1 after this operation. Please note that negative reflectance values are possible due to white and dark calibration. Normalization is crucial when working with spectral data as it can eliminate unwanted differences and shift the focus on important aspects. We demonstrate in the paper that only with normalization the measured reflectance values are comparable to spectrometer measurements (which are the gold standard). This is why we exclusively perform our analyses with normalized data. Preprocessed normalized data for every HSI cube is stored in intermediates/preprocessing/L1.

Why are the L1 preprocessed cubes stored in float16 instead of float32?
The intermediates folder is optimized towards fast data loading for deep learning applications. For this, it is crucial to load the raw data as fast as possible. float16 significantly reduces the file size while we found the loss in precision to be neglectable (detailed precision analysis can be found in this notebook). Please note that it is still possible to cast the data to float32 after loading to increase precision for subsequent operations.
What do the index values StO2, NIR, THI, TWI, OHI and TLI mean?
The color-coded indexes were developed and published by the scientific employees of the HSI camera manufacturer Diaspective Vision in the article Hyperspectral imaging in perfusion and wound diagnostics โ€“ methods and algorithms for the determination of tissue parameters. The parameter details are confidential, but will be shared by the manufacturer upon reasonable request after signing a non-disclosure agreement.
  • Tissue oxygenation index (StO2): oxygen saturation of the tissue microcirculatory system
  • Near-infrared perfusion index (NIR): perfusion of deeper tissue regions (up to several mms) which depends both on the oxygen saturation as well as the hemoglobin distribution.
  • Tissue hemoglobin index (THI): amount of hemoglobin distributed in the tissue; specifically designed for skin tissue.
  • Tissue water index (TWI): amount of water present in the tissue.
  • Organ hemoglobin index (OHI): amount of hemoglobin distributed in the tissue; specifically designed for organ tissue and linearly related to the THI.
  • Tissue lipid index (TLI): amount of lipids in the tissue.
Where do I find the index values (StO2, NIR, THI, TWI, OHI and TLI) of each recording in the dataset?
The color-coded index images can be found in the image folders in: data/subjects/R0XX/YYYY_MM_DD_HH_MM_SS. The raw data of the computed values can be found in: intermediates/preprocessing/parameter_images
How was the absorbance estimated?
The absorbance was approximated through the negative natural logarithm of the reflectance values based on the modified Beer-Lambert law.
How are RGB images reconstructed from the HSI data?
RGB images are reconstructed from the HSI data by aggregating the spectral channels in the ranges of 530โ€“560โ€ฏnm, 540โ€“590โ€ฏnm, and 585โ€“725โ€ฏnm for blue, green, and red, respectively.
Are data from all organs of each rat recorded, or is any organ data missing?
As Figure 3 of the paper transparently depicts, the ligament data from Rat R002 (in the paper R01) is the only data missing completely. Additionally, the following recordings are missing:
  • Rat R002: four images of the trachea (situs 1, angle 2, all repetitions) and (situs 3, angle 2, repetition 2)
  • Rat R003: one image of the bladder (situs 2, angle 3, repetition 3), one of the lung (situs 1, angle 2, repetition 3), and one of the pleura (situs 1, angle 2, repetition 3).
The rest of the dataset is complete.
Do all images show physiological organs?
Every annotated region is physiological and this is true for most unannotated regions as well. However, we always design our animal experiments to cover as many studies as possible to limit the total number of animal experiments (3 Rโ€™s principles for animal experiments: Replace, Reduce, Refine). For this reason, it is possible that in some images, side effects from other studies are visible.

If you have any additional questions about the dataset or its usage, feel free to head over to https://github.com/IMSY-DKFZ/htc and connect with us ๐Ÿ˜Š Alternatively, you can contact us at info@spectralverse-heidelberg.org.

License

Creative Commons License
This dataset is made available under the Creative Commons Attribution 4.0 International License (CC-BY 4.0). If you whish to use or reference this dataset, please cite our (future) paper

Data Protection (GDPR)

Neither this website nor any of its subdomains process any user data. No access logs are created. Files are served via the servers of all-inkl.com.

Acknowledgements

We acknowledge the data storage service SDS@hd supported by the Ministry of Science, Research and the Arts Baden-Wรผrttemberg (MWK) and the German Research Foundation (DFG) through grant INST 35/1314-1 FUGG and INST 35/1503-1 FUGG. This project has received funding from the European Research Council (ERC) under the European Unionโ€™s Horizon 2020 research and innovation programme (NEURAL SPICING, Grant agreement No. 101002198) and was supported by the German Cancer Research Center (DKFZ) and the Helmholtz Association under the joint research school HIDSS4Health (Helmholtz Information and Data Science School for Health). It further received funding from the Surgical Oncology Program of the National Center for Tumor Diseases (NCT) Heidelberg and the structured postdoc program of the NCT. In addition, funding was recieved by the Else-Krรถner-Fresenius-Stiftung through grant 2021_EKEA.166.