code: def check_params(in_arr, in_type, out_type):
      arr = in_arr.astype(in_type)
      # clip infs that can arise from downcasting
      if arr.dtype.kind == "f":
          info = np.finfo(in_type)
          arr = np.clip(arr, info.min, info.max)
      try:
          arr_dash, slope, inter = round_trip(arr, out_type)
      except (ScalingError, HeaderDataError):
          return arr, None, None, None
      return arr, arr_dash, slope, inter
  
file_path: nibabel/nibabel/tests/test_round_trip.py
imports: from io import BytesIO
  import numpy
  from numpy.testing import assert_array_equal
  from ..None import Nifti1Header, Nifti1Image
  from ..arraywriters import ScalingError
  from ..casting import best_float, sctypes, type_info, ulp
  from ..spatialimages import HeaderDataError, supported_np_types
label_desc: Use image node_id 2 for calling a global function with example usage: check_params(in_arr, in_type, out_type) and returns: arr,  arr_dash,  slope,  inter, arr,  None,  None,  None