Streamlines between two ROI

Dear MRtrix experts,
I created a whole-brain tractograms using pipeline described in BATMAN tutorial. Now, I want to obtain streamlines between the cerebellum and thalamic nuclei. I got masks of cerebellum and thalamus from atlases and transformed them to individual space. I used tckedit

with -include option, but the result is not the one that I aim for. Also, I tried -mask option but it does not show me the connections between two regions.
Here is the result for -include option:

Could you guide me on how can I remove unwanted streamlines that go from thalamus to frontal region?

I did a almost same thing of making a few ROI connectivity.
The extraction of specific bundles is done by tck2connectome and connectome2tck command as know as I know.

1 Like

Thank you for your reply.
I think tck2connectome needs a parcellation image, as I reed in Tutorial. I do not know any atlas that has thalamic nuclei and cerebellum together. I got cerebellum atlas from SUIT package and thalamic nuclei from Morel atlas. Is there any way to combine them?

It’s certainly possible to combine parcellations from different sources (as long as they don’t overlap). But it’s not something for which a push-button command solution is provided: you need to figure out exactly how the images you have need to be combined together in order to produce an image where each parcel contains an integer index label, and the indices of the different parcels increment from 1. So for instance, if you had one image with parcels labelled 1-10, and another with parcels labelled 1-20, you could use mrcalc to add 20 to the values in the first image, then use mrcalc or mrmath to compute the sum across the two images; you would then have a single image with parcels uniquely valued from 1-30.

2 Likes

I followed the instruction, and combined parcellations from different atlases and then registered them to individual space. Then, using tck2connectome and connectome2tck commands, streamlines between thalamus and left dentate nucleus were reconstructed. Now, I think the result seems somehow odd. Based on the literature and biology, I expect more streamlines connecting these two regions. Do you have any idea if I make a mistake in my pipeline? It might be worth mentioning that I used SUIT atlas to extract dentate nucleus.

one more question, in addition to this stage, I want to quantify the results and measure the strength of connectivity between these ROIs. since I am very new to this field can you guide me how to do this? or refer me to the post that has been discussed this issue before?

Hi again,
A short update,
I tried another way to generate streamlines between dentate nucleus and thalamus, I used LDentate as an additional seed image with inclusion of right thalamus. here is the command I used:
tckgen –act 5tt_coreg.mif –backtrack –seed_gmwmi gmwmSeed_coreg.mif -seed_image DentateLeft -include Right_thalamus –select 3000 wmfod_norm.mif tracks_3k.tck
the resulting streamlines

Then, I performed tck2connectome using a numbered ROI image that consists of LeftDentate and RightThalamus and then connectome2tck to see the results. However, no streamlines were reconstructed.
*tck2connectome -symmetric -zero_diagonal -scale_invnodevol tracks_3k.tck LDenRThal.mif DenThal.csv -out_assignment assignments_DenThal.csv *

connectome2tck –nodes 1,2 –exclusive tracks_3k.tck assignments_DenThal.csv DenThal/LDen-LThal.tck

I observed the results more in detail and found that just a few of streamlines are within dentate nucleus mask that seem not terminating in thalamus to be written in connectome2tck step.

Do you have any opinion how can I change the pipeline to get the streamlines?

Hi there,

in my experience, I found that if you tell connectome2tck to return streamlines which are connected to nodes 1 and 2, it will return the streamlines that start or finish in node 1 and 2 but do not necessarily connect the node 1 and 2. So the filtered streamlines can go from node 1 and end somewhere else and the same to node 2, even when using the -exclusive argument.

I wish some expert can propose a solution using this command line… Sometimes I do a custom script to extract the desired streamlines.

1 Like

Then, using tck2connectome and connectome2tck commands, streamlines between thalamus and left dentate nucleus were reconstructed. Now, I think the result seems somehow odd. Based on the literature and biology, I expect more streamlines connecting these two regions.

I tried another way to generate streamlines between dentate nucleus and thalamus, I used LDentate as an additional seed image with inclusion of right thalamus

I think the issue here might relate to the difference in mechanism between how streamlines are assigned to ROIs in tckgen / tckedit, and how streamlines are assigned to parcels in tck2connectome:

  • The former relies entirely on testing whether, for any vertex along the length of the streamline, the voxel in which that vertex resides is included in the corresponding mask. As such, a streamline can intersect a ROI at any point along its length to be included.

  • The latter (by default) deals only with streamlines endpoints, assigning each endpoint individually to the nearest labelled voxel (as long as the distance is less than by default 2mm).

