code: def _roi_in_volume(data_shape, roi_center, roi_radii):
      """Ensures that a cuboid ROI is in a data volume.
  
      Parameters
      ----------
      data_shape : ndarray
          Shape of the data
      roi_center : ndarray, (3,)
          Center of ROI in data.
      roi_radii : ndarray, (3,)
          Radii of cuboid ROI
  
      Returns
      -------
      roi_radii : ndarray, (3,)
          Truncated radii of cuboid ROI. It remains unchanged if
          the ROI was already contained inside the data volume.
      """
  
      for i in range(len(roi_center)):
          inf_lim = int(roi_center[i] - roi_radii[i])
          sup_lim = int(roi_center[i] + roi_radii[i])
          if inf_lim < 0 or sup_lim >= data_shape[i]:
              roi_radii[i] = min(
                  int(roi_center[i]), int(data_shape[i] - roi_center[i])
              )
      return roi_radii
  
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: _roi_in_volume(data_shape, roi_center, roi_radii) and returns: roi_radii