code: def prepare_arrays(data_images, vardata_images, mask_images):
      from .mask import intersect_masks
  
      # Compute mask intersection
      mask = intersect_masks(mask_images, threshold=1.0)
      # Compute xyz coordinates from mask
      xyz = np.array(np.where(mask > 0))
      # Prepare data & vardata arrays
      data = np.array(
          [
              (d.get_fdata()[xyz[0], xyz[1], xyz[2]]).squeeze()
              for d in data_images
          ]
      ).squeeze()
      if vardata_images is None:
          vardata = None
      else:
          vardata = np.array(
              [
                  (d.get_fdata()[xyz[0], xyz[1], xyz[2]]).squeeze()
                  for d in vardata_images
              ]
          ).squeeze()
      return data, vardata, xyz, mask
  
imports: import numpy
  import scipy.stats
  from nibabel import Nifti1Image
  from nibabel.affines import apply_affine
  from ..algorithms.graph.field import field_from_graph_and_data
  from ..algorithms.graph.graph import wgraph_from_3d_grid
  from ..algorithms.statistics import empirical_pvalue
  from ..io.nibcompat import get_affine
  from .glm import glm
  from .group.permutation_test import permutation_test_onesample, permutation_test_twosample
label_desc: Use image node_id 5 for calling a global function with example usage: prepare_arrays(data_images, vardata_images, mask_images) and returns: data,  vardata,  xyz,  mask