How tck2connectome processes the label 0 in the nodes.mif

Hi there,

I used the tck2connectome with the cortical parcellation result i_brain.mif. The label of i_brain.mif is from 0, which denotes the background, to 84. As anticipated, a connectome with the size 8484 will be obtained, however, I got the connectome with the size 8585.

I checked the URL (Structural connectome construction — MRtrix 3.0 documentation), it seems to say it does matter for the i_brain.mif with a label 0. But I want to know what happens behind and how can I fix this problem to have a connectome with the size 84*84, by either post-processing the connectome.csv or modifying the code below.

“tck2connectome -symmetric -zero_diagonal -tck_weights_in sift_tck.txt tracks.tck i_brain.mif connectome.csv -out_assignment connectome_assignments.csv -keep_unassigned -force -nthreads 40”

Best,
Feihong

Did nobody meet this problem?

Hi,

I think your problem is that you have the -keep_unassigned flag in your tck2connectome call. This adds and extra row/column with the unassigned tracts. I hope this helps.

Best regards,

Manuel

Hi Manuel,

Thanks for your kind response. Sorry for replying late, I have to handle some other issues.
You are right, the option of ‘-keep_unassigned’ lets the connectome have an additional row and column that are caused by the node with label 0.

I can remove this option, the additional row could be removed successfully. however, this incurs another question.
I have a patient whose left hippocampus or left entorhinal disappeared. However, if I do not add the -keep_unassigned option, the connectome may have less than 84 rows. I could hardly locate the disappeared node(s) from the connectome itself.
Is there any other solution to resolving this?

fig1

Best,
Feihong

Hi Feihong,

For clarity, the use of -keep_unassigned does not actually “assign streamlines to node 0”, i.e. voxels that contain the value zero; rather, if a streamline endpoint cannot be assigned to a valid node, then it is “relegated” to node 0. But voxels in the image that contain the value zero are ignored, rather than being used to attribute streamlines to.

I have a patient whose left hippocampus or left entorhinal disappeared. However, if I do not add the -keep_unassigned option, the connectome may have less than 84 rows. I could hardly locate the disappeared node(s) from the connectome itself.

keep_unassigned” refers specifically to keeping track of those streamlines that are not assigned to a node at one or both of its endpoints. The question of what happens when a parcel is absent from the parcellation one is a wholly different one. As long as the node that is missing is not the one with the largest index (in which case the software would assume quite reasonably that there are simply (N-1) unique parcels), then you may receive an error due to either that parcel not containing any voxels, or due to no streamlines being attributed to that parcel; which I think is an entirely reasonable warning to receive in such a circumstance.

The size of the output connectome matrix will however in both of these instances be determined by the parcel with the maximal index. Embedded in the phrasing of your question is the idea that if a parcel does not contribute to the connectome matrix, resulting in a row / column containing entirely zeroes, then that row / column would be eliminated from the matrix prior to writing. Such an operation would break the correspondence between matrix row / column number and node information as provided in a corresponding lookup table, which would defeat the purpose of labelconvert, and is therefore something very deliberately avoided. It’s also why providing a FreeSurfer aparc image directly to tck2connectome is a bad idea: if a GM parcel is found with value 14175, then tck2connectome will make a 14175x14175 matrix, the vast majority of which will contain zeroes.

Cheers
Rob

Hi Rsmith,

Thank you very much, I can understand it more clearly.
I can summarize your responses below for other guys’ convenience.

The use of -keep_unassigned may generate the node 0 collecting streamlines that are not assigned to a node at one or both of its endpoints.

A connectome matrix result not strictly using the same node id is catering to the Freesurfer with the goal of avoiding a large sparse matrix.

Thank you again.
Feihong