Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fmriPrep seems to ignore the single band image. #3350

Open
zhitao-guo opened this issue Aug 22, 2024 · 8 comments
Open

fmriPrep seems to ignore the single band image. #3350

zhitao-guo opened this issue Aug 22, 2024 · 8 comments
Labels

Comments

@zhitao-guo
Copy link

zhitao-guo commented Aug 22, 2024

What happened?

I'm using fMRIPrep to process HCP-YA data, which includes single band reference (SBRef) images. However, I've noticed that the SBRef images were not utilized during the motion correction process.

Below is the input data I used.

├── dataset_description.json
├── README
└── sub-100307
    ├── anat
    │   ├── sub-100307_T1w.json
    │   ├── sub-100307_T1w.nii.gz
    │   ├── sub-100307_T2w.json
    │   └── sub-100307_T2w.nii.gz
    ├── fmap
    │   ├── sub-100307_dir-LR_run-01_epi.json
    │   ├── sub-100307_dir-LR_run-01_epi.nii.gz
    │   ├── sub-100307_dir-LR_run-02_epi.json
    │   ├── sub-100307_dir-LR_run-02_epi.nii.gz
    │   ├── sub-100307_dir-RL_run-01_epi.json
    │   ├── sub-100307_dir-RL_run-01_epi.nii.gz
    │   ├── sub-100307_dir-RL_run-02_epi.json
    │   └── sub-100307_dir-RL_run-02_epi.nii.gz
    └── func
        ├── sub-100307_task-rest_dir-LR_run-1_bold.json
        ├── sub-100307_task-rest_dir-LR_run-1_bold.nii.gz
        ├── sub-100307_task-rest_dir-LR_run-1_sbref.json
        ├── sub-100307_task-rest_dir-LR_run-1_sbref.nii.gz
        ├── sub-100307_task-rest_dir-RL_run-1_bold.json
        ├── sub-100307_task-rest_dir-RL_run-1_bold.nii.gz
        ├── sub-100307_task-rest_dir-RL_run-1_sbref.json
        └── sub-100307_task-rest_dir-RL_run-1_sbref.nii.gz

What command did you use?

docker run -it --name "$subj" \
--user "$(id -u):$(id -g)" \
-v $PROJECT_ROOT/input_data:/data:ro \
-v $PROJECT_ROOT/derivatives:/out \
-v $PROJECT_ROOT/license.txt:/opt/freesurfer_license/license.txt \
-v $WORK:/work \
nipreps/fmriprep:${FMRIPREP_VERSION} /data /out participant \
--skip_bids_validation \
--participant-label ${subj} \
--ignore slicetiming \
--output-space anat fsaverage fsnative MNI152NLin2009cAsym \
--fs-license-file /opt/freesurfer_license/license.txt \
--cifti-output 91k \
--bold2t1w-dof 12 \
--nthreads $nthreads \
--n-cpus $ncpus \
--stop-on-first-crash \
--work-dir /work \
--resource-monitor \
--write-graph \
--debug all

What version of fMRIPrep are you running?

24.0.0

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

Here is the actual command that was executed (monitored by ps command).

mcflirt -in /data/sub-100307/func/sub-100307_task-rest_dir-RL_run-1_bold.nii.gz \
-out /work/fmriprep_24_0_wf/sub_100307_wf/bold_task_rest_dir_RL_run_1_wf/bold_fit_wf/bold_hmc_wf/mcflirt/sub-100307_task-rest_dir-RL_run-1_bold_mcf.nii.gz \
-reffile /work/fmriprep_24_0_wf/sub_100307_wf/bold_task_rest_dir_RL_run_1_wf/bold_fit_wf/hmc_boldref_wf/gen_avg/sub-100307_task-rest_dir-RL_run-1_bold_average.nii.gz \
-mats -plots -rmsabs -rmsrel

Additional information / screenshots

Here I post some of the methods report generated by fmriprep. I think the message suggests that the sbref.nii.gz image was not used during motion correction.

