Using most updated version of fmriprep/niworkflows does not solve problem for traits.trait_errors.TraitError: The 'run' trait of a ReadSidecarJSONOutputSpec problem

Hi fmriprep experts,

I keep getting errors when we try to run fmriprep in docker with fieldmaps (we previously did not include IntendedFor fields and had no problem running fmriprep without the fieldmaps), and this does not seem to be due to an fmriprep/niworkflows update problem, as I’ve seen is the usual solution for the error I’m receiving:
traits.trait_errors.TraitError: The ‘run’ trait of a ReadSidecarJSONOutputSpec instance must be a unicode string, but a value of 1 <class ‘int’> was specified. (I can include the full error log in a separate comment if that helps)

Here is the command I ran:
docker run -ti --rm -v /home/jlegault/Documents/bids:/data:ro -v /home/jlegault/Documents:/out -v /home/qigroup/Documents/projects/blast/license.txt:/opt/freesurfer/license.txt poldracklab/fmriprep:latest /data /out/out participant --participant_label sub-blasta007

When I run this, it says my data are bids compliant, but I keep getting the trait error.

Interestingly, when I run this same command with the sample BIDSified HCP participant included in a neurostars topic (Fmriprep test data with fieldmap), it seems to run with no problem.

Therefore, I’m pretty sure the problem is with out json files. I’m including the json file contents a participant’s fmap phasediff.json file and that particpant’s corresponding fmri bold.json file. I have tried changing the phase encoding directions to be opposing (j and j-) and this does not seem to help.

Any feedback/ recommendations you have would be greatly appreciated.

fmap (phasediff.json) file contents:

{
“AcquisitionMatrixPE”: 70,
“AcquisitionNumber”: 1,
“AcquisitionTime”: “10:21:24.520000”,
“BaseResolution”: 70,
“BodyPartExamined”: “BRAIN”,
“ConsistencyInfo”: “N4_VE11C_LATEST_20160120”,
“ConversionSoftware”: “dcm2niix”,
“ConversionSoftwareVersion”: “v1.0.20180328 GCC6.3.0”,
“DeviceSerialNumber”: “66082”,
“DwellTime”: 4.7e-06,
“EchoNumber”: 2,
“EchoTime”: 0.00593,
“EchoTime1”: 0.00347,
“EchoTime2”: 0.00593,
“FlipAngle”: 55,
“ImageOrientationPatientDICOM”: [
0.999939,
0.0109528,
-0.00111273,
-0.0108208,
0.959178,
-0.282596
],
“ImageType”: [
“ORIGINAL”,
“PRIMARY”,
“P”,
“ND”
],
“InPlanePhaseEncodingDirectionDICOM”: “COL”,
“InstitutionAddress”: “East_Delaware_Ave.77-79_Newark_DE_US_19716",
“InstitutionName”: "University_of_Delaware
-_Life_Science_Inst.”,
“InstitutionalDepartmentName”: “Department”,
“IntendedFor”: [
“func/sub-blasta007_task-langloc_run-01_bold.nii.gz”,
“func/sub-blasta007_task-langloc_run-02_bold.nii.gz”
],
“MRAcquisitionType”: “2D”,
“MagneticFieldStrength”: 3,
“Manufacturer”: “Siemens”,
“ManufacturersModelName”: “Prisma”,
“Modality”: “MR”,
“PartialFourier”: 1,
“PatientPosition”: “HFS”,
“PercentPhaseFOV”: 100,
“PhaseEncodingDirection”: “j-”,
“PhaseEncodingSteps”: 70,
“PhaseResolution”: 1,
“PixelBandwidth”: 1520,
“ProcedureStepDescription”: “QLAB_Blast”,
“ProtocolName”: “taskbold_field_mapping_3mm”,
“PulseSequenceDetails”: “%SiemensSeq%_gre_field_mapping”,
“ReceiveCoilActiveElements”: “HC1-7”,
“ReceiveCoilName”: “HeadNeck_64”,
“ReconMatrixPE”: 70,
“RepetitionTime”: 0.5,
“SAR”: 0.0747471,
“ScanningSequence”: “GR”,
“SequenceName”: “_fm2d2r”,
“SequenceVariant”: “SP”,
“SeriesDescription”: “taskbold_field_mapping_3mm”,
“SeriesNumber”: 23,
“ShimSetting”: [
-1018,
-4096,
1247,
477,
-110,
-326,
-76,
-14
],
“SliceThickness”: 3,
“SoftwareVersions”: “syngo_MR_E11”,
“SpacingBetweenSlices”: 3.3,
“StationName”: “AWP66082”,
“TxRefAmp”: 216.47
}

