code: def test_similarity_derivatives():
      """Test gradient and Hessian computation of the registration
      objective function.
      """
      I = make_xyz_image(
          make_data_int16(dx=100, dy=100, dz=50),
          dummy_affine,
          "scanner",
      )
      J = make_xyz_image(
          np.ones((100, 100, 50), dtype="int16"),
          dummy_affine,
          "scanner",
      )
      R = HistogramRegistration(I, J)
      T = Rigid()
      g = R.eval_gradient(T)
      assert g.dtype == float
      assert_array_equal(g, np.zeros(6))
      H = R.eval_hessian(T)
      assert H.dtype == float
      assert_array_equal(H, np.zeros((6, 6)))
  
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ....core.image.image_spaces import make_xyz_image
  from ....testing import assert_almost_equal
  from .._registration import _joint_histogram
  from ..affine import Affine, Rigid
  from ..histogram_registration import HistogramRegistration
label_desc: Use image node_id 30 for calling a global function with example usage: test_similarity_derivatives() without return types