b_selection module¶
Filter a set of gradients by direction and bval.

b_selection.
get_acquisitions_by_bval
(bvals, lower, upper)¶ Get bvals within a certain range.
Parameters:  bvals (array_like) – A 1D array of bvalues to be filtered.
 lower (float) – The minimum bvalue to include.
 upper (float) – The maximum bvalue to include.
Returns: Logical index array for bvalues to include.
Return type: array_like

b_selection.
get_acquisitions_by_dir
(bvecs, phi, theta, tolerance)¶ Get bvectors close to a given direction.
Parameters:  bvecs (array_like) – 2D array of bvectors to be filtered.
 phi (float) – Azimuthal angle of the direction, between 0 and 180.
 theta (float) – Polar angle of the point, between 180 and 180.
 tolerance (float) – bvecs with spherical distance less than this tolerance will be included.
Returns: Index array of the bvectors to be included.
Return type: array_like

b_selection.
spherical_distance
(theta1, phi1, theta2, phi2)¶ Get the spherical distance between two points on the unit sphere.
Parameters:  theta2 (theta1,) – Polar angles of the two points, between 0 and pi.
 phi1 (phi1,) – Azimuthal angles of the two points, between pi and pi.
Returns: Spherical distance between the given points.
Return type: float