fMRIPrep --use-syn-sdc does not proceed with SyN SDC, even in the absence of fmap directory

Summary of what happened:

I am trying to run fMRIPrep with the --use-syn-sdc flag but it does not look like it was applied.

Command used (and if a helper script was used, a link to the helper script or the command generated):

apptainer run --cleanenv \
-B /media/mpasternak/ADATA-1TB/GENFI_fMRI_ForceSynSDC:/data \
-B /media/mpasternak/ADATA-1TB/GENFI_fMRI_ForceSynSDC/derivatives/fmriprep:/output \
-B /tmp/sub-GRN007ForceSynSDCm9s2wrne:/work \
-B /tmp/fs_sub-GRN007ForceSynSDC__o4qel3k0:/output/sourcedata/freesurfer \
-B /home/mpasternak/freesurfer/.license:/opt/freesurfer/license.txt:ro \
-B /home/mpasternak/.cache/templateflow \
/home/mpasternak/apps/fmriprep-latest.simg \
/data \
/output \
participant \
-w /work \
--participant-label sub-GRN007ForceSynSDC \
--omp-nthreads 24 \
--fs-license-file /opt/freesurfer/license.txt \
--fs-subjects-dir /output/sourcedata/freesurfer \
--cifti-output \
--random-seed 42 \
--use-syn-sdc \
--ignore fieldmaps \
--force-syn \
--longitudinal

Version:

24.1.1

Environment (Docker, Singularity / Apptainer, custom installation):

Apptainer

Data formatted according to a validatable standard? Please provide the output of the validator:

It is BIDS compatible:

╰$ bids-validator .
bids-validator@1.14.10
(node:137755) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:137755) Warning: Closing directory handle on garbage collection
This dataset appears to be BIDS compatible.
        Summary:                 Available Tasks:        Available Modalities: 
        16 Files, 65.45MB        rest                    MRI                   
        1 - Subject                                                            
        2 - Sessions                                                           


	If you have any questions, please post on https://neurostars.org/tags/bids.

Relevant log outputs (up to 20 lines):

No errors occur and the pipeline exits without errors (fMRIPrep still outputs to both stdout and stderr as captured by Python’s subprocess.Popen…is that intentional?)
sub-GRN007ForceSynSDC_fmriprep.log.txt (244.4 KB)
sub-GRN007ForceSynSDC_fmriprep.err.txt (348.6 KB)
sub-GRN007ForceSynSDC.html.txt (77.9 KB)
No sign of the SDC workflow being run.

It does clearly recognize that it should proceed with the fieldmapless correction:

2024-11-13 17:20:12,796 [    INFO] Option "--ignore fieldmaps" was set, but either "--use-syn-sdc" or "--force-syn" were given, so fieldmap-less estimation will be executed.

But that’s the only mention of SDC I see in the logs and no mention of skipping it.

Screenshots / relevant information:


Let’s get a layout of the land, so to speak:

.
├── derivatives
│   └── fmriprep
│       ├── logs
│       │   ├── CITATION.bib
│       │   ├── CITATION.html
│       │   ├── CITATION.md
│       │   ├── CITATION.tex
│       │   ├── python_fmriprep_run.log
│       │   ├── sub-GRN007ForceSynSDC_fmriprep.err
│       │   └── sub-GRN007ForceSynSDC_fmriprep.log
│       ├── scripts
│       ├── sourcedata
│       │   └── freesurfer
│       ├── sub-GRN007ForceSynSDC
│       │   ├── anat
│       │   ├── figures
│       │   ├── log
│       │   ├── ses-V01
│       │   └── ses-V02
│       ├── dataset_description.json
│       ├── desc-aparcaseg_dseg.tsv
│       ├── desc-aseg_dseg.tsv
│       └── sub-GRN007ForceSynSDC.html
├── sub-GRN007ForceSynSDC
│   ├── ses-V01
│   │   ├── anat
│   │   │   ├── sub-GRN007ForceSynSDC_ses-V01_acq-Philips3Tt1_rec-Real_T1w.json
│   │   │   ├── sub-GRN007ForceSynSDC_ses-V01_acq-Philips3Tt1_rec-Real_T1w.nii.gz
│   │   │   ├── sub-GRN007ForceSynSDC_ses-V01_acq-Philips3Tt2_rec-Real_T2w.json
│   │   │   └── sub-GRN007ForceSynSDC_ses-V01_acq-Philips3Tt2_rec-Real_T2w.nii.gz
│   │   └── func
│   │       ├── sub-GRN007ForceSynSDC_ses-V01_task-rest_acq-Philips3T_bold.json
│   │       └── sub-GRN007ForceSynSDC_ses-V01_task-rest_acq-Philips3T_bold.nii.gz
│   └── ses-V02
│       ├── anat
│       │   ├── sub-GRN007ForceSynSDC_ses-V02_acq-Philips3Tt1_rec-Real_T1w.json
│       │   ├── sub-GRN007ForceSynSDC_ses-V02_acq-Philips3Tt1_rec-Real_T1w.nii.gz
│       │   ├── sub-GRN007ForceSynSDC_ses-V02_acq-Philips3Tt2_rec-Real_T2w.json
│       │   └── sub-GRN007ForceSynSDC_ses-V02_acq-Philips3Tt2_rec-Real_T2w.nii.gz
│       └── func
│           ├── sub-GRN007ForceSynSDC_ses-V02_task-rest_acq-Philips3T_bold.json
│           └── sub-GRN007ForceSynSDC_ses-V02_task-rest_acq-Philips3T_bold.nii.gz
├── dataset_description.json
├── participants.tsv
└── README.md

