Importing NRRD Annotations
If you have access to the New Medical Labeling Editor, you may import existing segmentations in the NRRD format, created, for example, using 3D Slicer.
How to Import NRRD Segmentations
Prepare the project ontology
In short, to match the segmentation classes in your NRRD with the segmentation classes on Hub, you'll have to make sure that the schemaId
of the class on Hub matches the SegmentX_LabelValue
value in the header of the NRRD file.
For example, imagine the NRRD segmentation you wish to import has one segmentation class, and you wish for this class to be paired with a class on Ango Hub. This is how you would go about it:
Open the Segmentation NRRD you wish to import into Ango Hub with a text editor. The first few lines (e.g. the file header) will likely look something like this:
Each segmentation class in the NRRD is represented by metadata starting with the prefix
SegmentX
, where X is an index starting from 0. All metadata pertaining to a class will have the same index. What we care about is theSegmentX_LabelValue
value. In this case, since there is only one segmentation, its index will be 0, so we will look atSegment0_LabelValue
only. In our case, this value is 1. We'll take note of that.In the project where you'd like to import the NRRD segmentation, go to the Settings tab, then to the Category Schema section. Create a new Medical Brush tool. By default, schema IDs for Medical Brush tools start at 1, so in this case, since the schema ID matches the number we took note of earlier, there would be no need to change the schema ID.
If we did need to change the schema ID, then we would click on the Show JSON button (1) and change the ID from the JSON that appears to match
SegmentX_LabelValue
's value.
Save your category schema by clicking on Save at the bottom of the page.
Prepare the JSON
Create a JSON with this format:
For Segmentations with Publicly Accessible URLs
Where externalId
is the external ID of the asset to pre-annotate, and medicalBrushDataUrl
is a link to your publicly-accessible NRRD segmentation mask.
If your segmentations are stored in a cloud storage service, ensure the bucket's CORS settings are set properly, or they will not be visible on Hub.
Here is a guide on how to set up CORS in such a way that your masks will be visible.
For Segmentations in Private Buckets
Integrate your private bucket with Ango Hub by following the instructions in the Storages docs page.
Navigate to your organization's Organization page, then navigate to the Storages tab.
Copy the ID of the storage where your brush traces are stored.
Prepare a JSON with the following format:
The JSON will be a list of objects, where each object represents an asset-segmentation pair. The data
and externalId
fields are used by Hub to understand to which asset the prelabels will be imported. You do not need to provide both, either of them is enough.
Upload the JSON
From your project's dashboard, enter the Assets tab, then click on Import. A dialog will pop up.
Drag and drop the JSON you created earlier on the box. Your assets will be prelabeled.
Last updated