code: def max_dist(XYZ, I, J):
      """
      Maximum distance between two set of points
      In:  XYZ (3,p) voxels coordinates
           I   (q)   index of points
           J   (r)   index of points
      Out: d <float>
      """
      if min(min(np.shape(I)), min(np.shape(J))) == 0:
          return 0
      else:
          # Square distance matrix
          D = np.sum(
              np.square(
                  XYZ[:, I].reshape(3, len(I), 1)
                  - XYZ[:, J].reshape(3, 1, len(J))
              ),
              axis=0,
          )
          return np.sqrt((D).max())
  
imports: import numpy
  import warnings
  from nipy.algorithms.graph import wgraph_from_3d_grid
  from nipy.algorithms.graph.field import Field, field_from_graph_and_data
  from ..utils import zscore
  from .onesample import stat
  from .onesample import stat_mfx
  from .twosample import stat
  from .twosample import stat_mfx
label_desc: Use image node_id 2 for calling a global function with example usage: max_dist(XYZ, I, J) and returns: int, np