code: def apply_affine(x, y, z, affine):
      """Apply the affine matrix to the given coordinate.
  
      Parameters
      ----------
      x: number or ndarray
          The x coordinates
      y: number or ndarray
          The y coordinates
      z: number or ndarray
          The z coordinates
      affine: 4x4 ndarray
          The affine matrix of the transformation
      """
      x = np.atleast_1d(x)
      y = np.atleast_1d(y)
      z = np.atleast_1d(z)
      shape = x.shape
      assert y.shape == shape, "Coordinate shapes are not equal"
      assert z.shape == shape, "Coordinate shapes are not equal"
      # Ravel, but avoiding a copy if possible
      x = np.reshape(x, (-1,))
      y = np.reshape(y, (-1,))
      z = np.reshape(z, (-1,))
  
      in_coords = np.c_[x, y, z, np.ones(x.shape)].T
      x, y, z, _ = np.dot(affine, in_coords)
      x = np.reshape(x, shape)
      y = np.reshape(y, shape)
      z = np.reshape(z, shape)
      return x, y, z
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: apply_affine(x, y, z, affine) and returns: x,  y,  z