Skip to content

supervisely-ecosystem/export-volume-project

Repository files navigation

Export Volumes with 3D Annotations

OverviewWhat's newHow To RunHow To Use

GitHub release (latest SemVer) views runs

Overview

🔥 All 3D data is exported as .nrrd for compatibility with other popular medical viewers, so that once downloaded, the volume and masks can be opened in specialized software like MITK and 3D Slicer without any further action!

You can export as a whole Supervisely project or only as a dataset. To learn more about the format and its structure read documentation.

Application key points:

  • Export annotations in .json and .nrrd formats
  • Export volumes data in .nrrd format
  • Export Instance segmentation as Mask3D for every non-Mask3D object in .nrrd format
  • Instance segmentation masks are duplicated with human-readable file names for convenience
  • Export Semantic segmentation as a single Mask3D for all objects in .nrrd format
  • Semantic segmentation generates class2idx.json mapping, e.g. {"lung": 1, "brain": 2}

💡 If you will download only annotations, i.e. all available checkboxes will be turned off, the project structure will contain the volume directory with empty (zero-sized) volumes .nrrd files. This is not a bug, but a special solution for displaying the format in which you will need to substitute volumes when uploading them to the platform.

Volumes Data in Supervisely format Exported .nrrd with 3D segmentation mask

What's new

Version v2.3.1

  • 🏷️ Support for a new format for storing Mask3D objects geometry as .nrrd files in the mask directory. To learn more read this article.
  • ℹ️ Automatic conversion of .stl closed mesh surface interpolations to Mask3D when exporting. STL files will be saved in the project interpolation folder, but cannot be re-imported in future as closed mesh surfaces due to format obsolescence.

How To Run

  1. Add Export volumes project in Supervisely format

  2. Run the app from the context menu of Volume Project or Volumes DatasetDownload via appExport Supervisely volume project in Supervisely format

    context menu
  3. Define export settings in the modal window and press the Run button

    export settings

How To Use

  1. Wait for the app to process your data, and then the download link will become available 2023-06-13_18-38-53

  2. The resulting archive will be available for download by the link at the Tasks page or from Team Files by the following path:

  • Team Filestmpsuperviselyexportexport-supervisely-volumes-projects<task_id>_<projectId>_<projectName>.tar

    2023-06-13_18-28-51

Output project structure:

📦project.tar
 └──📂project_dir
     ├──📂dataset_1
     │   ├──📂ann
     │   │   ├──📜CTChest.nrrd.json
     │   │   └──📜...
     │   ├──📂interpolation (optional)
     │   │   └──📂CTChest.nrrd
     │   │       ├──📜9aab4ddf1ddb4af1836006f0f1a3a694.stl
     │   │       └──📜...     
     │   ├──📂mask
     │   │   ├──📂CTChest.nrrd
     │   │   │   ├──📂human-readable-objects
     │   │   │   │   └──📜lung_object_001.nrrd
     │   │   │   ├──📜86a6bd27d358440fb97783f5fc7fec57.nrrd
     │   │   │   ├──📜9aab4ddf1ddb4af1836006f0f1a3a694.nrrd
     │   │   │   └──📜semantic_segmentation.nrrd
     │   │   └──📂...
     │   └──📂volume
     │       ├──📜CTChest.nrrd
     │       └──📜...
     ├──📜class2idx.json
     ├──📜key_id_map.json
     └──📜meta.json

How to import annotations into 3D Slicer

All 3D annotations exported with this application are 3D models in NRRD format and have the same dimensions as its volume.

3dmasks_explanation

We can also export objects with any shape as voxelized annotations using option Additionally, save each object in Mask3D format (instance segmentation) in the modal window of this application or Additionally, save all objects as one in Mask3D format (semantic segmentation)

Annotations before the exporting with mask and polygon shapes:

other_shapes

The same annotations after exporting with the option mentioned before:

3dmask_shapes

Representation in 3D Slicer:

3dmask_shapes_slicer

Import steps:

  1. Take volume at path 📂project_dir → 📂dataset_1 → 📂volume → 📜CTChest.nrrd
  2. Take annotations at path 📂project_dir → 📂dataset_1 → 📂mask → 📂CTChest.nrrd → 📜86a6bd27d358440fb97783f5fc7fec57.nrrd (for example)
  3. Load this files into 3D Slicer
  4. Then select Volume Rendering and enable visibility for each desired volume. You can also customize presets in the Display menu to adjust its visibility.

Import.Example.mp4