Export segmentation or np.array from 3d bounding box

Hello,

I am interested in performing weak labelling using 3d bounding boxes. I know it is possible to use the scissor tool in the Segment Editor to perform this task but I find the MarkupsROI tool easier to use. The file output for the MarkupsROI is either a .json or .fcsv.

  1. Is there a way I can export this as a segmentation instead?
  2. Alternatively, how can I convert the data contained in the MarkupsROI json to obtain a np.array that can be used as a segmentation mask for a given volume ?

Thanks!