I knew about the
-stop option for
tckgen but I was wondering if there is something comparable for
-stop option wouldn’t make sense for
tckedit, since by that point the streamlines are no longer “directed” through propagation. I.e. If you find a vertex in the middle of the streamline that intersects your region, do you throw out all of the streamline vertices after that point, or before it?
The closest that you will get in
tckedit is the
-mask option. Basically any streamline vertex that is not inside of the mask(s) will get thrown out. So e.g. if you were to take your mask image, invert it so that voxels in your ROI have value 0 and all other voxels have value 1 (
mrcalc 1 ROI.mif -sub), and use that as a mask in
tckedit, then there will be no streamline vertices inside of your ROI.
You have to be careful though. This is done in a purely vertex-wise fashion; it won’t find the first vertex outside of the mask and then “stop”. So if the streamline goes through your ROI and out the other side, i.e. the start of your streamline is in the mask, the middle is outside of it, and the end is also in the mask, then that one streamline will be split in two in the output track file. So you can actually get more tracks in your output file than there were in your input file!
Sometimes these sort of experiments take a bit of fiddling; but generally once you understand the actual underlying operation of the tools at your disposal, you can figure out what steps you need to produce the result you’re looking for.