code: def test_mask_from_roi():
      data_shape = (5, 5, 5)
      roi_center = (2, 2, 2)
      roi_radii = (2, 2, 2)
      mask_gt = np.ones(data_shape)
      roi_mask = _mask_from_roi(data_shape, roi_center, roi_radii)
      npt.assert_array_equal(roi_mask, mask_gt)
  
      roi_radii = (1, 2, 2)
      mask_gt = np.zeros(data_shape)
      mask_gt[1:4, 0:5, 0:5] = 1
      roi_mask = _mask_from_roi(data_shape, roi_center, roi_radii)
      npt.assert_array_equal(roi_mask, mask_gt)
  
      roi_radii = (0, 2, 2)
      mask_gt = np.zeros(data_shape)
      mask_gt[2, 0:5, 0:5] = 1
      roi_mask = _mask_from_roi(data_shape, roi_center, roi_radii)
      npt.assert_array_equal(roi_mask, mask_gt)
  
imports: import numpy
  import numpy.testing
  from dipy.reconst.utils import _roi_in_volume, _mask_from_roi
label_desc: Use image node_id 2 for calling a global function with example usage: test_mask_from_roi() without return types