code: def _to_fit_iso(data, gtab, mask=None):
      if mask is None:
          mask = np.ones(data.shape[:-1], dtype=bool)
      # Turn it into a 2D thing:
      if len(mask.shape) > 0:
          data = data[mask]
      else:
          # This handles the corner case of fitting a single voxel:
          data = data.reshape((-1, data.shape[0]))
      data_no_b0 = data[:, ~gtab.b0s_mask]
      nzb0 = data_no_b0 > 0
      nzb0_idx = np.where(nzb0)
      zb0_idx = np.where(~nzb0)
      if np.sum(gtab.b0s_mask) > 0:
          s0 = np.mean(data[:, gtab.b0s_mask], -1)
          to_fit = np.empty(data_no_b0.shape)
          with warnings.catch_warnings():
              warnings.simplefilter("ignore")
              to_fit[nzb0_idx] = data_no_b0[nzb0_idx] / s0[nzb0_idx[0]]
          to_fit[zb0_idx] = 0
      else:
          to_fit = data_no_b0
      return to_fit
  
imports: import warnings
  import numpy
  import gc
  from collections import OrderedDict
  from dipy.utils.optpkg import optional_package
  from dipy.utils.multiproc import determine_num_processes
  import dipy.core.gradients
  import dipy.core.optimize
  import dipy.sims.voxel
  import dipy.data
  from dipy.reconst.base import ReconstModel, ReconstFit
  from dipy.reconst.cache import Cache
  from dipy.core.onetime import auto_attr
label_desc: Use image node_id 1 for calling a global function with example usage: _to_fit_iso(data, gtab, mask) and returns: to_fit