dipy logo

Site Navigation

NIPY Community

Previous topic

dipy.tracking.metrics

Next topic

dipy.tracking.utils

dipy.tracking.propspeed

Track propagation performance functions

dipy.tracking.propspeed.eudx_both_directions()
Parameters:

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

ref : cnp.npy_intp int, which peak to follow first

qa : array, shape(X,Y,Z,Np), float64, anisotropy matrix,

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

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

total_weight : double

Returns:

track : array, shape(N,3)

dipy.tracking.propspeed.map_coordinates_trilinear_iso()

trilinear interpolation (isotropic voxel size)

Has similar behavior with map_coordinates from scipy.ndimage

Parameters:

data: array, shape (X,Y,Z), numpy.float :

points: array, shape(N,3), numpy.float :

strides: data.strides as one-dimensional array of dtype i8 :

len_points: cnp.npy_intp, number of points to interpolate :

result: array, shape(N), numpy.float of interpolated values from A at points :

Returns:

result: feeds the result, therefore the result parameter should be initialized before :

this function is called

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, element position in array

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,A.dtype.itemsize)
4
>>> A.ravel()[4]==A[1,1]
True