My suspicion is that the dentate nucleus is more-or-less entirely segmented as “white matter” in the 5TT image; as such, streamlines go straight through it, terminate elsewhere, and are consequently not assigned to the parcel corresponding to that structure, because of the mechanism by which that assignment takes place. Therefore for your specific use case the tckedit approach may be preferable. Though if you feel like going down a rabbit-hole you could try tck2connectome with “-assignment_all_voxels” :nerd_face:

one more question, in addition to this stage, I want to quantify the results and measure the strength of connectivity between these ROIs

One day I will publish this manuscript, everyone, I promise :sweat_smile:
@alan-connelly: :pleading_face:
I can’t explain the whole thing here, but I would strongly advise carefully reading the SIFT and SIFT2 manuscripts.

In my experience, I found that if you tell connectome2tck to return streamlines which are connected to nodes 1 and 2, it will return the streamlines that start or finish in node 1 and 2 but do not necessarily connect the node 1 and 2.

Not sure whether or not we disagree on the appropriate usage of the word “connect” :laughing:

Certainly in the context of the discussion here it’s possible for a streamline to traverse a node without being assigned to it; but rather than considering this as a node that is “connected” to the streamline but to which it is not being assigned, I would instead argue that axons don’t synapse in the white matter, and therefore streamlines shouldn’t “connect” to a node underlying which the voxels are segmented as white matter; rather, there is incongruence in imposed prior expectations between the tissue segmentation and the parcellation data :exploding_head:

2 Likes

Hi again,
I tried to fix it with targeted tractography for HCP data and it worked as it can be seen in image below:

Now, I am running a single shell diffusion data (b=0 and b=1000) with lesion, and the pipeline I used for this data is exactly the same as HCP data (except that I merged lesion file with 5tt image ). After preprocessing, I ran these commands :

dwi2response dhollander dwi.mif wm.txt gm.txt csf.txt -voxels voxels.mif

dwi2fod msmt_csd dwi.mif –mask mask.mif wm.txt wmfod.mif gm.txt gmfod.mif csf.txt csffod.mif

5ttgen fsl T1_raw.mif 5tt_nocoreg.mif

(after coregistration of T1 on DWI, I visually checked the result and found the former 5tt was already aligned with DWI and coregistration introduced mismatch between two images, so I continued with initial one)

5ttedit –path segmentedlesion.nii 5tt_nocoreg.mif 5tt _lesion.mif

tckgen -act 5tt_lesion.mif -backtrack -seed_image LDentate.nii.gz -include R_Thalamus.nii.gz -seeds 0 -select 3000 wmfod.mif LDenLRTha1.tck

Here is the screenshot of the result:

As you can see, this is different from what I got from HCP data, I expected to obtain streamlines merely between dentate nucleus and thalamus. Could you tell what might be the problem? and How to fix it?

Additionally, I went through some posts here to see if I can debug it, and I realized that for single shell I should use 2-tissue CSD with WM and CSF instead of three tissues. Therefore, after dwi2response dhollnader, I ran

dwi2fod msmt_csd dwi.mif wm.txt wm_fod.mif csf.txt csf_fod.mif

and tckgen,subsequently. However,that did not change the final result. Another open question for me is: what is the proper way to estimate orientation of fibers for single shell data? Can I use msmt_csd or I have to switch to csd algorithm? If csd, should I change the algorithm used in dwi2response step?

I’d really appreciate any help you can provide.
Thanks

As you can see, this is different from what I got from HCP data, I expected to obtain streamlines merely between dentate nucleus and thalamus. Could you tell what might be the problem? and How to fix it?

It’s not clear from the screenshots alone whether or not this is simply a matter of a difference in data quality.

Mechanistically, I would repeat again that the precise mechanisms used to manipulate the data matter: for instance, by specifying the thalamus as a -include region, it is only necessary for a streamline to intersect that ROI in order to be deemed acceptable and written to the output file, but that doesn’t intrinsically stop such a streamline from continuing to traverse elsewhere. Unless you specify the -stop option, which will terminate any streamline as soon as it has traversed all specified inclusion regions. I also note that you’re tracking from seed to target, but not specifying the -seed_unidirectional option: this means that even if tracking reaches the thalamus and terminates there, tracking then proceeds again from the same seed region in the opposite direction to the original propagation from the seed; so it could be that many streamlines are going from dentate nucleus to thalamus, and being terminated there by the ACT 5TT image, but propagating in the opposite direction from the seed point is then free to go anywhere it can. Especially with single-shell, low b-value data, it’s not too difficult for streamlines to do U-turns near the grey matter and reconstruct two different pathways with the one streamline.

