code: def load_nifti(
      fname,
      return_img=False,
      return_voxsize=False,
      return_coords=False,
      as_ndarray=True,
  ):
      """Load data and other information from a nifti file.
  
      Parameters
      ----------
      fname : str
          Full path to a nifti file.
  
      return_img : bool, optional
          Whether to return the nibabel nifti img object. Default: False
  
      return_voxsize: bool, optional
          Whether to return the nifti header zooms. Default: False
  
      return_coords : bool, optional
          Whether to return the nifti header aff2axcodes. Default: False
  
      as_ndarray: bool, optional
          convert nibabel ArrayProxy to a numpy.ndarray.
          If you want to save memory and delay this casting, just turn this
          option to False (default: True)
  
      Returns
      -------
      A tuple, with (at the most, if all keyword args are set to True):
      (data, img.affine, img, vox_size, nib.aff2axcodes(img.affine))
  
      See Also
      --------
      load_nifti_data
  
      """
      img = nib.load(fname)
      data = np.asanyarray(img.dataobj) if as_ndarray else img.dataobj
      vox_size = img.header.get_zooms()[:3]
  
      ret_val = [data, img.affine]
  
      if return_img:
          ret_val.append(img)
      if return_voxsize:
          ret_val.append(vox_size)
      if return_coords:
          ret_val.append(nib.aff2axcodes(img.affine))
  
      return tuple(ret_val)
  
imports: from packaging.version import Version
  import nibabel
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: load_nifti(fname, return_img, return_voxsize, return_coords, as_ndarray) and returns: tuple