Import volumes in NRRD
format with masks in NRRD
format with semantic segmentation labels.
🏷️ Version 1.0.6
- To maintain backwards compatibility with Export Volumes with 3D Annotations application, any Mask3D annotations that were in the project originally will be skipped during the import process. This enhancement is related to the new format for storing Mask3D objects geometry as
.nrrd
files in themask
directory. To learn more read this article. - If you want to import these originally created and exported using Export Volumes with 3D Annotations along with semantic segmentation, please delete the
ann
folder (if present) from the dataset folder of exported project.
🔥 Version 1.0.2
- Object masks import as 3D shape figures, providing convenient editing options across all planes. With this feature, you can easily manipulate object masks in various dimensions, making the editing process more intuitive and efficient.
- Seamless Compatibility with Export Volumes with 3D Annotations. This means that projects exported with Export App can now be directly loaded into this app without any modifications to the project folder structure. This streamlines your workflow, saving you valuable time and effort when transitioning between the two applications. But be careful with the
class2idx.json
, because this application uses its logic to work with classes, which is described in Input Data Structure
The App can be launched from the Ecosystem, Team Files, or Agent.
Run from team files
-
Run the application from the context menu of the folder (right mouse button) on the Team Files page
-
Fill in the project name in the
Result Project Name
field or leave the default value. -
If you want to leave your folder in Team Files after successful import, uncheck the box
Remove temporary files after successful import
below. -
Also, you can set
Advanced settings
such as agent, app version, and others. -
Click the
Run
button to start the App.
Run from ecosystem
-
Click the
Run application
button on the right side of the App page. A modal window will be opened. -
If you want to upload a project folder from your computer, choose
Drag & Drop
option. You can upload the project folder to the drag-and-drop field or you can click on the drag-and-drop field and choose the project from your computer in the opened window. -
If you want to use a project from Team Files, choose the
Team Files
option and choose a folder to use in the app. -
Fill in the project name in the
Result Project Name
field or leave the default value. -
If you want to leave your folder in Team Files after successful import, uncheck the box
Remove temporary files after successful import
below. -
Also, you can set
Advanced settings
such as agent, app version, and others. -
Click the
Run
button to start the App.
Run from agent
The application supports import from a special directory on your local computer. It is made for Enterprise Edition customers who need to upload tens or even hundreds of gigabytes of data without using the drag-and-drop mechanism:
- Run an agent on your computer where data is stored. Watch the how-to video.
- Copy your data to the special folder on your computer that was created by the agent. Agent mounts this directory to your Supervisely instance, and it becomes accessible in Team Files. Learn more in the documentation. Watch the how-to video.
- Go to
Team Files
→Supervisely Agent
and find your folder there. - Right-click to open the context menu and start the App. Now the App will upload data directly from your computer to the platform.
The Project name will not be taken from the root folder name. You should specify the project name in the modal window when you run the App.
Project directory example:
📂my_volumes_project
├──📜class2idx.json (optional)
├──📂dataset_01
│ ├──📂volume
│ │ ├──📜volume_1.nrrd
│ │ ├──📜volume_2.nrrd
│ │ └──📜...
│ └──📂mask
│ ├──📂volume_1.nrrd
│ │ ├──📜mask_1.nrrd
│ │ ├──📜mask_2.nrrd
│ │ └──📜...
│ ├──📂volume_2.nrrd
│ │ ├──📜mask_1.nrrd
│ │ └──📜...
│ └── ...
├──📂dataset_02
│ ├──📂volume
│ │ ├──📜volume_1.nrrd
│ │ └──📜...
│ └──📂mask
│ ├──📂volume_1.nrrd
│ │ ├──📜mask_1.nrrd
│ │ └──📜...
│ └──📂...
└──📂...
class2idx.json
is an optional JSON file containing dictionary { "class_name" (str) : index (int) }
where indexes are values from .nrrd
masks. Don't specify 0
as index in masks (reserved value for not labeled fields).
If you don't provide class2idx.json
, class names will be created automatically (class_1
, class_2
, ...).
💡 Important information
- If the mask in
.nrrd
has more than one value greater than0
- it will be identified as a semantic segmentation - If the mask in
.nrrd
has only one value greater than0
- it will be identified as a single object mask
class2idx.json
example:
{
"brain": 1,
"lung": 2
}
ℹ️ Click here to see class2idx.json
structure in the app versions 1.0.2 - 1.0.5
class2idx.json
is an optional JSON file containing dictionary { "class_name" (str): index (int) }
where indexes start from 1
and increment accordingly the number of masks. If the number of classes is less than the number of masks, classes with the names like class_2
will be created automatically for every mask.
If you don't provide this file, class names will be created automatically (class_1
, class_2
, ...).
💡Сlasses in JSON must be written in the same order as the masks are sorted by name inside the directory.
class2idx.json
example:
{
-
"dataset_01_volume_1_mask_1": 1,
"dataset_01_volume_1_mask_2": 2,
"dataset_01_volume_2_mask_1": 3,
"dataset_02_volume_1_mask_1": 4
Demo Project [72.9 MB] Download
Demo Project [72.4 MB] Download
The demo project contains 1 dataset dataset_01
with 2 volumes:
CTACardio
volume has 2 masks.nrrd
files where each contains 1 object -lung_1
andlung_2
, respectivelyMRHead
volume has 1 mask.nrrd
file with abrain
object- Every volume has a
semantic_segmentation
file with all its masks - Every mask folder contains a
human-readable-objects
folder which is not included in the import process, this folder simply stores duplicates of single masks with human-readable names. This folder is created when you export the project through the Export Volumes with 3D Annotations
If you upload either only semantic_segmentation
or only single masks, after uploading the project should look like this: