For the follow-up research, I have to obtain all the TDIs for each voxel (in voxel coordinates) within a ROI, that is, one TDI per voxel. Therefore, I have two problems when using MRtrix3. First, I’ve got some sets of voxel coordinates for all the voxels within each participant’s ROI (in local space), but the tckgen command can only seed streamlines per voxel in MNI coordinates. Second, if I don’t seed streamlines per voxel when doing the fiber tracking, I will need to obtain individual TDI per voxel later, but there is no corresponding option in the tckmap command. Is there a way to solve these two problems (or maybe one problem)?
In fact, the default contrast is already ‘tdi’, so you can also leave out the -contrast tdi part. The image.nii.gz in this example is only used to define the grid of the output image. It doesn’t matter what intensities there are in there.
I understand you want to have the TDI value separate in a selection of voxel coordinates (x,y,z), not averaged out or anything. One approach would be to start from the output_tdi.nii.gz and use mrstats with the -mask option to obtain the value in a ROI. This ROI can be an image containing a single voxel. So you could make a loop in which you create a ROI image and compute the TDI in it:
This basically takes an image.nii.gz, sets all intensities to 0, then passes it on to mredit to set the intensity of voxel x,y,z (change this within your loop) to value 1. This binary ROI is then passed on to mrstats to be used as a mask on output_tdi.nii.gz, from which the mean value (of a single voxel, so the voxel intensity itself) is taken. Best to check that the value you get is the correct one, else the x,y,z definition needs to be changed.
There may be other solutions, but this is the one that pops in my head for now, given that you want to have the TDI values of each voxel, and not the average across voxels.
Yep, this is a really valuable, yet simple, command. This used to be part of mrstats, so I hope people haven’t “lost track” of it. But basically, it allows you to do your maths / stats / plotting / … easily in any other package thereafter (e.g. Matlab, etc…).