Slicetiming error - fmriprep docker

Summary of what happened:

Helo I am trying to run fmriprep between different sequences to test their relative SNR. I have 5 sequences and I have been able to run successfully 4 of them but for one of them I get the subsequent error:

    1: [ERR] "SliceTiming" value/s contains invalid value as it is greater than RepetitionTime.  SliceTiming values should be in seconds not milliseconds (common mistake). (code: 66 - SLICETIMING_VALUES_GREATOR_THAN_REPETITION_TIME)
            ./sub-1/func/sub-1_task-rest_bold.nii.gz
                    Evidence: 0.14, 0.21, 0.28, 0.35, 0.42, 0.49, 0.56, 0.63, 0.7, 0.77, 0.84, 0.91, 0.98, 1.05, 1.12, 1.19, 1.26, 1.33, 1.4, 1.47, 1.54, 1.61, 1.68, 1.75, 1.82, 1.89

I have spoken with the radiographers about the sequence and originally this was supposed to have 48 slices but ended up having 28 slices due to some reason but I am taking over a previous project so I do not know the specifics. As a result, I do not know if that is influencing somehow this issue.

Command used:

fmriprep-docker /mnt/d/Struct_learning_fMRI/MRI_Seq_eval/Scanning_for_BIDS/Nifti1/ /mnt/d/Struct_learning_fMRI/MRI_Seq_eval/Scanning_for_BIDS/Nifti1/sub-1/derivatives/ participant --participant-label 1 --fs-no-reconall --low-mem --dummy-scans 5

Version: 23.1.4

Environment: Docker, WSL2 on Windows10

Data formatted according to BIDS standard via: Heudiconv version 1.0.0

Would anyone be able to help with this?

Json contents are below:

{
  "AcquisitionMatrixPE": 64,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "11:27:3.215000",
  "BaseResolution": 64,
  "BodyPartExamined": "HEAD",
  "CogAtlasID": "http://www.cognitiveatlas.org/task/id/TODO",
  "CoilCombinationMethod": "Sum of Squares",
  "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "167025",
  "DwellTime": 3.4e-06,
  "EchoTime": 0.03,
  "FlipAngle": 90,
  "HeudiconvVersion": "1.0.0",
  "ImageOrientationPatientDICOM": [1, 0, 0, 0, 0.866025, -0.5],
  "ImageOrientationText": "Tra>Cor(-30.0)",
  "ImageType": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "ND",
    "MOSAIC"
],
  "ImagingFrequency": 123.255,
  "InPlanePhaseEncodingDirectionDICOM": "COL",
  "InstitutionAddress": "Queen Square 12,London,Southeast,GB,WC1N 3BG",
  "InstitutionName": "FIL",
  "InstitutionalDepartmentName": "Department",
  "MRAcquisitionType": "2D",
  "MagneticFieldStrength": 3,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "Prisma_fit",
  "MatrixCoilMode": "SENSE",
  "Modality": "MR",
  "NonlinearGradientCorrection": false,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseEncodingDirection": "j-",
  "PhaseEncodingSteps": 72,
  "PhaseOversampling": 0.12,
  "PhaseResolution": 1,
  "PixelBandwidth": 2300,
  "ProcedureStepDescription": "FIL^Nadine",
  "ProtocolName": "nc_epi2d_v2o_3mm_OFC_Amy_64ch",
  "PulseSequenceDetails": "%CustomerSeq%\\nc_epi2d_v2o",
  "ReceiveCoilActiveElements": "HC1-7",
  "ReceiveCoilName": "HeadNeck_64",
  "ReconMatrixPE": 64,
  "RepetitionTime": 0.07,
  "SAR": 0.0872434,
  "ScanOptions": "FS",
  "ScanningSequence": "RM",
  "SequenceName": "ep2dv2o2d1",
  "SequenceVariant": "SP\\OSP",
  "SeriesDescription": "nc_epi2d_v2o_3mm_OFC_Amy_64ch",
  "SeriesNumber": 2,
  "ShimSetting": [-169, -1703, 970, 504, -145, -23, -89, 32],
  "SliceThickness": 2.5,
  "SliceTiming": [0, 0.07, 0.14, 0.21, 0.28, 0.35, 0.42, 0.49, 0.56, 0.63, 0.7, 0.77, 0.84, 0.91, 0.98, 1.05, 1.12, 1.19, 1.26, 1.33, 1.4, 1.47, 1.54, 1.61, 1.68, 1.75, 1.82, 1.89],
  "SoftwareVersions": "syngo MR E11",
  "SpacingBetweenSlices": 3,
  "StationName": "MRC35437",
  "TaskName": "TODO: full task name for rest",
  "TxRefAmp": 202.476
}

Thank you.

Hi @G.Tertikas,

Do you know about how the slices should be organized (e.g., interleaved ascending)? If so, you can recreate the slicetiming based on that information. Also, the TR of the data is very short, at 0.07. Is this a typo? Should it be the same as your other BOLD scans?

Also

This flag is not recommended. I would also specify a working directory with the -w argument.

Best,
Steven

Hi Steven,

Thank you for the fast reply. So the radiographers have mentioned that it is an ascending sequential sequence and that it takes 0.07 sec to acquire each slice (resulting in 0.07*28 slices= 1.96). However it seems that all the headers and JSON files say TR=0.07 and that could be the issue here, when in reality it should be 1.96 based on this. Is there a workaround that you would recommend for this? I tried manually adjusting the JSON files but then I got an error since the scan’s header and the JSON metadata file do not match.

Thanks again,

George

Hi @G.Tertikas,

Looks like fsledithd has worked in the past, as suggested in another thread: Safely changing header with nibabel - #5 by highlands

Best,
Steven

Thank you very much. I tried this and the BIDS check was able to pass successfully. However now I receive the following error :

