dipy logo

Site Navigation

NIPY Community

Previous topic

dipy.tracking.propagation

Next topic

dipy.tracking.vox2track

dipy.tracking.propspeed

Track propagation performance functions

dipy.tracking.propspeed.eudx_both_directions()
Parameters :

seed : array, shape(3,), point where the tracking starts

ref : long int, which peak to follow first

qa : array, shape(Np,), float, quantitative anisotropy matrix,

where Np the number of peaks, found using self.Np :

ind : array, shape(Np,), float, index of the track orientation

total_weight : double

Returns :

track : array, shape(N,3)

dipy.tracking.propspeed.ndarray_offset()

find offset in an ndarray using strides

Parameters :

indices : array, shape(N,), indices of the array which we want to

find the offset :

strides : array, shape(N,), strides

lenind : int, len(indices)

typesize : int, number of bytes for data type e.g. if double is 8 if

int32 is 4 :

Returns :

offset : integer, offset from 0 pointer in memory normalized by dtype

Examples

>>> import numpy as np
>>> from dipy.tracking.propspeed import ndarray_offset
>>> I=np.array([1,1])
>>> A=np.array([[1,0,0],[0,2,0],[0,0,3]])
>>> S=np.array(A.strides)
>>> ndarray_offset(I,S,2,8)
4
>>> A.ravel()[4]==A[1,1]
True