Another open question for me is: what is the proper way to estimate orientation of fibers for single shell data? Can I use msmt_csd or I have to switch to csd algorithm? If csd, should I change the algorithm used in dwi2response step?

We tend to recommend the msmt_csd algorithm with 2 tissues over the original single-tissue csd algorithm; partly for reducing the influence of CSF on the FODs, partly for the hard non-negativity constraint. I’m not sure that we’ve concisely summarised our thoughts on such anywhere… might be a good candidate for some upcoming documentation changes… :zipper_mouth_face: :wink:

Rob

2 Likes

Yes, the MSMT-CSD algorithm can for most scenarios only fit 2 tissues to single-shell data (i.e. b=0 and one non-b=0 shell).

You probably already picked up from a number of other posts throughout the forum (and I recommend anyone do definitely use the search function extensively for much more information on this topic!), but if you were to simply run dwi2fod msmt_csd asking for all 3 tissue types (using all 3 response functions from dwi2response dhollander) on this kind of data, you’d “automagically” see that the GM compartment will be essentially zero everywhere (or values that only differ by a small numerical imprecision from zero). So it’s best to immediately run it only asking for WM and CSF; that way you don’t encounter any other nasty surprises down the track. (e.g. mtnormalise will not play well with such an artificial almost-everywhere-zero’d GM image!)

With methods available in MRtrix3, I personally currently recommend 2-tissue CSD in most scenarios over single-tissue CSD. This will help undo some free water contamination in the signal. The “hard non-negativity constraint” Rob mentions is not per se a different in definition between the original (single-tissue) and the MSMT-CSD method, but more a difference in how they happen to be implemented in MRtrix3. In my personal experience, the hard constraint benefits the robustness of the method somewhat; so it’s a free “win”, if you will. The taking into account free water will have some benefits at your “low” b-value (b=1000), but moreover, I also noticed that:

In those lesions, the CSF-like compartment will likely also help. See a recent preprint from our lab on the topic of lesions: https://www.biorxiv.org/content/10.1101/623124v1.full . You’ll notice that CSF-like signal is present throughout most (if not all) lesion tissue. Note this work was also using single-shell data, though with a higher b-value.

EDIT: changed a crucial 3 to a 2… sorry if I confused anyone in the meantime

1 Like

For future reference, further information on the short bit I mentioned about mtnormalise wrt to an inappropriate zero’d GM image: -nan in response_wm.txt

1 Like

