nipy/dipy — pull request #250 by MrBago (2013-09-18 04:37:39+00:00)
Title: Update streamline tools

I've added an affine optional argument to functions in dipy.tracking.utils. With this argument we can use these functions on any (well except streamlines defined in non-linear coordinate systems, but we'll leave that for another day). This is how these functions treat coordinate systems:

1 ) affine and voxel_size are both None
In this case the streamline points are taken to be in voxel coordinates. IE point `[1., 2., 3.]` is in the center of voxel `[1, 2, 3]`.

2) affine is defined. A point at the center of voxel `[i, j, k]` is given by 1np.dot(affine, [i, j, k, 1])`.

3) affine is None and voxel_size is defined. This one is a little weird, but I'd like to keep it, at least for now for backward comparability. The streamlines are taken to be in trackvis coordinates so the center of voxel `[i, j, k]` is at `[i + .5, j + .5, k + .5] * voxel_size`. We might be able to eventually drop this one, but to drop now would break backwards comparability (I use these functions a lot in my work) without an easy replacement to produce the same behavior.

I'm also working on an example with these functions.

Let me know what you guys think.