Would appreciate the thoughts of anyone on the fMRIPrep team.
Thanks!

For completeness, I’m also sharing the BOLD sidecar:

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 127.72687,
    "Manufacturer": "Philips",
    "ManufacturersModelName": "Achieva",
    "BodyPartExamined": "BRAIN",
    "PatientPosition": "HFS",
    "SoftwareVersions": "3.2.3\\3.2.3.0",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "GENFI_rs_fMRI",
    "ProtocolName": "GENFI_rs_fMRI",
    "ScanningSequence": "GR",
    "SequenceVariant": "SK",
    "ScanOptions": "FS",
    "PulseSequenceName": "FEEPI",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "FFE",
        "M",
        "FFE",
        "REAL"
    ],
    "SeriesNumber": 501,
    "AcquisitionTime": "17:33:31.140000",
    "AcquisitionNumber": 5,
    "PhilipsRescaleSlope": 2.30159,
    "PhilipsRescaleIntercept": 0,
    "PhilipsScaleSlope": 0.00128069,
    "UsePhilipsFloatNotDisplayScaling": 1,
    "SliceThickness": 3.3,
    "SpacingBetweenSlices": 3.3,
    "SAR": 0.0638778,
    "EchoTime": 0.030001,
    "RepetitionTime": 2.2,
    "MTState": false,
    "FlipAngle": 80,
    "CoilString": "Dual coil",
    "PercentPhaseFOV": 93.75,
    "PercentSampling": 100,
    "EchoTrainLength": 59,
    "PartialFourierDirection": "FREQUENCY",
    "PhaseEncodingSteps": 63,
    "FrequencyEncodingSteps": 64,
    "PhaseEncodingStepsOutOfPlane": 1,
    "AcquisitionMatrixPE": 63,
    "ReconMatrixPE": 80,
    "WaterFatShift": 15.5712,
    "EstimatedEffectiveEchoSpacing": 0.000446309,
    "EstimatedTotalReadoutTime": 0.0352584,
    "AcquisitionDuration": 316.8,
    "PixelBandwidth": 2297,
    "PhaseEncodingAxis": "j",
    "ImageOrientationPatientDICOM": [
        1,
        0,
        0,
        0,
        0.882038,
        -0.471179
    ],
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "BidsGuess": [
        "func",
        "_acq-SKGRFEEPI_run-501_bold"
    ],
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20240202",
    "TaskName": "rest",
    "SliceTiming": [
        0.0,
        0.3667,
        0.7333,
        1.1,
        1.4667,
        1.8333,
        0.0611,
        0.4278,
        0.7944,
        1.1611,
        1.5278,
        1.8944,
        0.1222,
        0.4889,
        0.8556,
        1.2222,
        1.5889,
        1.9556,
        0.1833,
        0.55,
        0.9167,
        1.2833,
        1.65,
        2.0167,
        0.2444,
        0.6111,
        0.9778,
        1.3444,
        1.7111,
        2.0778,
        0.3056,
        0.6722,
        1.0389,
        1.4056,
        1.7722,
        2.1389
    ],
    "B0FieldSource": "GRN007V02Fieldmap",
    "PhaseEncodingDirection": "j-",
    "EffectiveEchoSpacing": 0.000446309,
    "TotalReadoutTime": 0.0352584
}

Bumping this thread. Is there anything that can be provided to assist with troubleshooting?

I can’t immediately see why that should fail. It looks like you have the metadata needed.

Are there any B0FieldIdentifiers in your dataset? That might conflict.

Excellent hunch.

So, removing this field:

"B0FieldSource": "GRN007V02Fieldmap",

