code: def test_predict_shape_and_masking():
      resdnn_model = HistoResDNN()
      resdnn_model.fetch_default_weights()
  
      dwi_fname, bval_fname, bvec_fname = get_fnames("stanford_hardi")
      data, _ = load_nifti(dwi_fname)
      data = np.squeeze(data)
      bvals, bvecs = read_bvals_bvecs(bval_fname, bvec_fname)
      gtab = gradient_table(bvals, bvecs)
  
      mask = np.zeros(data.shape[0:3], dtype=bool)
      mask[38:40, 45:50, 35:40] = 1
  
      results_arr = resdnn_model.predict(data, gtab, mask=mask)
      results_pos = np.sum(results_arr, axis=-1, dtype=bool)
      assert_equal(mask, results_pos)
      assert_equal(results_arr.shape[-1], 45)
  
file_path: dipy/dipy/nn/tests/test_histo_resdnn.py
imports: import pytest
  from dipy.core.gradients import gradient_table
  from dipy.data import get_fnames
  from dipy.io.image import load_nifti
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.nn.histo_resdnn import HistoResDNN
  from dipy.utils.optpkg import optional_package
  import numpy
  from numpy.testing import assert_almost_equal, assert_raises, assert_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_predict_shape_and_masking() without return types