ROIs from atlas to generate ROI to ROI streamlines

Hi Ben

Are you trying to avoid creating ROI masks because of the amount of effort involved, or for some other reason e.g. saving storage?

If it’s just about the effort, maybe this thread about automatically creating ROIs based on atlas parcellation indices might be useful? If you know the label values for the nodes you want connections for, it’s fairly straightforward to do what (I think?) you’re trying to achieve.

e.g. say you have a parcellation (in subject space) called parc.nii.gz and the ROIs you’re interested in are labelled 1 and 2. Then you can get streamlines between those two nodes as @StarVolcano and @suren suggested:

mrcalc parc.nii.gz 1 -eq seed.nii.gz
mrclac parc.nii.gz 2 -eq end.nii.gz
tckgen fod.mif -seed_image seed.nii.gz -include end.nii.gz -stop out.tck
# Or using existing whole brain tck file
tckedit wbt.tck -include seed.nii.gz -include end.nii.gz

But if you don’t want to retain lots of mask files you could use bash piping (on unix) to make them temporary files:

tckgen fod.mif -seed_image $(mrcalc parc.nii.gz 1 -eq -) -include $(mrclac parc.nii.gz 2 -eq -) -stop out.tck

If you’re really adamant about not using any inclusion or seed mask files, then I can’t think of an alternative workaround I’m afraid. And sorry for being the 3rd person suggesting the thing you really don’t want to do!

Fiona

2 Likes