Importing Annotations Guide

You can import all annotation types that are supported in RedBrick AI, including segmentations, classifications, bounding boxes, and more. Imported annotations will appear automatically on your annotator's interface.

To import images along with segmentations, you must provide us with:

  1. Images in any supported format and NIftI segmentation files.

  2. An items list that provides a mapping of:

    • Segmentation files to volumes so that segmentations are applied to correct images.

    • Values within segmentation file to taxonomy categories.

Items list for importing segmentations

You can find the full format reference here. In this section, we will focus on importing segmentations. In the examples below, pay attention to the following fields:

  1. segmentations: The segmentation files to be applied to the task.

  2. segmentMap: Map the values present in the segmentation files to their corresponding taxonomy categories.

I: One segmentation file per task

{
    "name": "...", 
    "series": [
        {
            "items": ["instance-01.dcm", "instance-02.dcm", ...],
            "segmentations": "segmentation.nii.gz",
            
            
            "segmentMap": {
                "1": "category-a", 
                "2": "category-b"
            }
        }
    ]
}

II: Multiple segmentation files per task

Sometimes, segmentations for a single volume are stored in multiple segmentation files, but these segmentation files are not binary masks. In this case, follow the format below.

{
    "name": "...", 
    "series": [
        {
            "items": ["instance-01.dcm", "instance-02.dcm", ...],
            
            
            "segmentations": ["segmentation-1.nii.gz", "segmentation-2.nii.gz"]
            
            
            "segmentMap": {
                "1": "category-a", 
                "2": "category-b"
            }
        }
    ]
}

Common mistakes for I and II.

III: Multiple binary segmentation files per task

A common pattern is to store each segmentation instance in a separate NIfTI file as a binary mask. In the example below, all non-zero values in segmentation-1.nii.gz are meant to correspond to the taxonomy category category-a.

{
    "name": "...", 
    "series": [
        {
            "items": ["instance-01.dcm", "instance-02.dcm", ...],
            
            
            "segmentations": ["path/segmentation-1.nii.gz", "path/segmentation-2.nii.gz"]
            "segmentMap": {
            
                
                "1": {
                
                    
                    "category": "category-a", 
                    
                    
                    "mask": "path/segmentation-1.nii.gz",                 
                }, 
                "2": {
                    "category": "category-b", 
                    "mask": "path/segmentation-2.nii.gz"
                }, 
                
                
                "binaryMask": true,
            }
        }
    ]
}

Last updated

Was this helpful?