class_docstr: A class for representing and solving predictive models based on
  tractography solutions.
  
  Notes
  -----
  This is an implementation of the LiFE model described in [1]_
  
  [1] Pestilli, F., Yeatman, J, Rokem, A. Kay, K. and Wandell
      B.A. (2014). Validation and statistical inference in living
      connectomes. Nature Methods.
docstr: Helper function to extract and separate all the signals we need to fit
  and evaluate a fit of this model
  
  Parameters
  ----------
  data : 4D array
  
  vox_coords: n by 3 array
      The coordinates into the data array of the fiber nodes.
docstr_tok: ["Helper","function","to","extract","and","separate","all","the","signals","we","need","to","fit","and","evaluate","a","fit","of","this","model","Parameters","--","--","--","--","--","data",":","4D","array","vox_coords",":","n","by","3","array","The","coordinates","into","the","data","array","of","the","fiber","nodes","."]
code: def _signals(self, data, vox_coords):
      """
      Helper function to extract and separate all the signals we need to fit
      and evaluate a fit of this model
  
      Parameters
      ----------
      data : 4D array
  
      vox_coords: n by 3 array
          The coordinates into the data array of the fiber nodes.
      """
      # Fitting is done on the S0-normalized-and-demeaned diffusion-weighted
      # signal:
      idx_tuple = (vox_coords[:, 0], vox_coords[:, 1], vox_coords[:, 2])
      # We'll look at a 2D array, extracting the data from the voxels:
      vox_data = data[idx_tuple]
      weighted_signal = vox_data[:, ~self.gtab.b0s_mask]
      b0_signal = np.mean(vox_data[:, self.gtab.b0s_mask], -1)
      relative_signal = weighted_signal / b0_signal[:, None]
  
      # The mean of the relative signal across directions in each voxel:
      mean_sig = np.mean(relative_signal, -1)
      to_fit = (relative_signal - mean_sig[:, None]).ravel()
      to_fit[np.isnan(to_fit)] = 0
      return (
          to_fit,
          weighted_signal,
          b0_signal,
          relative_signal,
          mean_sig,
          vox_data,
      )
  
imports: import numpy
  import scipy.sparse
  import scipy.linalg
  from dipy.reconst.base import ReconstModel, ReconstFit
  from dipy.tracking.utils import unique_rows
  from dipy.tracking.streamline import transform_streamlines
  from dipy.tracking.vox2track import _voxel2streamline
  import dipy.data
  import dipy.core.optimize
label_desc: Use image node_id 3 for calling the FiberModel obj's underlying member method code with example usage: obj._signals(data, vox_coords) and returns: to_fit,  weighted_signal,  b0_signal,  relative_signal,  mean_sig,  vox_data