Download DICOM Segmentation Masks
In previous versions, Hub automatically generated and provided links to ready-made segmentation .png masks for DICOMS in the export. This has now been deprecated.
The following workaround, however, will provide the exact same result.
To obtain masks for annotations created with the Brush tool, simply activate the Mask URLs export field and click on the brushDataUrl URL in the export.
After having uploaded and annotated your DICOM files with a Segmentation labeling tool, go to the Export tab.
In the Export tab, ensure the Segmentation Points toggle in the Fields dropdown is active.
Click on Export to get the export, and save the resulting .json file somewhere you'll remember.
Download this .zip archive containing our scripts to create masks from polygon or segmentation exports. Extract it, and move your .json file to this folder.
With a text editor, open the file
2_segmentation_to_single_mask.py
and replace the placeholder variable contents with your own data.With a terminal, navigate to the folder and run
pip install -r requirements.txt
to install the required packages to run the Python script.Within the terminal, run
python 2_segmentation_to_single_mask.py
to extract a .png mask from your export.
Last updated