Seems to have allowed the module to proceed into the sdc pipeline.

For the record, it does fail:

2024-11-18 14:15:02,216 [   ERROR] Node bs_filter failed to run on host mpasternak.
2024-11-18 14:15:02,219 [   ERROR] Saving crash info to /output/sub-GRN007ForceSynSDC/log/20241118-102105_2341b651-2179-4b8c-821e-bbee7f1999ca/crash-20241118-141502-fmriprep-bs_filter-fe403925-1f2f-41c4-a56b-ac98fc4d56b5.txt
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node bs_filter.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/interfaces/bspline.py", line 225, in _run_interface
	    raise RuntimeError(
	RuntimeError: Spline fit of input file /work/fmriprep_24_1_wf/sub_GRN007ForceSynSDC_wf/fmap_preproc_wf/wf_auto_00000/zooms_field/fmap_syn0Warp_Hz_trans.nii.gz failed. Extreme value 1.31e+04 detected in spline coefficients.

But it does appear that the presence of any B0Field like keys in the BOLD metadata will take priority even over --force-syn.

Could you try nipreps/fmriprep:unstable? I believe the bs_filter problem is fixed, and it would be good to confirm.

Sorry to say it isn’t. This was the def file used to pull the unstable version:

Bootstrap: docker
From: nipreps/fmriprep:unstable

%post
    # Update package list and install PySocks
    apt-get update && apt-get install -y python3-pip
    pip3 install PySocks

Only thing that’s different is the extreme value is slightly less.

2024-11-18 18:05:26,592 [    INFO] [Node] Finished "bs_filter", elapsed time 925.628122s.
2024-11-18 18:05:26,593 [ WARNING] Storing result file without outputs
2024-11-18 18:05:26,593 [ WARNING] [Node] Error on "fmriprep_24_2_wf.sub_GRN007ForceSynSDC_wf.fmap_preproc_wf.wf_auto_00001.bs_filter" (/work/fmriprep_24_2_wf/sub_GRN007ForceSynSDC_wf/fmap_preproc_wf/wf_auto_00001/bs_filter)
2024-11-18 18:05:26,884 [   ERROR] Node bs_filter failed to run on host mpasternak.
2024-11-18 18:05:26,886 [   ERROR] Saving crash info to /output/sub-GRN007ForceSynSDC/log/20241118-162632_304bf9d2-e9d4-409b-9ab2-8fb88aa47a50/crash-20241118-180526-fmriprep-bs_filter-17062953-b122-4321-9dee-49852760ea83.txt
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/plugins/multiproc.py", line 67, in run_node
    result["result"] = node.run(updatehash=updatehash)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node bs_filter.

Traceback:
	Traceback (most recent call last):
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/nipype/interfaces/base/core.py", line 397, in run
	    runtime = self._run_interface(runtime)
	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/interfaces/bspline.py", line 225, in _run_interface
	    raise RuntimeError(
	RuntimeError: Spline fit of input file /work/fmriprep_24_2_wf/sub_GRN007ForceSynSDC_wf/fmap_preproc_wf/wf_auto_00001/zooms_field/fmap_syn0Warp_Hz_trans.nii.gz failed. Extreme value 1.25e+04 detected in spline coefficients.

Command is basically the same other than the apptainer instance being the unstable build. Random seed is always 42 for consistency:

apptainer run --cleanenv -B /media/mpasternak/ADATA-1TB/GENFI_fMRI_ForceSynSDC:/data -B /media/mpasternak/ADATA-1TB/GENFI_fMRI_ForceSynSDC/derivatives/fmriprep:/output -B /tmp/sub-GRN007ForceSynSDCc0iz0j56:/work -B /media/mpasternak/ADATA-1TB/GENFI_fMRI_ForceSynSDC/derivatives/fmriprep/sourcedata/freesurfer:/output/sourcedata/freesurfer -B /home/mpasternak/freesurfer/.license:/opt/freesurfer/license.txt:ro -B /home/mpasternak/.cache/templateflow /home/mpasternak/apps/fmriprep-unstable.simg /data /output participant -w /work --participant-label sub-GRN007ForceSynSDC --omp-nthreads 24 --fs-license-file /opt/freesurfer/license.txt --fs-subjects-dir /output/sourcedata/freesurfer --cifti-output --random-seed 42 --use-syn-sdc --ignore fieldmaps --force-syn --longitudinal

I’d be glad to test any changes down the line and I can give another subject a whirl with this.

Just confirming that running with:

  • stable, results in the bs_filter error
  • unstable, results in the bs_filter error
  • v23.2.3 proceeds without error