code: def get_bbox_from_mask(mask, outside_value=0):
      mask_voxel_coords = np.where(mask != outside_value)
      minzidx = int(np.min(mask_voxel_coords[0]))
      maxzidx = int(np.max(mask_voxel_coords[0])) + 1
      minxidx = int(np.min(mask_voxel_coords[1]))
      maxxidx = int(np.max(mask_voxel_coords[1])) + 1
      minyidx = int(np.min(mask_voxel_coords[2]))
      maxyidx = int(np.max(mask_voxel_coords[2])) + 1
      return [
          [minzidx, maxzidx],
          [minxidx, maxxidx],
          [minyidx, maxyidx],
      ]
  
imports: import os
  import json
  import shutil
  import pickle
  import numpy
  import SimpleITK
  from scipy.ndimage import binary_fill_holes
  from multiprocessing import Pool
  from collections import OrderedDict
  from .path_utils import join_paths
label_desc: Use image node_id 4 for calling a global function with example usage: get_bbox_from_mask(mask, outside_value) and returns: list