The Usage of T1w JSON File in fmriprep & qsiprep and fmriprep results alignment issues

Dear fmriprep experts,

I am currently utilizing fmriprep 23.2.1 (latest version) for my data processing, and I am curious about the relevance of the information contained within the T1w.json file to the fmriprep pipeline.

Recently, I conducted an experiment where I intentionally removed the T1w JSON file from the BIDS dataset. Surprisingly, the workflow completed successfully and yield satisfactory results. This observation has prompted me to inquire whether fmriprep indeed relies on the T1w JSON file, or if the missing information is somehow estimated or compensated for within the processing pipeline.

Could you kindly clarify whether fmriprep necessitates the presence of the T1w JSON file? If so, I would appreciate some insights into the specific information extracted from this file and its role within the fmriprep workflow. Thank you!

Best,
Jingli

Hi @jingli,

The T1w json is not used in fMRIPrep. In fact, it isn’t even a required file in BIDS (there is no required T1w metadata, but it is recommended to have it: Magnetic Resonance Imaging - Brain Imaging Data Structure v1.9.0).

Best,
Steven

Hi, @Steven

Thank you for your prompt response! May I bother you with a few more questions?

1. Modification of the Input T1w File for fmriprep

We are currently utilizing both qsiprep and fmriprep to process our multi modal data. However, we encountered a disparity in space between the results obtained from qsiprep (in T1w ACPC space, a 6DOF transformation and resampling) and fmriprep (in T1w Native space). Our goal is to achieve spatial alignment between the outputs of fmriprep and qsiprep.

Here is our proposed solution: we use the results from qsiprep to register the original T1 file to the ACPC space, denoted as T1w_native_acpc. Subsequently, we overwrite the original T1w file in the BIDS with T1w_native_acpc and execute fmriprep based on this modified bids.

We have observed that fmriprep runs successfully, and the preprocessed images (T1w and Bold) are aligned with the qsiprep ACPC space. We have conducted some tests to compare our approach with fmriprep’s original results (denoted as raw) in standard spaces (MNI2009cAsymLin, fsLR) for voxel/vertex to voxel/vertex comparison. We found a high similarity in volume results, while there are some discrepancies in the results under fsLR surface space. However, the overall patterns (functional connectivity, default network) remain consistent. Here are some examples.

The Pearson correlation coefficient distributions of voxel time series between raw and our method in MNI
The Pearson correlation coefficient distributions of voxel time series between raw and our method in MNI

The Pearson correlation coefficient distributions of vertex time series between raw and our method in fsLR seems unsatisfactory.
The Pearson correlation coefficient distributions of vertex time series between raw and our method in fsLR

So, we tested the overall pattern.Here is the functional connectivity matrices from the raw and our method in fsLR(left as our mehod, right as raw)
The functional connectivity matrices from the raw and our method in fsLR
the correlation between FC matrix is 0.846

We would appreciate your insights on whether you consider this method/solution feasible and if you have any other concerns regarding this strategy.

2. Out of curiosity, you mentioned that fmriprep does not use T1w JSON information. Could you clarify if it utilizes JSON information from the BOLD files?

Please let me know if there is anything unclear!Thank you for your time!

Best regards,
Jingli

Hi @jingli,

The registration should already by in QSIPrep anatomical outputs, which should save you some processing.

Did you rerun freesurfer after the reorientation?

I would make sure you are using some form of susceptibility distortion correction to make sure BOLD and DWI are aligned to T1w (and therefore each other). I personally would also apply the registration at the end of the process. That is, for example, run fmriprep in the resampling mode at first, replace the native-to-T1w registration with the same registration multiplied by the ACPC, and then finish the fmriprep process. This would ensure that only a single registration is run, minimzing the amount of data interpolation.

It does. TR, slice timing info, phase encoding direction, among other fields probably.

Best,
Steven

Hi, @Steven
Thank you for your prompt and thorough response!

Thank you for your kind reminder. We indeed utilized the subID_from-T1wNative_to-T1wACPC_mode-image_xfm.mat file provided by QSIPrep to complete this step.

We have rerun freesurfer. Consequently, we speculate that the differences in resolution and coordinate origin between the original T1w and our processed T1w_native_acpc may have impacted the extraction of cortical regions during the surface reconstruction process. This disparity could result in slight variations in the spatial positions of sampled points, potentially leading to discrepancies in the BOLD signal values of vertices that we believed to be corresponding. We would greatly appreciate your insights on this matter.

For SDC correction, we employed Phase Encoding POLARity (PEPOLAR) techniques in the DWI and Phase-difference B0 estimation in the BOLD. Below, we present the preprocessed DWI images from qsiprep and the preprocessed BOLD images from fmriprep in our approach, along with their alignment with T1w ACPC.

qsiprep preproc dwi and T1w ACPC

fmriprep preproc bold in our solution and T1w ACPC

I have some questions regarding the method you suggested.
1.If the resampling mode you suggested refers to the ‘-level’ option newly added in fmriprep 23.2.0?
2. How to achieve this step : "replace the native-to-T1w registration and then finish the fmriprep process.“ It seems we need to break down fmriprep by ourselves. Is this step achievable through any options provided by fmriprep?

Hope you can provide a more detailed explanation of the solution you recommended. Much appreciated!

Best,
Jingli

Hi @jingli

It does.

You would just have multiply the transformation matrices together and have the output assume the same name as the fmriprep input name. No need to dig into fmriprep source code.

Wouldn’t know, sorry.

Best,
Steven

Hi Steven ,
Thanks for your reply! I will try this method. Thanks again for your time!
Best,
Jingli

Sounds good! I’ll add that, if it becomes too complicated, you can also register fmriprep to qsiprep later on after you’ve done your functional processing. It is less problematic to register/interpolate binary rois (such as what might result from a GLM on your MRI data) than a whole time series.

Best,
Steven