Shifted output voxel2fixel

Dear expert,

I am converting a nifti image to fixel using voxel2fixel. However, the final output is a little bit shifted downwards

Any idea on how to solve it?

1 Like

Hi Davide,

I think there would need to be additional information provided in order to get to the bottom of this one. In addition to the mrinfo outputs of both the fixel directory index image and the 3D scalar NIfTI image from which you are trying to generate a fixel data file, we would need to know exactly what information is being presented visually: presumably the overlay image is the “NIfTI image” of which you speak, and the fixel plot tool is using the output of having passed that image as input to the voxel2fixel command to threshold which fixels are drawn? Also, if you were to draw all fixels, do these overlap properly with the background template image?

Rob

Hi @rsmith,

thanks for your reply.
As you requested I have uploaded the mrinfo outputs which you can download at the following links

NIFTI INFO
https://drive.google.com/file/d/1DaSMgrXiLh2-kx66oSfrxOykJ8PGYfIX/view?usp=sharing

FIXEL INFO
https://drive.google.com/file/d/1Z2jS0N76Vf1WDQuyWHFHIPBf0XBFcoB-/view?usp=sharing

As for your second question you are correct: the overlay is the NIFTI image and the fixel plot tool is using the output of voxel2fixel. The template image is the template wm_fod image that I have created for my dataset.

Thanks again

Davide

1 Like

Hi Davide,

While the two images contain the same number of voxels in each spatial dimension, the header transformations differ. It’s possible that one of these two images has had a spatial transformation applied in order to align it with some other image, whereas the other has not. This will mean that commands that operate on a pair of images in a voxel-wise fashion may still complete without error, despite the fact that those images do not actually perfectly overlap one another spatially. You will need to back-track through the provenance of these two files to ascertain where this discrepancy first arises.

One of your images was also generated using an unofficial fork of the software, which contains many intermediate development bugs subsequently resolved in the official release. If the issue is not one of user error as per above, you would need to demonstrate reproduction of the same issue using the MRtrix3 software before we could investigate further.

Regards
Rob

Hey @Davide_Momi,

I reckon I can guess what probably happened somehow; but apart from how it came about, it looks like the end result is that the transforms indeed differ between the nifti image and the fixel image. However, because their dimensions still match, voxel2fixel proceeds. Arguably, a warning message would be appropriate, because the result then does not align; or similarly, voxel2fixel ignores one transform without telling you.

The simplest fix that doesn’t require to regenerate your ROI (depending on how much effort that took in and of itself), would be to regrid the nifti (voxel ROI) image to the grid of you FOD template (i.e. the image you show as a backdrop, and from which the fixel image was generated; likely matching transforms and sizes). So e.g. using some of your filenames I pick up from the headers:

mrgrid motor2motor_binary_resample.mif regrid fixed_ROI.mif -template wmfod_template.mif -interp nearest

Here, fixed_ROI.mif would be your voxel ROI, but regridded to the grid of the WM FOD template. The latter is the same grid that your fixels should live on, going by the history of the commands in the header. You can use fixed_ROI.mif then instead with voxel2fixel, and I’m hoping the output will then align (and end up in the correct fixels). Only downside here is that the regridding (nearest neighbour, because it’s supposed to be and remain a binary ROI) might have cost you some precision. The name “motor2motor_binary_resample.mif” seems to hint that this was itself already resampled though. What you could do instead is use the “original” before that resampling, and feed that directly to mrgrid as above; to retain maximal precision.

I hope none of the above is too cryptic. :slight_smile: Feel free to give it a go, and let’s hope it works!

Cheers,
Thijs

Dear @ThijsDhollander;

Thank you so much for all your help and suggestion. It turns out that it worked and now the fixel output is where it was supposed to be :wink:

Thanks again

1 Like

No worries at all. :sunglasses:

Great to hear the problem was swiftly resolved! :wink: :+1: