Replies: 2 comments 5 replies
-
I don't think this issue was ever sorted out. If you plot tensors using Fury, and then plot the first eigenvectors using arrows also in Fury, you can see that there is an issue with the direction. The tensors do not point in the same direction as the eigenvectors. This seems like quite a serious bug? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I think it has been fixed on #552, #555, #551. Can you confirm using FURY master? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From @carpre on January 4, 2018 22:11
Hi,
I did an experiment with 2 gradient tables. The second gradient table is the same than the first but with x and y flipped (-x and -y).
I computed the tensors and tried to plot 3 slices (coronal, axial and sagittal) using vtk as shown in the examples.
I can see that I get different eigen vectors for the 2 gradient tables when I print them.
Original evec
[[[-0.71158536 0.21049986 0.67032535]
[ 0.69739829 0.09573807 0.71026041]
[ 0.08533406 0.97289467 -0.21492805]]]
Flipped evec
[[[-0.71158536 -0.21049986 0.67032535]
[ 0.69739829 -0.09573807 0.71026041]
[-0.08533406 0.97289467 0.21492805]]]
However, I get the exact same tensors for the 3 planes when plotting the same slices.
I am not sure to understand how I can get the same tensors oriented the same way when my evecs are not in the same direction ? If I would have a flip in the 3 axes, it would obviously be the same direction, but not if only 2 out of 3 are flipped ? I did the same processing with MRtrix and there is a clear flip in sagittal when I plot the tensors with mrview.
I assume it's the way I am plotting my tensors, but I can't figure out what's wrong.
This is how I am doing it:
tenmodel = TensorModel(gtab)
tenfit = tenmodel.fit(data)
RGB = color_fa(tenfit.fa, tenfit.evecs)
sphere = get_sphere('symmetric724')
ren = fvtk.ren()
fvtk.add(ren, fvtk.tensor(tenfit.evals[:,:28], tenfit.evecs[:,:28], RGB[:,:28]/RGB[:,:,28].max(), sphere))
fvtk.record(ren, n_frames=1, out_path='out.png', size=(1000, 1000))
For the other planes, I am making sure to give it as a NxMx1x3 or NXMx1x3x3 like so:
evals = tenfit.evals[:, 40:41, :].squeeze()
evecs = tenfit.evecs[:, 40:41, :].squeeze()
rgb = (RGB[:, 40:41, :]/RGB[:, 40:41, :].max()).squeeze()
ren = fvtk.ren()
fvtk.add(ren, fvtk.tensor(evals[:, :, np.newaxis, :], evecs[:, :, np.newaxis, :, :], rgb[:, :, np.newaxis, :], sphere))
Doing that, the tensors look exactly the same in the 3 planes, even though the gradients are suppose to be flipped in x and y and that the evecs are not the same (some signs are different). Any idea what I am doing wrong ?
Also, is there a way to put the corresponding FA slice under the tensors so it's easier to look at ? I tried adding an actor using vtk.add(ren, fvtk.slicer(fa[:, :, 28])) before the tensors, but the FA is not at the right place under the tensors.
Thank you very much for your help :)
Copied from original issue: dipy/dipy#1396
Beta Was this translation helpful? Give feedback.
All reactions