fmriprep
fmriprep copied to clipboard
`Sophisticated PEPOLAR schemes are unsupported` error
What happened?
I like to compute a pe-polar fieldmap from two AP/PA sbref images and apply it to bold images, the same way that is given as an example in this pull request. Here's how the fielmap data looks like:
mentat005/sub-003$ grep -r B0Field
func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-PA_run-1_sbref.json: "B0FieldIdentifier": "cmrr_2p0iso_mb3me2_TR2095_SBRef"
func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.json: "B0FieldIdentifier": "cmrr_2p0iso_mb3me2_TR2095_SBRef",
func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_bold.json: "B0FieldSource": "cmrr_2p0iso_mb3me2_TR2095_SBRef"
What command did you use?
unset PYTHONPATH; export PYTHONNOUSERSITE=1; singularity run --cleanenv /opt/fmriprep/21.0.1/fmriprep-21.0.1.simg bids_debug bids_debug/derivatives/fmriprep participant -w \$TMPDIR --participant-label 003 --skip-bids-validation --fs-license-file /opt_host/fmriprep/license.txt --mem_mb 20000 --omp-nthreads 2 --nthreads 2
What version of fMRIPrep are you running?
21.0.1
How are you running fMRIPrep?
Singularity
Is your data BIDS valid?
Yes
Are you reusing any previously computed results?
No
Please copy and paste any relevant log output.
220219-14:09:49,79 nipype.workflow IMPORTANT:
Running fMRIPrep version 21.0.1
License NOTICE ##################################################
fMRIPrep 21.0.1
Copyright 2021 The NiPreps Developers.
This product includes software developed by
the NiPreps Community (https://nipreps.org/).
Portions of this software were developed at the Department of
Psychology at Stanford University, Stanford, CA, US.
This software redistributes the versioneer Python package, which is
Public domain source code.
This software is also distributed as a Docker container image.
The bootstraping file for the image ("Dockerfile") is licensed
under the MIT License.
This software may be distributed through an add-on package called
"Docker Wrapper" that is under the BSD 3-clause License.
#################################################################
220219-14:09:49,101 nipype.workflow IMPORTANT:
Building fMRIPrep's workflow:
* BIDS dataset path: /project/3015089.01/deep-brain_EPI/bids_debug.
* Participant list: ['003'].
* Run identifier: 20220219-140939_16f3d6e6-308a-4e4e-9484-637425147a64.
* Output spaces: MNI152NLin2009cAsym:res-native.
* Pre-run FreeSurfer's SUBJECTS_DIR: /project/3015089.01/deep-brain_EPI/bids_debug/derivatives/fmriprep/sourcedata/freesurfer.
220219-14:09:51,280 nipype.workflow INFO:
B0 field inhomogeneity map will be estimated with the following 1 estimators: [<EstimatorType.PEPOLAR: 2>].
220219-14:09:51,359 nipype.workflow INFO:
Using single-band reference file(s) sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.nii.gz.
220219-14:09:51,359 nipype.workflow INFO:
Found usable B0-map (fieldmap) estimator(s) <cmrr_2p0iso_mb3me2_TR2095_SBRef> to correct </project/3015089.01/deep-brain_EPI/bids_debug/sub-003/func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_bold.nii.gz> for susceptibility-derived distortions.
220219-14:09:51,479 nipype.workflow IMPORTANT:
BOLD series will be slice-timing corrected to an offset of 1.01s.
220219-14:09:51,983 nipype.workflow INFO:
Setting-up fieldmap "cmrr_2p0iso_mb3me2_TR2095_SBRef" (EstimatorType.PEPOLAR) with <sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.nii.gz, sub-003_task-cmrr2p0isomb3me2TR2095_dir-PA_run-1_sbref.nii.gz>
Process Process-2:
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/conda/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/lib/python3.8/site-packages/fmriprep/cli/workflow.py", line 118, in build_workflow
retval["workflow"] = init_fmriprep_wf()
File "/opt/conda/lib/python3.8/site-packages/fmriprep/workflows/base.py", line 85, in init_fmriprep_wf
single_subject_wf = init_single_subject_wf(subject_id)
File "/opt/conda/lib/python3.8/site-packages/fmriprep/workflows/base.py", line 473, in init_single_subject_wf
raise NotImplementedError(
NotImplementedError: Sophisticated PEPOLAR schemes are unsupported.
Additional information / screenshots
No response
Btw, this simple IntendedFor
example gives the same error (maybe this is expected behavior, but perhaps this is of any help to you):
mentat005/sub-003$ tree
.
|-- anat
| |-- sub-003_acq-MPRAGE_run-1_T1w.json
| |-- sub-003_acq-MPRAGE_run-1_T1w.nii.gz
| |-- sub-003_acq-SPC_run-1_T2w.json
| `-- sub-003_acq-SPC_run-1_T2w.nii.gz
|-- fmap
| |-- sub-003_acq-cmrr2p0isomb3me2TR2095SBRef_dir-PA_run-1_epi.json
| `-- sub-003_acq-cmrr2p0isomb3me2TR2095SBRef_dir-PA_run-1_epi.nii.gz
`-- func
|-- sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_bold.json
|-- sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_bold.nii.gz
|-- sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.json
`-- sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.nii.gz
mentat005/sub-003$ grep -r IntendedFor
fmap/sub-003_acq-cmrr2p0isomb3me2TR2095SBRef_dir-PA_run-1_epi.json: "IntendedFor": "func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_sbref.nii.gz"
The above only works without error if I change the IntendedFor
to the bold image: func/sub-003_task-cmrr2p0isomb3me2TR2095_dir-AP_run-1_bold.nii.gz
I experience a very similar behavior in fMRIPrep 21.0.1.
If one or both AP/PA sbref images are in the func/
folder, then despite correctly setting the B0FieldSource
and B0FieldIdentifier
, fmriprep complains that it doesn't support "sophisticated PEPOLAR schemes". In that case, the SBref images have both fields set to the same value. (ie they are both sources and "recipients" of the fieldmap, as in the cases 2 & 4 in https://github.com/nipreps/fmriprep/issues/2667)
I can make it work by copying the sbref files to fmap/
folder. Then the Sbrefs in func/
only get the B0FieldIdentifier
field, while their copies in fmap/
get the B0FieldSource
field. In such a case, everything works fine.
The problem I have with the second approach is that it requires silly copying of files, and I think having sbrefs in fmap/
folder is irregular with respect to the BIDS specification.
I don't know if the problem arises because one fmriprep does not tolerate both B0FieldSource
and B0FieldIdentifier
set in the same image, or because it doesn't tolerate B0FieldSource
for BOLD images in func/
folder. But in either case, I think it does not align with the changes intended to be made in the newest fmriprep (described in https://github.com/nipreps/fmriprep/issues/2667).