Node: fmriprep_23_1_wf.single_subject_1_wf.func_preproc_task_rest_wf.unwarp_wf.rotime
Working directory: /tmp/work/fmriprep_23_1_wf/single_subject_1_wf/func_preproc_task_rest_wf/unwarp_wf/rotime

Node inputs:

in_file =
metadata = {‘AcquisitionMatrixPE’: 64, ‘AcquisitionNumber’: 1, ‘AcquisitionTime’: ‘11:27:3.215000’, ‘BaseResolution’: 64, ‘BodyPartExamined’: ‘HEAD’, ‘CogAtlasID’: ‘http://www.cognitiveatlas.org/task/id/TODO’, ‘CoilCombinationMethod’: ‘Sum of Squares’, ‘ConsistencyInfo’: ‘N4_VE11C_LATEST_20160120’, ‘ConversionSoftware’: ‘dcm2niix’, ‘ConversionSoftwareVersion’: ‘v1.0.20220720’, ‘DeviceSerialNumber’: ‘167025’, ‘DwellTime’: 3.4e-06, ‘EchoTime’: 0.03, ‘FlipAngle’: 90, ‘HeudiconvVersion’: ‘1.0.0’, ‘ImageOrientationPatientDICOM’: [1, 0, 0, 0, 0.866025, -0.5], ‘ImageOrientationText’: ‘Tra>Cor(-30.0)’, ‘ImageType’: [‘ORIGINAL’, ‘PRIMARY’, ‘M’, ‘ND’, ‘MOSAIC’], ‘ImagingFrequency’: 123.255, ‘InPlanePhaseEncodingDirectionDICOM’: ‘COL’, ‘InstitutionAddress’: ‘Queen Square 12,London,Southeast,GB,WC1N 3BG’, ‘InstitutionName’: ‘FIL’, ‘InstitutionalDepartmentName’: ‘Department’, ‘MRAcquisitionType’: ‘2D’, ‘MagneticFieldStrength’: 3, ‘Manufacturer’: ‘Siemens’, ‘ManufacturersModelName’: ‘Prisma_fit’, ‘MatrixCoilMode’: ‘SENSE’, ‘Modality’: ‘MR’, ‘NonlinearGradientCorrection’: True, ‘PartialFourier’: 1, ‘PatientPosition’: ‘HFS’, ‘PercentPhaseFOV’: 100, ‘PercentSampling’: 100, ‘PhaseEncodingDirection’: ‘j-’, ‘PhaseEncodingSteps’: 72, ‘PhaseOversampling’: 0.12, ‘PhaseResolution’: 1, ‘PixelBandwidth’: 2300, ‘ProcedureStepDescription’: ‘FIL^Nadine’, ‘ProtocolName’: ‘nc_epi2d_v2o_3mm_OFC_Amy_64ch’, ‘PulseSequenceDetails’: ‘%CustomerSeq%\nc_epi2d_v2o’, ‘ReceiveCoilActiveElements’: ‘HC1-7’, ‘ReceiveCoilName’: ‘HeadNeck_64’, ‘ReconMatrixPE’: 64, ‘RepetitionTime’: 1.96, ‘SAR’: 0.0872434, ‘ScanOptions’: ‘FS’, ‘ScanningSequence’: ‘RM’, ‘SequenceName’: ‘ep2dv2o2d1’, ‘SequenceVariant’: ‘SP\OSP’, ‘SeriesDescription’: ‘nc_epi2d_v2o_3mm_OFC_Amy_64ch’, ‘SeriesNumber’: 2, ‘ShimSetting’: [-169, -1703, 970, 504, -145, -23, -89, 32], ‘SliceThickness’: 2.5, ‘SliceTiming’: [0, 0.07, 0.14, 0.21, 0.28, 0.35, 0.42, 0.49, 0.56, 0.63, 0.7, 0.77, 0.84, 0.91, 0.98, 1.05, 1.12, 1.19, 1.26, 1.33, 1.4, 1.47, 1.54, 1.61, 1.68, 1.75, 1.82, 1.89], ‘SoftwareVersions’: ‘syngo MR E11’, ‘SpacingBetweenSlices’: 3, ‘StationName’: ‘MRC35437’, ‘TaskName’: ‘rest’, ‘TxRefAmp’: 202.476}

Traceback (most recent call last):
File “/opt/conda/envs/fmriprep/lib/python3.10/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.10/site-packages/nipype/pipeline/engine/nodes.py”, line 527, in run
result = self._run_interface(execute=True)
File “/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py”, line 645, in _run_interface
return self._run_command(execute)
File “/opt/conda/envs/fmriprep/lib/python3.10/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 rotime.

Traceback:
Traceback (most recent call last):
File “/opt/conda/envs/fmriprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py”, line 397, in run
runtime = self._run_interface(runtime)
File “/opt/conda/envs/fmriprep/lib/python3.10/site-packages/sdcflows/interfaces/epi.py”, line 57, in _run_interface
self._results[“readout_time”] = get_trt(
File “/opt/conda/envs/fmriprep/lib/python3.10/site-packages/sdcflows/utils/epimanip.py”, line 228, in get_trt
raise ValueError(“Unknown total-readout time specification”)
ValueError: Unknown total-readout time specification

I am wondering if this is an issue with the utilisation of the fieldmaps. For reference the fieldmaps are of the full brain but the EPI scans only contain a section of the brain (28 volumes). Would this be related to this error or is this something else?

Thank you again,

George

Hi @G.Tertikas,

As described in the BIDS specification, a readout time is required metadata (TotalReadoutTime in the fmap jsons): Magnetic Resonance Imaging - Brain Imaging Data Structure v1.9.0.

I am not sure fieldmaps without full brain coverage will be useful.

Best,
Steven