code: def test_histogram_masked_registration():
      """Test the histogram registration class."""
      I = make_xyz_image(
          make_data_int16(dx=100, dy=100, dz=50),
          dummy_affine,
          "scanner",
      )
      J = make_xyz_image(
          make_data_int16(dx=100, dy=100, dz=50),
          dummy_affine,
          "scanner",
      )
      mask = np.zeros((100, 100, 50)) == 1
      mask[10:20, 10:20, 10:20] = True
      R = HistogramRegistration(I, J, to_mask=mask, from_mask=mask)
      sim1 = R.eval(Affine())
      I = make_xyz_image(
          I.get_fdata()[mask].reshape(10, 10, 10),
          dummy_affine,
          "scanner",
      )
      J = make_xyz_image(
          J.get_fdata()[mask].reshape(10, 10, 10),
          dummy_affine,
          "scanner",
      )
      R = HistogramRegistration(I, J)
      sim2 = R.eval(Affine())
      assert sim1 == sim2
  
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 29 for calling a global function with example usage: test_histogram_masked_registration() without return types