Please give an example of the assignment text file in connectome2tck

Hi, MRtrix masters!

According to your assistance, I have made my own final script for patients with Global developmental delay(GDD).

I made the tractography file(.tck) between the thalamus and postcentral cortex with using tckedit.

However, I have been trying to use connectome2tck. But I can not know how to make the assignment text file.

I inserted connectome_out.csv and connectome_out.txt which had been made after using tck2connectome. so I made another text file. However, All things that I have been tried were not effective.

Could you give an example of the assignment text file or explain how to make it.

Best Regards,


Hi there,

I probably need to provide some more documentation here…

The “assignments text file” that connectome2tck requires as input is that provided by the -out_assignments option in tck2connectome. The reason this file is required rather than the connectome matrix itself is that the latter contains only the streamline count (or some other statistic) for each connectome edge, whereas in connectome2tck the purpose is to extract individual streamlines that correspond to each edge; the connectome matrix simply doesn’t contain this information.

The assignments file will (typically) contain 2 indices per row, corresponding to the two parcels to which each streamline was assigned during connectome construction. The number of rows in this file should therefore correspond to the number of streamlines in the track file.


Hi Dear Rob

I made the “assignments text file” by the -out_assignments option in tck2connectome, but when i run my command: “connectome2tck track.tck assignments.txt output/ -nodes 8,17,28 -exclusive -files per_edge” i get this error message:
“connectome2tck: [done] reading streamline assignments file
connectome2tck: [ERROR] Assignments file contains 13452455 entries; track file contains 20000000 tracks”

Would you please help me?

To be sure, you can cross-check these properties yourself: The number of entries in the assignments file can be obtained with “wc -l assignments.txt”, while the track file is most comprehensively checked using “tckinfo track.tck -count”. If the assignments file is genuinely shorter than it should be, and the command generating that file completed successfully, you could check things like limited storage space that may have resulted in file truncation.