fMRIPrep. SDC not applied

Summary of what happened:

Hello,
I have bold images and reverse fMRI (epi) in opposite phase encoding direction, in the epi JSON file I added intended for, but still I can not activate topup and sdc correction.

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

singularity run -B /scratch --cleanenv fmriprep-21.0.1.simg mahsa96/V1Bids mahsa96/V1Bids/derivatives participant --participant-label 02\
	    --skip-bids-validation \
	    --fs-no-reconall \
	    --md-only-boilerplate \
	     --topup-max-vols 5\
	    --fs-license-file mahsa96/V1Bids/derivatives/license.txt \
	    --bold2t1w-dof 12\
	    --output-spaces MNI152NLin6Asym\
	    -w mahsa96/mywork1\
	    --stop-on-first-crash\
	    --nthreads 16

Version:

21.0.1

Environment (Docker, Singularity, custom installation):

Singularity

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

Relevant log outputs (up to 20 lines):

Screenshots / relevant information:

Hi @Mahsa,

I have relabeled your post as Software Support and reorganized it according to the appropriate post template. In the future please submit software questions under this post category. Please provide the missing information by editing your post which will help us assist you better.

Additionally, the following information will help:

  1. Does this behavior persist on the most current version (23.0.1)?
  2. Can you print the contents of one one of your fmap JSON files, as well as the outputs of tree on one of your subject directories?

Best,
Steven

1 Like

Thank you so much,
I have not tried the new version yet since I think my command has a problem,
here is the content of JSON files:
bold:

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 127.764,
    "Manufacturer": "Philips",
    "ManufacturersModelName": "Ingenia",
    "InstitutionName": "CHUS FLEURIMONT Philips 3t",
    "InstitutionalDepartmentName": "IRM",
    "DeviceSerialNumber": "71081",
    "StationName": "PHILIPS-TQJ73JP",
    "BodyPartExamined": "BRAIN",
    "PatientPosition": "HFS",
    "SoftwareVersions": "5.4.1\\5.4.1.1",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "fMRI MB4 3mm",
    "ProtocolName": "WIP fMRI MB4 3mm",
    "ScanningSequence": "GR",
    "SequenceVariant": "SK",
    "ScanOptions": "FS",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "FFE",
        "M",
        "FFE"
    ],
    "SeriesNumber": 301,
    "PhaseEncodingDirection":"j",
    "AcquisitionTime": "11:31:4.910000",
    "AcquisitionNumber": 3,
    "PhilipsRWVSlope": 0.867155,
    "PhilipsRWVIntercept": 0,
    "PhilipsRescaleSlope": 0.867155,
    "PhilipsRescaleIntercept": 0,
    "PhilipsScaleSlope": 0.0240969,
    "UsePhilipsFloatNotDisplayScaling": 1,
    "SliceThickness": 3,
    "SpacingBetweenSlices": 3,
    "SAR": 0.045679,
    "EchoTime": 0.03,
    "RepetitionTime": 1.075,
    "SliceTiming":[0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000],
    "MTState": false,
    "FlipAngle": 55,
    "CoilString": "MULTI COIL",
    "PercentPhaseFOV": 100,
    "PercentSampling": 100,
    "EchoTrainLength": 67,
    "PhaseEncodingSteps": 80,
    "AcquisitionMatrixPE": 80,
    "ReconMatrixPE": 80,
    "ParallelReductionFactorInPlane": 1.2,
    "ParallelAcquisitionTechnique": "SENSE",
    "WaterFatShift": 17.7943,
    "EffectiveEchoSpacing": 0.000510896,
    "TotalReadoutTime": 0.0403608,
    "PixelBandwidth": 2241,
    "PhaseEncodingAxis": "j",
    "ImageOrientationPatientDICOM": [
        0.995206,
        -0.0132422,
        0.0969009,
        0.0398551,
        0.959703,
        -0.278176
    ],
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20211220",
    "Dcm2bidsVersion": "2.1.6"
}

