Print

Print


Hi Ricardo, what do you mean here: "I then ran the same thing with a set of 32 seeds that included the original 3"
Are you using the CPU tool or the GPU tool? If you are using GPU, try with the CPU tool
What version of FSL are you using?

They are treated independently, so duplicated
No
No,  you are getting zeros in both cases, no?

I do not think so

You can find it inside your distribution ${FSLDIR}/src/ptx2


Moises.




On 14 March 2018 at 10:54, Ricardo Valle <[log in to unmask]> wrote:
Hi Moises,

Thank you for your suggestions.

I have tried warping a few ROIs to diffusion space and running probtrackx on those without the xfm, invxfm and seedref options.

The ROIs are labeled by Freesurfer based on the Destrieux atlas. The labels are then warped onto the volume. I don’t remember which four seeds I was using this weekend. Yesterday, I extracted seeds in the precentral, central and postcentral sulci, and experimented with them. I tried running probtrackx in seed to target mode (—os2t and —s2tastext flags) and got nonzero values for the vast majority of the resulting entries in matrix_seeds_to_all_targets. I then ran the same thing with a set of 32 seeds that included the original 3 and got all 0s in matrix_seeds_to_all_targets. I ran probtrackx in network mode with the original three seeds as well and got all 0s in fdt_network_matrix except for the last column. I tried reordering the seeds in the input text file and got the same pattern of results (all 0s except the last column).

Some questions I have are:
  • How does probtrackx deal with seeds that overlap? The ideal scenario would be to have no overlap between seeds, but right now it seems neighbouring seeds have some overlap, which I presume is due to warping from the surface to the volume and then from structural to diffusion space. 
  • Are tracts originating at voxels shared by two masks discarded? In other words, if a tract originates at a shared voxel and then goes on to pass through non-shared voxels, is this tract counted? 
  • Is this behaviour different in network mode than in seed-to-target mode?
  • Are there any other characteristics of seeds that could give problems to probtrackx? 
  • Would it be possible for me to find the source code for the latest probtrackx version somewhere?

I’ve been rereading the FDT guide and reading questions on the mailing list but I haven’t been able to figure this out. Any insight and other suggestions would be greatly appreciated.

Thank you. Best regards,
Ruy
On Mar 9, 2018, at 12:13 PM, Moises Hernandez <[log in to unmask]> wrote:

Hi Ricardo,

these overlapped streamlines may come from the same ROI, i.e. streamlines visiting ROI_1 are maybe coming only from ROI_1,
so there is not connection between ROIs.

I would try to apply the transformation to the 4 ROIs (seeds) and run probtrackx_gpu directly in diffusion space,
i.e. without xfm and invxfm options.

What are these ROIs? What parcellation?
Are they volumes or surfaces?
How far are one from the other?

On 9 March 2018 at 11:46, Ricardo Valle <[log in to unmask]> wrote:
Hi Moises,

I’ve taken a look at those file. They both seem fine to me. dyads1.nii.gz seems to be oriented correctly and mean_fsumsamples’s values are between 0 and 1 with a long right tail. Is this how its values are expected to be distributed? I can’t find documentation on this file in the FDT user guide.

I don’t think the issue has to do with the ROIs I’ve been using. For testing purposes, I made a script that selects a random subset of ROIs from the Freesurfer parcellation, creates masks for each of them, and runs probtrackx using them. I’ve run this many times with varying numbers of seeds and I consistently get either all 0s in the fdt_network_matrix or non-zero values in the last column and 0s everywhere else. I’ve looked at the seeds and they seem fine to me, although I may be missing something. Something to note about what I tried yesterday is that there is clearly a lot of overlap between every seed and fdt_paths. Shouldn’t this mean that the corresponding matrix entries should be nonzero?

I’ve checked the registration matrices as well by applying them to the corresponding images and the results seem fine. For instance:
flirt -in T1w.nii.gz -ref dti_FA.nii.gz -applyxfm -init str2diff.mat -out T1w_diff

What would you suggest I try? Thank you very much for your help.
Best regards,
Ruy
On Mar 8, 2018, at 7:00 PM, Moises Hernandez <[log in to unmask]> wrote:

Hi Ricardo,

Did you take a look at the bedpostx output?
I would check that the dyads1.nii.gz file (orientations) is correct, 
and that mean_fsumsamples (fraction of anisotropic compartments) makes sense.
You could also draw a mask by hand, with few seeds in the white matter, and check that the tool reconstructs the tracts as expected.

