code: def get_mask_bounds(img):
      """Return the world-space bounds occupied by a mask.
  
      Parameters
      ----------
      img : Niimg-like object
          See :ref:`extracting_data`.
          The image to inspect. Zero values are considered as
          background.
  
      Returns
      -------
      xmin, xmax, ymin, ymax, zmin, zmax : floats
          The world-space bounds (field of view) occupied by the
          non-zero values in the image
  
      Notes
      -----
      The image should have only one connect component.
  
      The affine should be diagonal or diagonal-permuted, use
      reorder_img to ensure that it is the case.
  
      """
      img = _utils.check_niimg_3d(img)
      mask = _utils.numpy_conversions._asarray(
          _get_data(img), dtype=bool
      )
      affine = img.affine
      (xmin, xmax), (ymin, ymax), (zmin, zmax) = get_bounds(
          mask.shape, affine
      )
      slices = find_objects(mask.astype(int))
      if len(slices) == 0:
          warnings.warn("empty mask", stacklevel=2)
      else:
          x_slice, y_slice, z_slice = slices[0]
          x_width, y_width, z_width = mask.shape
          xmin, xmax = (
              xmin + x_slice.start * (xmax - xmin) / x_width,
              xmin + x_slice.stop * (xmax - xmin) / x_width,
          )
          ymin, ymax = (
              ymin + y_slice.start * (ymax - ymin) / y_width,
              ymin + y_slice.stop * (ymax - ymin) / y_width,
          )
          zmin, zmax = (
              zmin + z_slice.start * (zmax - zmin) / z_width,
              zmin + z_slice.stop * (zmax - zmin) / z_width,
          )
  
      return xmin, xmax, ymin, ymax, zmin, zmax
  
file_path: nilearn/nilearn/image/resampling.py
imports: import numbers
  import warnings
  import numpy
  from scipy import linalg
  from scipy.ndimage import affine_transform, find_objects
  from ..None import _utils
  from .._utils import stringify_path
  from .._utils.niimg import _get_data
  from .image import copy_img, crop_img
label_desc: Use image node_id 5 for calling a global function with example usage: get_mask_bounds(img) and returns: xmin,  xmax,  ymin,  ymax,  zmin,  zmax