code: def plot_segs(image_nii, seg_niis, out_file, bbox_nii=None, masked=False,
                colors=None, compress='auto', **plot_params):
      
      plot_params = {} if plot_params is None else plot_params
  
      image_nii = _3d_in_file(image_nii)
      data = image_nii.get_data()
  
      plot_params = robust_set_limits(data, plot_params)
  
      bbox_nii = nb.load(image_nii if bbox_nii is None else bbox_nii)
      if masked:
          bbox_nii = nlimage.threshold_img(bbox_nii, 1e-3)
  
      cuts = cuts_from_bbox(bbox_nii, cuts=7)
      plot_params['colors'] = colors or plot_params.get('colors', None)
      out_files = []
      for d in plot_params.pop('dimensions', ('z', 'x', 'y')):
          plot_params['display_mode'] = d
          plot_params['cut_coords'] = cuts[d]
          svg = _plot_anat_with_contours(image_nii, segs=seg_niis, compress=compress,
                                         **plot_params)
  
          # Find and replace the figure_1 id.
          try:
              xml_data = etree.fromstring(svg)
          except etree.XMLSyntaxError as e:
              NIWORKFLOWS_LOG.info(e)
              return
          find_text = etree.ETXPath("//{%s}g[@id='figure_1']" % SVGNS)
          find_text(xml_data)[0].set('id', 'segmentation-%s-%s' % (d, uuid4()))
  
          svg_fig = SVGFigure()
          svg_fig.root = xml_data
          out_files.append(svg_fig)
  
      return out_files
docs: plot segmentation as contours over the image (e.g. anatomical).
      seg_niis should be a list of files. mask_nii helps determine the cut
      coordinates. plot_params will be passed on to nilearn plot_* functions. If
      seg_niis is a list of size one, it behaves as if it was plotting the mask.