It seems that the only ROI that is reached by the streamlines is the 4th one.
So, there must be something in the data that prevent streamlines to reach the other ROIs.



On 8 March 2018 at 18:32, Ricardo Valle <[log in to unmask]> wrote:
Hi Moises,

Thank you very much for replying so quickly! Very nice picture on your website by the way!

The probtrackx version you linked to solved the —invxfm error. I have rerun probtrackx as follows:
probtrackx2_gpu -s ${HOME}/Documents/diffusion/data.bedpostX/merged -m ${HOME}/Documents/diffusion/data.bedpostX/nodif_brain_mask -x ${HOME}/Documents/diffusion/network/masks/seed_list.txt --dir=${HOME}/Documents/diffusion/network --forcedir --network --xfm=${HOME}/Documents/diffusion/reg/str2diff.mat --seedref=${HOME}/Documents/diffusion/anat/T1w.nii.gz --invxfm=${HOME}/Documents/diffusion/reg/diff2str.mat --opd -P 5 -S 1000

I am attaching the resulting fdt_network_matrix to my email. The matrix is still all 0s except for the last column. I tried to attach a screenshot of fdt_paths.nii.gz and the masks, but they are too large. Both seem fine to me. What do you think might be the issue?

Best regards,
Ruy

On Mar 8, 2018, at 6:29 PM, Ricardo Valle <[log in to unmask]> wrote:

Hi Moises,

Thank you very much for replying so quickly! Very nice picture on your website by the way!

The probtrackx version you linked to solved the —invxfm error. I have rerun probtrackx as follows:
probtrackx2_gpu -s ${HOME}/Documents/diffusion/data.bedpostX/merged -m ${HOME}/Documents/diffusion/data.bedpostX/nodif_brain_mask -x ${HOME}/Documents/diffusion/network/masks/seed_list.txt --dir=${HOME}/Documents/diffusion/network --forcedir --network --xfm=${HOME}/Documents/diffusion/reg/str2diff.mat --seedref=${HOME}/Documents/diffusion/anat/T1w.nii.gz --invxfm=${HOME}/Documents/diffusion/reg/diff2str.mat --opd -P 5 -S 1000

I am attaching the resulting fdt_network_matrix as well as a picture with the resulting fdt_paths.nii.gz and masks overlayed on the T1 image. The matrix is still all 0s except for the last column. What do you think might be the issue?

Best regards,
Ruy
<Screen Shot 2018-03-08 at 6.19.41 PM.png>
<fdt_network_matrix>

On Mar 8, 2018, at 5:29 PM, Moises Hernandez <[log in to unmask]> wrote:

Hi Ricardo,

would you mind to download the last version of the tool and try again?
I have just updated it:
This version should solve the —invxfm error related.

About the 0 values, please let me know if it continues happening.
Several things can be causing it, but most likely:
- ROIs not well defined
- Seeds space to Diffusion space transformations are not good

One thing you can try for checking this is to run the tool with just few samples per seed (-P 5), 
few steps per streamline (-S 5), and generates the path distribution map (--opd).
Then, you can open the nifti file (containing that map) and see from where the streamlines are propagated,
i.e. check if seed points are correct.

Moies.

On 8 March 2018 at 16:34, Ricardo Valle <[log in to unmask]> wrote:
Dear FSL community,

I have been trying to generate a connectivity matrix from a volumetric Freesurfer parcellation. The command I’ve been running is:
probtrackx2_gpu -s ${HOME}/Documents/diffusion/data.bedpostX/merged -m ${HOME}/Documents/diffusion/data.bedpostX/nodif_brain_mask -x ${HOME}/Documents/diffusion/network/masks/seed_list.txt --dir=${HOME}/Documents/diffusion/network/ --forcedir --network --seedref=${HOME}/Documents/anat/T1w.nii.gz --xfm=${HOME}/Documents/diffusion/reg/str2diff.mat

I have run this several times with different seeds listed in seed_list.txt and consistently get an fdt_network_matrix with either all 0s or values in the order of 10^5 or 10^6 in the last column, 0s in the last row, and 0s everywhere else.

I’ve also tried passing —invxfm=${HOME}/Documents/reg/diff2str.mat to probtrackx. This causes the script to crash with a CUDA error that says it’s getting an invalid resource handle.

Do you know why these two things may be happening?

Thank you,
All the best,
Ruy