code: def test_slicer(rng):
      scene = window.Scene()
      data = 255 * rng.random((50, 50, 50))
      affine = np.diag([1, 3, 2, 1])
      data2, affine2 = reslice(
          data, affine, zooms=(1, 3, 2), new_zooms=(1, 1, 1)
      )
  
      slicer = actor.slicer(data2, affine2, interpolation="linear")
      slicer.display(None, None, 25)
  
      scene.add(slicer)
      scene.reset_camera()
      scene.reset_clipping_range()
  
      # window.show(scene, reset_camera=False)
      arr = window.snapshot(scene, offscreen=True)
      report = window.analyze_snapshot(arr, find_objects=True)
      npt.assert_equal(report.objects, 1)
      npt.assert_array_equal(
          [1, 3, 2] * np.array(data.shape), np.array(slicer.shape)
      )
  
imports: import warnings
  import pytest
  import numpy
  import numpy.testing
  from dipy.testing.decorators import use_xvfb, set_random_number_generator
  from dipy.utils.optpkg import optional_package
  from dipy.data import get_sphere
  from dipy.align.reslice import reslice
  from dipy.data import read_stanford_labels
  from dipy.reconst.shm import CsaOdfModel
  from dipy.data import default_sphere
  from dipy.direction import peaks_from_model
  from dipy.tracking import utils
  from dipy.tracking.stopping_criterion import ThresholdStoppingCriterion
  from dipy.tracking.local_tracking import LocalTracking
  from dipy.reconst.shm import descoteaux07_legacy_msg, sh_to_sf_matrix
  from dipy.align.tests.test_streamlinear import fornix_streamlines
  from dipy.tracking.streamline import center_streamlines, transform_streamlines
  from dipy.reconst.dti import color_fa, fractional_anisotropy
label_desc: Use image node_id 1 for calling a global function with example usage: test_slicer(rng) without return types