Returns an array representation of an ornt string
Returns a string representation of a 3d ornt
Calculates the mapping needing to get from orn1 to orn2
Read gradient table information from a pair of files with extentions .bvec and .bval. The bval file should have one row of values representing the bvalues of each volume in the dwi data set. The bvec file should have three rows, where the rows are the x, y, and z components of the normalized gradient direction for each of the volumes.
Parameters : | filename : :
atol : float, optional
|
---|
Changes the orientation of a gradients or other vectors
Moves vectors, storted along axis, from current_ornt to new_ornt. For example the vector [x, y, z] in “RAS” will be [-x, -y, z] in “LPS”.
R: Right A: Anterior S: Superior L: Left P: Posterior I: Inferior
Examples
>>> gtab = np.array([[1, 1, 1], [1, 2, 3]])
>>> reorient_vectors(gtab, 'ras', 'asr', axis=1)
array([[1, 1, 1],
[2, 3, 1]])
>>> reorient_vectors(gtab, 'ras', 'lps', axis=1)
array([[-1, -1, 1],
[-1, -2, 3]])
>>> bvec = gtab.T
>>> reorient_vectors(bvec, 'ras', 'lps', axis=0)
array([[-1, -1],
[-1, -2],
[ 1, 3]])
>>> reorient_vectors(bvec, 'ras', 'lsp')
array([[-1, -1],
[ 1, 3],
[-1, -2]])