code: def setup_module():
      global subset_b0, subset_dwi_data, subset_t2, subset_b0_img, subset_t2_img, gtab, hardi_affine, MNI_T2_affine
      MNI_T2 = dpd.read_mni_template()
      hardi_img, gtab = dpd.read_stanford_hardi()
      MNI_T2_data = MNI_T2.get_fdata()
      MNI_T2_affine = MNI_T2.affine
      hardi_data = hardi_img.get_fdata()
      hardi_affine = hardi_img.affine
      b0 = hardi_data[..., gtab.b0s_mask]
      mean_b0 = np.mean(b0, -1)
  
      # We select some arbitrary chunk of data so this goes quicker:
      subset_b0 = mean_b0[40:45, 40:45, 40:45]
      subset_dwi_data = nib.Nifti1Image(
          hardi_data[40:45, 40:45, 40:45], hardi_affine
      )
      subset_t2 = MNI_T2_data[40:50, 40:50, 40:50]
      subset_b0_img = nib.Nifti1Image(subset_b0, hardi_affine)
      subset_t2_img = nib.Nifti1Image(subset_t2, MNI_T2_affine)
  
imports: import os.path
  import pytest
  from tempfile import TemporaryDirectory
  import numpy
  import numpy.testing
  import nibabel
  import dipy.data
  import dipy.core.gradients
  from dipy.align import syn_registration, register_series, register_dwi_series, center_of_mass, translation, rigid_isoscaling, rigid_scaling, rigid, affine, motion_correction, affine_registration, streamline_registration, write_mapping, read_mapping, register_dwi_to_template
  from dipy.align.imwarp import DiffeomorphicMap
  from dipy.tracking.utils import transform_tracking_output
  from dipy.io.streamline import save_trk
  from dipy.io.stateful_tractogram import StatefulTractogram, Space
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.io.image import load_nifti
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 1 for calling a global function with example usage: setup_module() without return types