func (bold.json) file contents:

{
“AcquisitionMatrixPE”: 70,
“AcquisitionNumber”: 1,
“AcquisitionTime”: “10:23:16.320000”,
“BandwidthPerPixelPhaseEncode”: 28.571,
“BaseResolution”: 70,
“BodyPartExamined”: “BRAIN”,
“ConsistencyInfo”: “N4_VE11C_LATEST_20160120”,
“ConversionSoftware”: “dcm2niix”,
“ConversionSoftwareVersion”: “v1.0.20180328 GCC6.3.0”,
“DerivedVendorReportedEchoSpacing”: 0.000500008,
“DeviceSerialNumber”: “66082”,
“DwellTime”: 2.6e-06,
“EchoTime”: 0.03,
“EchoTrainLength”: 70,
“EffectiveEchoSpacing”: 0.000500007,
“FlipAngle”: 49,
“ImageOrientationPatientDICOM”: [
0.999939,
0.0109528,
-0.00111273,
-0.0108208,
0.959178,
-0.282596
],
“ImageType”: [
“ORIGINAL”,
“PRIMARY”,
“M”,
“ND”,
“MOSAIC”
],
“InPlanePhaseEncodingDirectionDICOM”: “COL”,
“InstitutionAddress”: “East_Delaware_Ave.77-79_Newark_DE_US_19716",
“InstitutionName”: "University_of_Delaware
-_Life_Science_Inst.”,
“InstitutionalDepartmentName”: “Department”,
“MRAcquisitionType”: “2D”,
“MagneticFieldStrength”: 3,
“Manufacturer”: “Siemens”,
“ManufacturersModelName”: “Prisma”,
“Modality”: “MR”,
“MultibandAccelerationFactor”: 5,
“PartialFourier”: 1,
“PatientPosition”: “HFS”,
“PercentPhaseFOV”: 100,
“PhaseEncodingDirection”: “j-”,
“PhaseEncodingSteps”: 70,
“PhaseResolution”: 1,
“PixelBandwidth”: 2745,
“ProcedureStepDescription”: “QLAB_Blast”,
“ProtocolName”: “ep2d_bold_TR600_3mm_langLoc”,
“PulseSequenceDetails”: “%SiemensSeq%_ep2d_bold”,
“ReceiveCoilActiveElements”: “HC1-7”,
“ReceiveCoilName”: “HeadNeck_64”,
“ReconMatrixPE”: 70,
“RepetitionTime”: 0.6,
“SAR”: 0.0443519,
“ScanOptions”: “FS”,
“ScanningSequence”: “EP”,
“SequenceName”: “_epfid2d1_70”,
“SequenceVariant”: “SK”,
“SeriesDescription”: “ep2d_bold_TR600_3mm_langLoc”,
“SeriesNumber”: 24,
“ShimSetting”: [
-1018,
-4096,
1247,
477,
-110,
-326,
-76,
-14
],
“SliceThickness”: 3,
“SliceTiming”: [
0,
0.065,
0.13,
0.195,
0.2575,
0.3225,
0.3875,
0.4525,
0.515,
0,
0.065,
0.13,
0.195,
0.2575,
0.3225,
0.3875,
0.4525,
0.515,
0,
0.065,
0.13,
0.195,
0.2575,
0.3225,
0.3875,
0.4525,
0.515,
0,
0.065,
0.13,
0.195,
0.2575,
0.3225,
0.3875,
0.4525,
0.515,
0,
0.065,
0.13,
0.195,
0.2575,
0.3225,
0.3875,
0.4525,
0.515
],
“SoftwareVersions”: “syngo_MR_E11”,
“SpacingBetweenSlices”: 3.3,
“StationName”: “AWP66082”,
“TotalReadoutTime”: 0.0345005,
“TxRefAmp”: 216.47
}

Thank you for taking the time to read this post.

Best,

Jennifer Legault

Hi @jlegault. This issue was fixed in fMRIPrep 1.3.1. I’m assuming you’re running 1.3.0?

I’m actually using the latest version of fmriprep (poldracklab/fmriprep; latest version; image ID: 2877bdfa7237; created 6 months ago)

You’re going to need to docker pull poldracklab/fmriprep:latest to use the latest version. I would recommend using specific version numbers, as the behavior of docker run poldracklab/fmriprep:latest will depend on when it was last pulled.

Thank you so much for that important clarification. Everything is working well now!