and epi:
{>

"Modality": "MR",
"MagneticFieldStrength": 3,
"ImagingFrequency": 127.764,
"Manufacturer": "Philips",
"ManufacturersModelName": "Ingenia",
"InstitutionName": "CHUS FLEURIMONT Philips 3t",
"InstitutionalDepartmentName": "IRM",
"DeviceSerialNumber": "71081",
"StationName": "PHILIPS-TQJ73JP",
"BodyPartExamined": "BRAIN",
"PatientPosition": "HFS",
"SoftwareVersions": "5.4.1\\5.4.1.1",
"MRAcquisitionType": "2D",
"SeriesDescription": "rev fMRI MB4 3mm",
"ProtocolName": "WIP rev fMRI MB4 3mm",
"ScanningSequence": "GR",
"SequenceVariant": "SK",
"ScanOptions": "FS",
"ImageType": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "FFE",
    "M",
    "FFE"
],
"SeriesNumber": 401,
"AcquisitionTime": "11:41:43.190000",
"AcquisitionNumber": 4,
"PhilipsRWVSlope": 0.793895,
"PhilipsRWVIntercept": 0,
"PhilipsRescaleSlope": 0.793895,
"PhilipsRescaleIntercept": 0,
"PhilipsScaleSlope": 0.0244135,
"UsePhilipsFloatNotDisplayScaling": 1,
"SliceThickness": 3,
"SpacingBetweenSlices": 3,
"SAR": 0.0452711,
"EchoTime": 0.030001,
"RepetitionTime": 1.075,
"SliceTiming":[0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000,0,0.0447916500000000,0.0895833000000000,0.246354075000000,0.201562425000000,0.156770775000000,0.0223958250000000,0.0671874750000000,0.111979125000000,0.223958250000000,0.179166600000000,0.134374950000000],
"MTState": false,
"FlipAngle": 55,
"CoilString": "MULTI COIL",
"PercentPhaseFOV": 100,
"PercentSampling": 100,
"EchoTrainLength": 67,
"PhaseEncodingSteps": 80,
"AcquisitionMatrixPE": 80,
" PhaseEncodingDirection":"j-",
"ReconMatrixPE": 80,
"ParallelReductionFactorInPlane": 1.2,
"ParallelAcquisitionTechnique": "SENSE",
"WaterFatShift": 17.6939,
"EffectiveEchoSpacing": 0.000508013,
"TotalReadoutTime": 0.040133,
"PixelBandwidth": 2318,
"PhaseEncodingAxis": "j",
"ImageOrientationPatientDICOM": [
    0.995206,
    -0.0132422,
    0.0969009,
    0.0398551,
    0.959703,
    -0.278176
],
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.20211220",
"Dcm2bidsVersion": "2.1.6",
"IntendedFor": "func/sub-02_task-rest_bold.nii.gz"

}
and the output tree:

Sorry for confusion, but I was referring to the organization of the raw data directory.

Please also provide the BIDS validation report and relevant fMRIPrep logs, as asked for in the post template.

Best,
Steven

Well, I skip the bids validation in my command, I don’t think I can’t find any reports on that, and here is the raw tree:

Please try not skipping bids validation.

Hello, I did bids validation and no problem there, I used topup-max-vol flag and SDC correction is applied on version 21.0.1, but it has bug so I updated my fmriprep to version 23.0.1, and without topup-max-vol , SDC correction does not work, (topup-max-vol is depricated)

What is the error? Does it work if you remove the deprecated flag?

yes it works with no SDC correction.
and the error with flag is : unrecognized arguments: --topup-max-vols 5

How do you know SDC is not being applied? Is there a relevant log output you can share?

in the output html file it says that it is not applied!

Do you have the log output? Usually towards the beginning it shows results for looking for BOLD-fmap associations.

Also what was the report from the BIDS validator?

Here is the report of BIDS validator:
bids-validator@1.8.0

1: [WARN] The recommended file /README is missing. See Section 03 (Modality agnostic files) of the BIDS specification. (code: 101 - README_FILE_MISSING)

Please visit https://neurostars.org/search?q=README_FILE_MISSING for existing conversations about this issue.

2: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered because there are no authors, which will make DOI registration from dataset metadata impossible. (code: 113 - NO_AUTHORS)

Please visit https://neurostars.org/search?q=NO_AUTHORS for existing conversations about this issue.


    Summary:                 Available Tasks:        Available Modalities: 
    7 Files, 150.51MB                                MRI                   
    1 - Subject                                                            
    1 - Session                                                            


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

and I can not find anything related to SDC in logs file.

I just realized your fmap file has task-rest in the filenames. FMAP files should not have the task-<task> label. Try changing it to acq-rest.

Do I only need to change it in fmap file? or renaming it in bold file too?

Oh actually I changed my tree to this:

No, BOLD file is fine, look at naming conventions here: Magnetic Resonance Imaging - Brain Imaging Data Structure v1.8.0

1 Like

I recently had a scenario where my SDC stopped working with the newer versions of fMRIPrep ( v23.0.# ) , even though my BIDS structure was identical to before.

After some trouble shooting i found that i had to set a couple additional fields in the JSON associated with the fmap and funcs to properly trigger the SDC correction i needed.

In my func JSON i had to add:
"B0FieldSource": "pepolar_fmap0",

In my fmap i had to add:
"B0FieldIdentifier": "pepolar_fmap0",

And also change the BIDS URI slightly to include more of the directory structure:

 "IntendedFor": [
  "bids::sub-1106/ses-01/func/sub-1106_ses-01_task-reward_run-01_echo-1_bold.nii.gz",
  "bids::sub-1106/ses-01/func/sub-1106_ses-01_task-reward_run-01_echo-1_acq-ricor_bold.nii",
  "bids::sub-1106/ses-01/func/sub-1106_ses-01_task-reward_run-02_echo-1_bold.nii.gz",
  "bids::sub-1106/ses-01/func/sub-1106_ses-01_task-reward_run-02_echo-1_acq-ricor_bold.nii"
 ],

I found the info about identifier and source after digging through the bids spec:
https://bids-specification.readthedocs.io/en/stable/04-modality-specific-files/01-magnetic-resonance-imaging-data.html#using-b0fieldidentifier-metadata

If you have B0Field* specified, the IntendedFor will have no effect. In fact, we don’t yet support bids:: URIs, since it’s easier to tell people to use B0Field* than to properly test URIs.