Thank you so much for your explanation.
Briefly, I re-ran some steps again with your recommendations. I use dwi2response dhollander (3-tissue response function) and dwi2fd msmt_csd using 2- tissue (CSF and WM). Then I used tckgen with -stop option and -seed_unidirectional. But the final result was not what I expected. The command is as:
`

tckgen -act 5tt_withlesion_mrtr.mif -stop -seed_image inv_Cerebellum_LDen.nii.gz -include inv_MNI_R_Thalamus.nii.gz -seed_unidirectional -seeds 0 -select 3000 wm_fod_msmt_norm.mif TargetedROI3k_LDenLRTha1.tck

as you can see, It seems that as streamlines intersect with the thalamus, they stop traversing even through other parts of the thalamus which is likely due to the -stop option. Consequently, it is not possible to track the number and distribution of streamlines passing from different regions of thalamus.

In comparison, if we look at the result of another data (from HCP dataset), which I believe is rational, streamlines pass through thalamus but not going to cortical areas. It allows me to segregate different ROIs in subsequent analysis using tckedit.

Moreover, I played with tckgen options like with -backtrack & -seed_unidirectional , -stop without -seed_unidirectional to see any changes. I know try and error is not a rational solution, but sometimes work :grin: not this time :see_no_evil:

I have no idea what to do no. :disappointed:
Do you have any idea what I can do ?

It seems that as streamlines intersect with the thalamus, they stop traversing even through other parts of the thalamus which is likely due to the -stop option.

Yes, this is consistent with my prior description (bold here for emphasis):

… the -stop option, which will terminate any streamline as soon as it has traversed all specified inclusion regions.


In comparison, if we look at the result of another data (from HCP dataset), which I believe is rational, streamlines pass through thalamus but not going to cortical areas. It allows me to segregate different ROIs in subsequent analysis using tckedit.

Do you have any idea what I can do ?

It really depends on precisely what you are trying to achieve. Unfortunately we can’t magically make tractography on clinical data behave identically to tractography on HCP data in all respects; but perhaps if there is a more specific target attribute for the reconstruction, we can tailor and/or bush-mechanic a solution.

For instance, it sounds as though what you’re really looking for is something like:

  1. For streamlines projecting from the dentate nucleus:

  2. Select only those streamlines that intersect the thalamus;

  3. Those streamlines entering the thalamus should not exit it;

  4. The locations of streamlines terminations in the thalamus should be somewhat distributed throughout the volume of the thalamus

Point 1 should be dealt with using -seed_unidirectional; point 2 I would personally use tck2connectome -vector rather than tckgen -include or tckedit -include; points 3 and 4 seem to be what you’re struggling with, but these should be dealt with by ACT (point 3 corresponds to ACT prior #6, and point 4 should somewhat arise due to the subsequent strreamline truncation)?

It really depends on precisely what you are trying to achieve.

Particularly, I want to reconstruct streamlines between the dentate nucleus and the thalamus as part of cerebello-thalamo-cortical pathway and dissociate streamlines passing through different thalamic nuclei in the next step. I took the idea of the whole pipeline from palesi, 2015 with minor differences such as creating and defining ROI.

Unfortunately we can’t magically make tractography on clinical data behave identically to tractography on HCP data in all respects

It raised a question for me. If the using methods are not the same for both datasets, is it meaningful to compare them?

Yes, in sum I can say that I aim to reconstruct just a part of superior cerebellar peduncle (SCP). Therefore, It is possible for a tract to go to the cortical regions after passing through the thalamus and not just terminate there, but the path after thalamus is not my interest.

Frankly, tck2connectome did not work well for my purpose as I wrote in #6. I did not use -vector that time, I’ll try it again. But as you mentioned in #8

I interpreted that since in creating a whole brain tractogram, we use gm/wm interface as a seed and dentate nucleus is more a subcortical region located in wm, streamlines starting from dentate nucleus hardly can be reconstructed. As a result, it is necesary to do a targeted tractography in addition to whole brain tractogram. my primary intention was to :

  1. Whole brain tractogram with seeding from gm/wm boundary
  2. Apply SIFT
  3. Targeted tractography with seed and include options.
  4. Concatenate pathway of interest with whole brain tractogram
  5. Apply SIFT2
  6. Select pathways using tckedit
  7. Compare both groups

One more question, Can the inability of reconstructing the streamlines with this pipeline be explained by the low b-value?

Particularly, I want to reconstruct streamlines between the dentate nucleus and the thalamus as part of cerebello-thalamo-cortical pathway and dissociate streamlines passing through different thalamic nuclei in the next step.

It’s the second half of this (emphasis mine) that I’m trying to get to more closely. I can’t provide assistance based on the names of the white matter pathways in which you are interested; but if I can understand the process that you’re trying to perform, I can provide guidance and/or alternatives.

If the using methods are not the same for both datasets, is it meaningful to compare them?

Depends on what you mean by “compare”. The fact that the datasets are so drastically different means that the degree to which you can compare the results obtained is limited, even if the underlying biology is presumably correct. So I don’t quite know how to answer this; obviously any kind of statistical comparison of outcomes can’t be done if the methods employed are not the only factor being changed between reconstructions.

Therefore, It is possible for a tract to go to the cortical regions after passing through the thalamus and not just terminate there, but the path after thalamus is not my interest.

As stated previously, this shouldn’t be happening if using ACT: once a streamline enters that region, it can’t leave. Whether or not the data exhibit this behaviour has a strong influence on how subsequent steps should be performed, so it’s important to get clarification on exactly what is going on here.

For instance, it’s possible that while it may have initially appeared as though there were streamlines being selected based on your criteria that did not terminate in the thalamus and instead projected to the cortex, this may have been in fact due to the bi-directional nature of streamlines propagation, and by limiting to unidirectional propagation, all selected streamlines would be observed terminating in the thalamus as expected.

I did not use -vector that time, I’ll try it again.

The tck2connectome -vector option is intended to be used in conjunction with tckgen -seed_unidirectional; so if you’re using the latter, the former is likely to be the preferred mechanism.

… since in creating a whole brain tractogram, we use gm/wm interface as a seed …

While GM-WM interface seeding can be used for whole-brain tractogram generation (though not exclusively; interface seeding can also be localised), it’s not the only seeding mechanism that can be used for whole-brain tractogram generation. If you’re having trouble getting adequate reconstruction density in your pathway of interest, I would suggest trying -seed_dynamic instead.

Can the inability of reconstructing the streamlines with this pipeline be explained by the low b-value?

Both the b-value and the inability to perform a 3-tissue decomposition will have an influence on the outcomes of streamlines tractography. But they don’t change the rules; they simply change the quality & attributes of the data. That’s why I’m trying to get to the heart of the underlying processing steps.