code: def _downcast_from_int64_if_possible(data):
      """Try to downcast to int32 if possible.
  
      If `data` is 64-bit ints and can be converted to (signed) int 32,
      return an int32 copy, otherwise return `data` itself.
      """
      if data.dtype not in (np.int64, np.uint64):
          return data
      img_min, img_max = np.min(data), np.max(data)
      type_info = np.iinfo(np.int32)
      can_cast = type_info.min <= img_min and type_info.max >= img_max
      if can_cast:
          warnings.warn(
              "Data array used to create a new image contains 64-bit ints. "
              "This is likely due to creating the array with numpy and "
              "passing `int` as the `dtype`. Many tools such as FSL and SPM "
              "cannot deal with int64 in Nifti images, so for compatibility the "
              "data has been converted to int32.",
              stacklevel=3,
          )
          return data.astype("int32")
      warnings.warn(
          "Data array used to create a new image contains 64-bit ints, and "
          "some values too large to store in 32-bit ints. The resulting image "
          "thus contains 64-bit ints, which may cause some compatibility issues "
          "with some other tools or an error when saving the image to a "
          "Nifti file.",
          stacklevel=3,
      )
      return data
  
imports: import collections.abc
  import copy
  import itertools
  import warnings
  import nibabel
  import numpy
  from joblib import Memory, Parallel, delayed
  from scipy.ndimage import gaussian_filter1d, generate_binary_structure, label
  from scipy.stats import scoreatpercentile
  from ..None import signal
  from .._utils import _repr_niimgs, as_ndarray, check_niimg, check_niimg_3d, check_niimg_4d, fill_doc
  from .._utils.exceptions import DimensionError
  from .._utils.helpers import rename_parameters, stringify_path
  from .._utils.niimg import _get_data, safe_get_data
  from .._utils.niimg_conversions import _index_img, check_same_fov, iter_check_niimg
  from .._utils.param_validation import check_threshold
  from .._utils.path_finding import resolve_globbing
label_desc: Use image node_id 14 for calling a global function with example usage: _downcast_from_int64_if_possible(data) and returns: data, data, data