code: def test_reg(images, coords):
      marker_kwargs = {"marker": "+", "color": (1, 1, 1, 0.1), "s": 50}
      im_kwargs = {"cmap": "gray"}
      title_kwargs = {"fontsize": 20}
      marker_names = [
          "inf insertion point",
          "sup insertion point",
          "RV inf",
      ]
  
      n_samples = len(images)
      fig = plot_multi_images(
          [images[i][0, ...] for i in range(n_samples)],
          n_cols=5,
          marker_locs=coords,
          marker_titles=marker_names,
          marker_cmap="Set1",
          im_kwargs=im_kwargs,
          marker_kwargs=marker_kwargs,
          title_kwargs=title_kwargs,
      )
      assert isinstance(fig, matplotlib.figure.Figure)
      with pytest.raises(Exception):
          reg_img_stack(images, coords[1:, :], coords[0])
      images_reg, max_dist = reg_img_stack(
          images, coords, target_coords=coords[0]
      )
      # images after registration should be close to original images, because values of noise are small
      for i in range(n_samples):
          testing.assert_allclose(images_reg[i], images[i])
      # add one for avoiding inf relative difference
      testing.assert_allclose(
          max_dist + 1, np.ones(n_samples), rtol=2, atol=2
      )
      fig = plot_multi_images(
          [images_reg[i][0, ...] for i in range(n_samples)], n_cols=5
      )
      assert isinstance(fig, matplotlib.figure.Figure)
  
file_path: pykale/tests/prepdata/test_image_transform.py
imports: import os
  import matplotlib.figure
  import numpy
  import pytest
  from numpy import testing
  from kale.interpret.visualize import plot_multi_images
  from kale.loaddata.image_access import check_dicom_series_uid, dicom2arraylist, read_dicom_dir
  from kale.prepdata.image_transform import mask_img_stack, normalize_img_stack, reg_img_stack, rescale_img_stack
label_desc: Use image node_id 3 for calling a global function with example usage: test_reg(images, coords) without return types