ACT tracking with -seed_gmwmi generates seed points outside of seed mask

Dear Mrtrix community, im doing roi-based seeding using ACT in order to build connectome while guaranteeing that the same number of streamlines are generated for each ROI.

Firts I compute the gmwmi mask then i segment that mask in different sections that iI feed as separate seed rois one per tckgen command.

However I noticed that seed points in neighboring voxels but outside the seed mask are also generated.
I imagine this is due to the -seed_gmwmi algorithm as it moves the seed point through the gradient to be closer to the interface and on occasion it might make it leave the seed mask.
I point this out firstly to encourage a fix so that the seed is discarded if it leaves the original mask.

Secondly I would like to ask if you have any suggestion about how I could discard these fibers, to ensure in the end i have N fibers statrting from within my mask.

I have thought of generating an exclude mask with the 1-voxel neighborhood of the roi withing the overal gmwmi mask, but I fear this might be too strict.

below I post the tckgen command i am currently using (in this case for roi number 12):

tckgen fod.nii.gz tck_12.tck -grad gradient_table.b -number 5000 -initcutoff 0.05 -cutoff 0.05 -quiet -seed_gmwmi roi_12.nii.gz -act T1_act_to_b0.nii.gz -algorithm iFOD2 -crop_at_gmwmi -unidirectional -force

regards,

David Moreno-Dominguez

Hi David,

My brain clearly failed to register this issue when I made some changes to 5tt2gmwmi and the relevant streamline seeding code quite a while back.

What I did is change the GM-WM interface seeding ‘mask’ from a genuine binary mask image to a floating-point image. The relative values within different voxels result in different densities of ‘initial’ streamline seeds prior to the interface optimisation. By allowing the interface image calculated by 5tt2gmwmi to be ‘smooth’ rather than a blocky voxelised mask, the resulting seed point density on the interface is much more homogeneous.

However this was done to improve the seed distribution in whole-brain seeding. By doing so, I’ve presumably removed the additional check that following optimisation the seed point still be within the input mask (which I think was there initially), since the input is in fact no longer a mask. This means that if your seed image only covers a subset of the interface rather than the entire brain, it’s possible for streamlines to move outside the mask during the optimisation.

I can think of a few different ways that I could approach this from a code perspective; I’m not quite sure which is the best approach in terms of user-friendliness (anyone feel free to comment):

  • Detect that the input provided to tckgen -seed_gmwmi is either a binary image, or only contains ones and zeros, and when this is the case additionally check that the final seed point still lies within the mask;

  • Have two different options in tckgen: one for whole-brain interface seeding and one for mask-based interface seeding.

Secondly I would like to ask if you have any suggestion about how I could discard these fibers, to ensure in the end i have N fibers statrting from within my mask.

The simplest way would be to use tckedit, providing your ROI using the -include option, and additionally specifying the -ends_only option. This will only compare streamlines endpoints against your ROI. The disadvantage of this approach is that if a streamline is seeded outside of your ROI, but then terminates inside your ROI, it will be included (since both endpoints will be tested, not just the seed point).

A more robust check would be to capture the streamline seeds using tckgen -output_seeds and test those, but it’d take some coding to extract the streamlines of interest based on testing those seeds.

I have thought of generating an exclude mask with the 1-voxel neighborhood of the roi withing the overal gmwmi mask, but I fear this might be too strict.

The disadvantage here (even if you were to perform it in a subsequent step using tckedit -exclude <image> -ends_only) would be the rejection of streamlines that terminate within that mask, but were not seeded within that mask (e.g. very short streamlines, or those that go into WM then loop back toward the seed region).

Cheers
Rob

Hi Rob!

Thanks for the feedback,
I think what I will do is do the following two steps:

  • Add two include masks to my tckgen command: one with the binarized seed ROI, and another with the binarized whole brain gmwmi mask (without the seed roi area). This way i will make sure that at least the streamline crosses both areas and if not a new one will be computed instead.

  • do tckedit -include with these same masks with the -ends_only option, this way I can ensure one endpoint is within my seed roi and the other within the interface vicinity of the rest of the cortex, and eliminate unwanted loopbacks