I think we should break this up into sections to avoid confusion. I’ll lay down some suggestions, but bear in mind this isn’t a ‘unique’ answer, and exactly how you do these steps will influence the result you get.
- Transform subject tracks to template space:
- Generate a mask in template space per subject:
tckmap to generate the TDI, followed by
mrthreshold to apply a threshold and produce a mask
- Compute the ‘group average’: I’m going to assume this corresponds to voxels where more than some percentage of subjects have a track count higher than the threshold from step 2.
mrmath using the
sum operator across subject masks, then
- Transform ‘group average’ mask to subject space:
- Compute the mean FA within this mask:
An approach using the new
tckresample as @jdtournier suggested would look quite different, and I can think of more than one way to do it. But it would probably be something along the lines of:
- Define tracking targets in template space.
- Transform ROIs to subject space:
- Use ROIs to select streamlines of interest in subject space:
- Calculate mean FA along each streamline:
tcksample -stat_tck mean
- Take the average across all streamlines
One obvious difference between the two approaches is that when using the mask approach, all voxels within the mask contribute equally to the result; that is, voxels at the outer edge of the bundle contribute just as much as those smack bang in the middle. With the
tcksample approach, each streamline contributes equally, and therefore the FA in those voxels in the middle of the bundle will have a greater influence on the result than those at the outer edges.
There used to be an option to allow the sample positions to be defined in template space
Yes, I think I left that out in favour of doing such operations in steps, i.e. with
tcknormalise. The old
tcksample was kind of three operations merged into one command, which didn’t leave much wiggle room; and the old
-warp option only ensured equidistant points in template space, which isn’t actually required here. I think when I eventually do track data piping, this approach will make a lot more sense, and be clearer about what’s happening and in what order.