Tckconvert on whole-brain tractogram

Hi all,

I have a whole-brain tractogram with 5 million streamlines and I an trying to extract the endpoint coordinates of each streamline with tckconvert:

txt_out = fullfile(outDir_tmp , sprintf(‘%s_%s_endpoints-.txt’, Subject, tag));
cmd2 = system(sprintf(‘tckconvert %s %s -nthreads 64 -force’, endpoints_tck, txt_out));
assert(system(cmd2) == 0, ‘tckconvert failed’);

  1. Is there a way of extracting the endpoint coordinates without saving individual streamline files? This takes up a lot of memory and is not feasible for multiple subject (we have over 30).
  2. Do you have any other suggestions on how I could find my endpoint coordinates? I already have the connectome.csv and assignments.txt files obtained from tck2connectome but also need the endpoint coordinates for assigned streamlines to bring each coordinate to cifti space (later).

Thank you!

Hi @pan4004,

I would suggest running tckresample -endpoints to generate a .tck file containing only the two endpoints of each streamline. From there, depending on the environment in which you are working, you may prefer, rather than converting to .txt files, to use the provided MATLAB import function, or find an external library that can load .tck files into eg. Python.

Cheers
Rob