How to get 3D tensor model with a gradient table different for each slice? #3091
-
Hello, WARNING Noob question alert. I have some multislice diffusion weighted data. I am trying to calculate a tensor model with But I don't have an identical list of Many thanks for any help. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello, could you explain your situation in more detail? What are the shapes of your volume, bvals and bvecs? It would be a little bit inconvenient, since every time you want, for example, a FA image, you would have to run a loop through the slices. However, that is the easiest solution I can think about at the moment. |
Beta Was this translation helpful? Give feedback.
-
Hi @pjsjongsung, Thanks for your reply. I have N slices. For each slice a series of 2D diffusion weighted images. But the number of images, values of bvals and bvecs varies from slice to slice. I was hoping to do the following steps (simplified code): tenmodel = dti.TensorModel(gtab)
tensor_peaks = peaks_from_model(model=tenmodel,...)
streamlines_generator = LocalTracking(tensor_peaks, ...) No problem at all in calculating the tensor model per slice. But at some point I need to stack my data in 3D. I am not sure what is the best way to do that. Do I need to manually stack all the numpy arrays inside the variable |
Beta Was this translation helpful? Give feedback.
-
@pjsjongsung It worked! Many thanks for the help. |
Beta Was this translation helpful? Give feedback.
Yes that sounds about right. You can try concatenating the slice dimension most of the variables (I think peak_indices, peak_values, peak_dirs, gfa, qa and shm_coeff) from tensor_peaks, and then pass it to local tracking. Let us know if it works.