code: def scanner_coords(xyz, affine, from_world, to_world):
      Tv = np.dot(from_world, np.dot(affine, to_world))
      XYZ = apply_affine(Tv, xyz)
      return XYZ[:, 0], XYZ[:, 1], XYZ[:, 2]
  
imports: import os
  import warnings
  import numpy
  from nibabel import io_orientation
  from nibabel.affines import apply_affine
  from ...core.image.image_spaces import as_xyz_image, make_xyz_image, xyz_affine
  from ...io.nibcompat import get_header
  from ..slicetiming import timefuncs
  from ._registration import _cspline_sample3d, _cspline_sample4d, _cspline_transform
  from .affine import Affine, Rigid
  from .optimizer import configure_optimizer, use_derivatives
  from .type_check import check_type, check_type_and_shape
label_desc: Use image node_id 2 for calling a global function with example usage: scanner_coords(xyz, affine, from_world, to_world) and returns: XYZ,  XYZ,  XYZ