code: def diff(
      files,
      header_fields="all",
      data_max_abs_diff=None,
      data_max_rel_diff=None,
      dtype=np.float64,
  ):
      assert len(files) >= 2, "Please enter at least two files"
  
      file_headers = [nib.load(f).header for f in files]
  
      # signals "all fields"
      if header_fields == "all":
          # TODO: header fields might vary across file types,
          # thus prior sensing would be needed
          header_fields = file_headers[0].keys()
      else:
          header_fields = header_fields.split(",")
  
      diff = get_headers_diff(file_headers, header_fields)
  
      data_md5_diffs = get_data_hash_diff(files, dtype)
      if data_md5_diffs:
          # provide details, possibly triggering the ignore of the difference
          # in data
          data_diffs = get_data_diff(
              files,
              max_abs=data_max_abs_diff,
              max_rel=data_max_rel_diff,
              dtype=dtype,
          )
          if data_diffs:
              diff["DATA(md5)"] = data_md5_diffs
              diff.update(data_diffs)
  
      return diff
  
file_path: nibabel/nibabel/cmdline/diff.py
imports: import hashlib
  import os
  import re
  import sys
  from collections import OrderedDict
  from optparse import Option, OptionParser
  import numpy
  import nibabel
  import nibabel.cmdline.utils
label_desc: Use image node_id 7 for calling a global function with example usage: diff(files, header_fields, data_max_abs_diff, data_max_rel_diff, dtype) and returns: diff