code: def img_data_dtype(niimg):
      """Determine type of data contained in image.
  
      Based on the information contained in ``niimg.dataobj``, determine the
      dtype of ``np.array(niimg.dataobj).dtype``.
      """
      dataobj = niimg.dataobj
  
      # Neuroimages that scale data should be interpreted as floating point
      if nibabel.is_proxy(dataobj) and (
          dataobj.slope,
          dataobj.inter,
      ) != (
          1.0,
          0.0,
      ):
          return np.float64
  
      # ArrayProxy gained the dtype attribute in nibabel 2.2
      if hasattr(dataobj, "dtype"):
          return dataobj.dtype
  
      return niimg.get_data_dtype()
  
file_path: nilearn/nilearn/_utils/niimg.py
imports: import collections.abc
  import copy
  import gc
  from pathlib import Path
  from warnings import warn
  import nibabel
  import numpy
  from .helpers import stringify_path
label_desc: Use image node_id 8 for calling a global function with example usage: img_data_dtype(niimg) and returns: niimg, np, dataobj