Spatial Normalization Issue

Hello,

I recently finished fmriprep on a subject with no noticeable errors, using the following command:

unset PYTHONPATH; singularity run $data_dir/$s/fmriprep_*.img 	\
$data_dir/$s $data_dir/$s 										\
participant 													\
--participant-label $s 											\
--verbose 														\
--fs-license-file $data_dir/$s/license.txt 						\
--fs-no-reconall												\
--fmap-bspline 													\
--force-bbr 													\
--use-aroma 													\
--bold2t1w-dof 12 												\
--output-space template 										\
--write-graph 													\
--nthread $threads												\
--omp-nthreads $threads											\
--debug															\
--stop-on-first-crash 											\
-w $data_dir/$s

I was checking the alignment of the anatomical and one of the functional runs (all in MNI space), and there doesn’t seem to be great alignment between the two in certain anterior regions.

I’ve also attached the HTML report for reference.

I’m having trouble determining why this misalignment is occurring, and what should be done about this.

Thank you for the help.

Dan

It’s hard to say exactly what is going on without the figures (if you could upload the contents of sub-24/figures/ to the repo that would be great). However, this looks like a susceptibility distortion issue. The fact that you used --fmap-bspline options suggests you have fieldmaps, but the reports does not mention them. Do you fieldmap JSON files include IntendedFor field described in the BIDS spec? Does the dataset pass the validator?

Hi Chris,

Yes, this dataset contains 2 spin echo fieldmaps. I ran this through the BIDS validator, and it turns out that it was in fact an issue with the IntendedFor field of the field mapping JSON files. I had been specifying the full paths by mistake:

“IntendedFor”: [
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-01_bold.nii.gz”,
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-02_bold.nii.gz”,
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-03_bold.nii.gz”,
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-04_bold.nii.gz”,
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-05_bold.nii.gz”,
“/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-06_bold.nii.gz”
]

I assume I need to have them along the lines of:

“IntendedFor”: [
“func/sub-24_task-upn_run-01_bold.nii.gz”,
“func/sub-24_task-upn_run-02_bold.nii.gz”,
“func/sub-24_task-upn_run-03_bold.nii.gz”,
“func/sub-24_task-upn_run-04_bold.nii.gz”,
“func/sub-24_task-upn_run-05_bold.nii.gz”,
“func/sub-24_task-upn_run-06_bold.nii.gz”
]

Even though the dataset failed the validator, the output from the log file seemed to imply that that field maps would be applied to the functional runs:

180919-23:28:48,490 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-01_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:28:50,828 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:28:51,55 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-01_bold.nii.gz found.
180919-23:28:52,821 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-02_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:28:54,879 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:28:55,102 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-02_bold.nii.gz found.
180919-23:28:57,131 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-03_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:28:59,721 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:28:59,944 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-03_bold.nii.gz found.
180919-23:29:01,706 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-04_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:29:03,833 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:29:04,57 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-04_bold.nii.gz found.
180919-23:29:05,845 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-05_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:29:08,155 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:29:08,380 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-05_bold.nii.gz found.
180919-23:29:10,207 nipype.workflow IMPORTANT:
Creating bold processing workflow for “/N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-06_bold.nii.gz” (0.22 GB / 149 TRs). Memory resampled/largemem=0.89/1.23 GB.
180919-23:29:12,763 nipype.workflow IMPORTANT:
Slice-timing correction will be included.
180919-23:29:12,989 nipype.workflow IMPORTANT:
SDC: fieldmap estimation of type “epi” intended for /N/dc2/scratch/dlevitas/fMRI_data/upn/24/sub-24/func/sub-24_task-upn_run-06_bold.nii.gz found.
180919-23:29:16,588 nipype.workflow IMPORTANT:
Works derived from this fMRIPrep execution should include the following boilerplate:

Regardless, I’ll reformat things until it passes the validation, and see if the susceptibility distortion is corrected. If not, I’ll check back in.

Thanks!

I re-ran the BIDS-validated dataset; the field map workflow seems to have helped to some degree, however, there still appears to be more distortion in the functional images than I would’ve expected. I’ve uploaded the figures here, since I’m not sure I’m interpreting them properly. Perhaps adding the --use-syn-sdc option would help, but I’ll need to play around with fmriprep’s field map options.

Thank you again.

A few things are evident in the report you shared:

  • The image after susceptibility correction looks worse than before - as if the correction was applied in the wrong polarity. I cannot think how this can happen with PEPOLAR correction, but it’s worth checking the quality of the _epi image and PhaseEncodingDirection fields assigned to _epi and _bold (are they opposite? were the phase encoding directions truly opposite?)
  • You are using --debug flag which uses testing (fast inaccurate) versions of coregistration parameters. This definitely will influence normalization, but could have impact elsewhere.
  • Trying out --use-syn-sdc with --force-syn would probably yield better results since it only driven by _bold images.
  • I don’t think it’s necessary to set the --bold2t1w-dof option in your case.

Just to clarify, I can use --use-syn-sdc and --force-syn in conjunction with --fmap-bspline?

I’ll look into the spin echo field maps files in greater detail. From a brief glance at the field maps JSON files, the phase encoding direction for the first is "PhaseEncodingDirection": "j-", and the second is "PhaseEncodingDirection": "j",. For each bold run, it’s "PhaseEncodingDirection": "j-",

You can skip --fmap-bspline.

Perhaps the value for the _bold files is wrong and it shoudl be j (not j-)?