Getting non-ACPC qsiprep preprocessed data in fsl standard space

Hi all,

I am still new to QSIprep and have not been able to figure this out by myself:
Is there a way to get the preprocessed image in the exact same space as the raw data? I have tried using reorient_fslstd but the image still has changed size (I believe due to the coregistration to the T1w). I have also tried applying the inverse of the b0_to_anat transformation matrix, but I am having trouble combining this and the reorient_fslstd.
I am looking to use a toolbox on the preprocessed data that requires the original dimensions, but would hope to stick with qsiprep for the preprocessing since we’re using it for other analyses.

Looking forward to your answers!

Hi @Elisabeth_Freund and welcome to neurostars!

That command does not do any transformation or dimension warping, it simply makes sure the position of labels (anterior/posterior, left/right, etc) match the FSL convention. Keep in mind that if you do this after QSIPrep manually (as opposed to using the FSL reorient recon spec) that you will need to adjust the gradients accordingly.

It is hard to help precisely without knowing the code you tried and what went wrong. But there should be, depending on what qsiprep version you use, a transform file for getting to ACPC that you could invert.

If it’s just the dimension you’re worried about, can’t you specify the —output-resolution to match that of your input data? Unless your input data wasn’t anisotropic. I’m also curious what kind of software is especially sensitive to having a very particular dimension and non-acpc orientation.

Best,
Steven

1 Like

I’d also be very interested to know which software requires the original data’s FOV.

Thank you very much for your answer!

Sorry for not responding for such a long time, I was still trying out some things.

First the easy part:
The toolbox is the DBSI toolbox first described in this paper: https://doi.org/10.1093/brain/awr307
An online available version of it can be seen here: OSF | Diffusion MRI Data and Processing Code
However, I got the code that I am using from the developers directly. The error message stays the same with both versions, though.
I have not spoken to the developers yet, since I figured it might be easier to fix this in the QSIprep pipeline. When I do preprocessing in fsl, everything runs in this toolbox.

Regarding the QSIprep part of it:
I have tried around a little bit since your message, trying to clear up my issues as much as I can. I’m afraid it’s still a little messy, but I’ll do my best.

To get as bare-stripped a version as I can, I ran qsiprep on a subject folder that has only the dwi and pepolar epi fmaps. See below the command I ran. I xxxed out paths to shorten it.

qsiprep-docker 'xxx' 'xxx' participant --output-resolution 2 --participant-label '9000042' -w 'xxx' --nthreads 20 --recon-spec reorient_fslstd --b0-threshold 49 --skip-anat-based-spatial-normalization --hmc-model 3dSHORE --dwi-only --pepolar-method DRBUDDI

The 2 raw dwi images are sized 128x128x72(x27) with voxel size 2x2x2, the preprocessed image is sized 80x99x85(x54).

Looking forward to your feedback!

Hi @Elisabeth_Freund,

I didn’t see anything in the manual for the software you sent that specified a certain resolution, orientation, or FOV, but if you can point me to any code snippets or error messages that may be relevant, that would be appreciated. It also appears that you set your --output-resolution to be larger than your input image, thus downsampling it.

But to answer this part:

QSIPrep does enforce isotropic outputs, so if your inputs aren’s isotropic, you cannot match the raw data resolution.

Best,
Steven

Unfortunately this code is so packaged, that all I get is an incompatible array sizes error without any further information. I’ve gone through all the input variables and the only thing that really changes between the images that get an error message and those that don’t is the image dimension. But if this isn’t easily achievable in qsiprep, my next step will be to get back in touch with the developers of this toolbox.
My data is isotropic, but I guess I misunderstood the - -output-resolution flag. I took it that if I set it to two, I will have 2x2x2 voxels, regardless of the input resolution. But it also seems like the image size is not just half of the raw data

Hi @Steven,
I believe I set the output resolution to the same as input (2mm voxels) by setting --output-resolution 2. If this is not how the --output-resolution flag should be used, that would mean the information at Usage — qsiprep 0.21.5.dev2+g3320ba4 documentation is incorrect.

Regarding the error message from the toolbox, see my earlier reply (sorry for forgetting to tag you).

Perhaps QSIPrep does some FOV cropping, so even if resolution is same, the total dimensions will be different.