DICOM, NRRD and NIfTI volumes

CT and MRI scans arrive as DICOM series, NRRD or NIfTI files. Supervisely stores them as NRRD volumes and keeps every 3D mask as an NRRD file of its own.

Data
Medical volumes
Labels
MasksBoxes
Files
.dcm, .nrrd, .nii, .nii.gz
Import / export
Yes / Yes
The format

What is the DICOM, NRRD & NIfTI format?

DICOM is the standard for medical images: a CT or MRI series is a set of .dcm slices with patient and acquisition data. NRRD keeps a whole volume, or a 3D mask, in one file with a text header that describes its dimensions, spacing and orientation. NIfTI (.nii, .nii.gz) is another single-file volume format, and segmentation masks often come as NIfTI files next to the scans.

Supervisely stores volumes as NRRD: DICOM series are converted to NRRD on import. Annotations are Supervisely volume JSON, with 2D figures on the slices of the planes and 3D masks in spatialFigures; the data of every mask_3d is saved as an .nrrd file in the mask folder.

Files

Folder structure and an example

Supervisely volume project
project_name
├── dataset_name
│   ├── ann
│   │   └── CTChest.nrrd.json
│   ├── mask
│   │   └── CTChest.nrrd
│   │       └── daff638a423a4bcfa34eb12e42243a87.nrrd
│   └── volume
│       └── CTChest.nrrd
├── key_id_map.json
└── meta.json
NIfTI masks grouped by volume name
dataset_name
├── CTChest              # the masks of CTChest, one file per class
│   ├── lung.nii.gz
│   └── tumor.nii.gz
├── CTChest.nii.gz
└── Spine.nii.gz         # a volume without annotations
ann/CTChest.nrrd.json, a 3D mask
{
  "key": "bfed5ee444d849118d7aabc350248cb8",
  "tags": [],
  "objects": [
    { "key": "6c1587f381bf419e9d5c2ebd5967e28f", "classTitle": "lung_mask3d", "tags": [] }
  ],
  "planes": [],
  "spatialFigures": [
    {
      "key": "daff638a423a4bcfa34eb12e42243a87",
      "objectKey": "6c1587f381bf419e9d5c2ebd5967e28f",
      "geometryType": "mask_3d",
      "geometry": {
        "mask_3d": { "data": "H4sIAGW9OmUC ... CYAE1Nj5QMACwC", "space_origin": [194, 218, -348] },
        "shape": "mask_3d",
        "geometryType": "mask_3d"
      }
    }
  ]
}
In and out

Import and export DICOM, NRRD & NIfTI in Supervisely

Import DICOM, NRRD & NIfTI into Supervisely

  • Import DICOM Volumes

    Imports DICOM series and NRRD files without annotations, in any folder structure, converting DICOM to NRRD. Enterprise users can upload from a folder on their own computer through an agent.

  • Import data: NIfTI

    Imports .nii and .nii.gz volumes with semantic or instance segmentation masks, grouped by volume name or by plane.

  • Import Volumes in Supervisely format

    Imports NRRD volumes with Supervisely annotations and their NRRD masks. Old STL interpolations become 3D masks.

  • Import data: .NRRD, .DCM

    Drops volumes into a single dataset, without annotations.

Export from Supervisely to DICOM, NRRD & NIfTI

  • Export Volumes with 3D Annotations

    Exports volumes and masks as NRRD, which open in 3D Slicer and MITK: instance masks per object, a semantic mask with class2idx.json, NIfTI as an option, and STL or OBJ meshes.

  • Export volume project to cloud storage

    Copies a volume project in Supervisely format to Amazon S3, Google Cloud Storage, Azure or another S3-compatible storage, from a private instance.

All apps are in the Ecosystem, under Import and Export. Every project is stored in Supervisely JSON in between.

Conversion

Converting DICOM, NRRD & NIfTI to and from Supervisely JSON

DICOM, NRRD & NIfTISupervisely JSONNotes
DICOM series (.dcm)NRRD volume in volume/Converted on import.
NRRD 3D maskmask_3d in spatialFiguresIts data is the file mask/<volume>/<figure key>.nrrd.
NIfTI mask named after a class (lung.nii.gz)mask_3d objects of that classEach value in the mask is a separate object.
slice of an axial, coronal or sagittal planebitmap or rectangle in planes[].slices[]
instance and semantic NRRD or NIfTI masksevery object of the volumeOn export, objects that are not 3D masks are also written as 3D masks.