def _compute_voxel(args):
 from dipy.sims.voxel import multi_tensor
 ffs = args[u'fractions']
 gtab = args[u'gradients']
 signal = np.zeros_like(gtab.bvals, dtype=np.float32)
 sf_vf = np.sum(ffs)
 if (sf_vf > 0.0):
  ffs = ((np.array(ffs) / sf_vf) * 100)
  snr = (args[u'snr'] if (args[u'snr'] > 0) else None)
  try:
   (signal, _) = multi_tensor(gtab, args[u'mevals'], S0=args[u'S0'], angles=args[u'sticks'], fractions=ffs, snr=snr)
  except Exception as e:
   pass
 return signal.tolist()

def _compute_voxel ( args ) : from dipy . sims . voxel import multi_tensor ffs = args [ u'fractions' ] gtab = args [ u'gradients' ] signal = np . zeros_like ( gtab . bvals , dtype = np . float32 ) sf_vf = np . sum ( ffs ) if ( sf_vf > 0.0 ) : ffs = ( ( np . array ( ffs ) / sf_vf ) * 100 ) snr = ( args [ u'snr' ] if ( args [ u'snr' ] > 0 ) else None ) try : ( signal , _ ) = multi_tensor ( gtab , args [ u'mevals' ] , S0 = args [ u'S0' ] , angles = args [ u'sticks' ] , fractions = ffs , snr = snr ) except Exception as e : pass return signal . tolist ( )
simulate dw signal for one voxel .