code: def sympy_euler2quat(z=0, y=0, x=0):
      # direct formula for z,y,x quaternion rotations using sympy
      # see derivations subfolder
      cos = math.cos
      sin = math.sin
      # the following copy / pasted from Sympy output
      return (
          cos(0.5 * x) * cos(0.5 * y) * cos(0.5 * z)
          - sin(0.5 * x) * sin(0.5 * y) * sin(0.5 * z),
          cos(0.5 * x) * sin(0.5 * y) * sin(0.5 * z)
          + cos(0.5 * y) * cos(0.5 * z) * sin(0.5 * x),
          cos(0.5 * x) * cos(0.5 * z) * sin(0.5 * y)
          - cos(0.5 * y) * sin(0.5 * x) * sin(0.5 * z),
          cos(0.5 * x) * cos(0.5 * y) * sin(0.5 * z)
          + cos(0.5 * z) * sin(0.5 * x) * sin(0.5 * y),
      )
  
file_path: nibabel/nibabel/tests/test_euler.py
imports: import math
  import numpy
  import pytest
  from numpy import pi
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..None import eulerangles
  from ..None import quaternions
label_desc: Use image node_id 9 for calling a global function with example usage: sympy_euler2quat(z, y, x) and returns: unknown,  unknown,  unknown,  unknown