Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Inconsistent output for values_from_volume #909
@arokem thanks for that function, really useful. I played a bit more with it and found some corner cases, that haven't been tested. For instance,
from dipy.tracking.streamline import values_from_volume data3D = np.ones((2,2,2)) streamlines = np.ones((10, 2, 3)) values_from_volume(data3D, streamlines).shape >>> (10, 2) # So far so good. streamlines = np.ones((10, 1, 3)) values_from_volume(data3D, streamlines).shape >>> (10,) # I would expect (10, 1) data4D = np.ones((2,2,2,2)) streamlines = np.ones((10, 1, 3)) values_from_volume(data4D, streamlines).shape # Even worst >>> ValueError: bad axis1 argument to swapaxes
I think I found the source of the problem; the
Is the squeeze really necessary?
added a commit
Feb 12, 2016
Thanks for reporting this. As you can see I've started a PR to work on this.
Just to understand how this arises: is this an actual use-case? Do you actually have a situation where you have a bunch of streamlines and each one has just one node? That might be a tractography problem :-)