For each of the 2 BOLD runs found per subject (across all tasks and sessions), the following preprocessing was performed. First, a reference volume was generated, using a custom methodology of fMRIPrep, for use in head motion correction. Head-motion parameters with respect to the BOLD reference (transformation matrices, and six corresponding rotation and translation parameters) are estimated before any spatiotemporal filtering using mcflirt (FSL , Jenkinson et al. 2002). ...

@zhitao-guo zhitao-guo added the bug label Aug 22, 2024
@effigies
Copy link
Member

Single-band references will not be used in motion correction, since the contrast may differ strongly from the multiband BOLD. The single-band references are used for coregistration with other images (fieldmaps and T1w images).

@zhitao-guo
Copy link
Author

Single-band references will not be used in motion correction, since the contrast may differ strongly from the multiband BOLD. The single-band references are used for coregistration with other images (fieldmaps and T1w images).

Thank you for your timely response. That's to say, the approach fMRIPrep uses is different from that of the HCP Pipelines.

By the way, I have another important question maybe crucial for my own analysis. In my running command, I specified --cifti-output 91k, and I would like to know whether the time series data in the result file (e.g. sub-100307_task-rest_dir-LR_run-1_space-fsLR_den-91k_bold.dtseries.nii) for both the surface and subcortical regions is derived from T1 space or MNI space? Or could you please provide a useful link to furthur clarify the process? I would greatly appreciate your guidance.

@effigies
Copy link
Member

That's to say, the approach fMRIPrep uses is different from that of the HCP Pipelines.

Yes. See https://neurostars.org/t/mcflirt-related-behavour-fmriprep-strange-motion-estimations-in-confounds-timeseries-tsv-lots-of-zeros/18037 for an investigation that led to this divergence.

By the way, I have another important question maybe crucial for my own analysis. In my running command, I specified --cifti-output 91k, and I would like to know whether the time series data in the result file (e.g. sub-100307_task-rest_dir-LR_run-1_space-fsLR_den-91k_bold.dtseries.nii) for both the surface and subcortical regions is derived from T1 space or MNI space? Or could you please provide a useful link to furthur clarify the process? I would greatly appreciate your guidance.

The subcortical data is resampled to MNI152NLin6Asym, and the cortical data is sampled to the subject's surface and then mapped to fsLR using MSMsulc. This should very closely align with HCP.

@zhitao-guo
Copy link
Author

Yes. See https://neurostars.org/t/mcflirt-related-behavour-fmriprep-strange-motion-estimations-in-confounds-timeseries-tsv-lots-of-zeros/18037 for an investigation that led to this divergence.

Thanks again~

The subcortical data is resampled to MNI152NLin6Asym, and the cortical data is sampled to the subject's surface and then mapped to fsLR using MSMsulc. This should very closely align with HCP.

Thanks. I think I still have some confusion, please help me correct if there is any mistake. Here is my understanding about how the cortical and subcortical data of .dtseries.nii is derived:
Subcortical data: fMRI data in native space (aligned with T1w volume space) to MNI152NLin6Asym space
Cortical: fMRI data in native space (aligned with T1w volume space) to subject's surface (fsnative space) and then mapped to fsLR using MSMsulc

@effigies
Copy link
Member

Yes, that's right. As a minor clarification, the MNI resampling happens in a single interpolation from the original BOLD data. It's effectively the same as resampling BOLD to T1w and then the result to MNI, but with less opportunity for numerical error.

@zhitao-guo
Copy link
Author

Thank you very much for your reply and my confusion was addressed!
Just out of curiosity and various future applications, is it possible to specify the source space for cortical and subcortical data in .dtseries.nii file?

@effigies
Copy link
Member

What do you mean source space? You mean use targets other than fsLR and MNI152NLin6Asym?

@zhitao-guo
Copy link
Author

I'm sorry for the ambiguous description. What I mean is that specifying the generation of cortical and subcortical data in .dtseries.nii files. For example, cortical data could be derived from fMRI volume that aligned with the MNI space (like the HCP Pipelines do), or subcortical data could come from the individual’s native fMRI volume space. I think that there are various combinations of cortical and subcortical data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants