How to auto export Segmentation-Labels.tiff and Original images from .mrb file?

I have several .mrb files which contain images and segmentation annotations. I currently manually open the .mrb file in 3D slicer and then go to “Data” → “Export visible segments to binary labelmap” → “Save” and then select “Tiff” for the export format for the segmentations. However since there are so many .mrb files, I was wondering if there is an automatic way of exporting all the data quicker.


You can write a Python script to automate this. Probably all the necessary steps are described in the script repository but if there is anything specific that you cannot find then you can ask here.