Piping in tck tools

Dear all,

Do tck commands support piping? I tried something like the following, and it showed an error message saying that .tck extension is needed for -.

tckedit -maxlength 20 file.tck - | tckstats -

Thanks so much for your help and advice.
Best,
Nagesh

It’s not currently possible, but this is certainly something we’ve been considering for a while. Some discussion around this issues in various places, e.g. here or here. One of the issues we’re discussing is what format to use for this, given that we’d likely need to pass not just streamlines vertices, but also per-streamline weights and potentially other information too. We’ll do it when we find the time… :confounded:

Just to add to what Donald said, a one-line shorthand to achieve the desired behaviour would be:

tckedit -maxlength 20 file.tck tmp.tck && tckstats tmp.tck && rm tmp.tck

This line is basically identical to the pipe you suggested, in the sense that tckedit outputs a temporary file, which is then read by tckstats and cleaned up at the end. The main difference is that the temporary file is given an explicit name (tmp.tck in this case), which forces it to use the .tck file format.

P.S.: Using the && operators ensure that the subsequent commands are only executed if the previous commands were successful (i.e, returned without error).