Slice timing correction in fmriprep failed

When running fmriprep on a new subject, slice timing correction has failed for only one of its 10 bold runs (extinction). This particular error has only occurred for this one subject. Would appreciate any help or guidance, the slice_timing in the json for this subject’s extinction run is the same as all the other subjects’ extinction jsons. Here is the crash report:

Node: fmriprep_wf.single_subject_CCX010_wf.func_preproc_ses_1_task_extinction_wf.bold_stc_wf.slice_timing_correction
Working directory: /scratch/06866/nkell12/fmriprep/fmriprep_wf/single_subject_CCX010_wf/func_preproc_ses_1_task_extinction_wf/bold_stc_wf/slice_timing_correction

Node inputs:

args =
environ = {}
ignore = 1
in_file = /scratch/06866/nkell12/CCX-bids-current/sub-CCX010/ses-1/func/sub-CCX010_ses-1_task-extinction_bold.nii.gz
interp =
num_threads = 1
out_file =
outputtype = NIFTI_GZ
rlt =
rltplus =
slice_encoding_direction = k
slice_timing = [0.002735, 0.0, 0.0028125, 7.75e-05, 0.0028875, 0.0001525, 0.0029625, 0.0002275, 0.00304, 0.000305, 0.003115, 0.00038, 0.0031925, 0.0004575, 0.0032675, 0.0005325, 0.0033425, 0.0006075, 0.00342, 0.000685, 0.003495, 0.00076, 0.00357, 0.000835, 0.0036475, 0.0009125, 0.0037225, 0.0009875, 0.0038, 0.001065, 0.003875, 0.00114, 0.00395, 0.001215, 0.0040275, 0.0012925, 0.0041025, 0.0013675, 0.00418, 0.001445, 0.004255, 0.00152, 0.00433, 0.001595, 0.0044075, 0.0016725, 0.0044825, 0.0017475, 0.0045575, 0.001825, 0.004635, 0.0019, 0.00471, 0.001975, 0.0047875, 0.0020525, 0.0048625, 0.0021275, 0.0049375, 0.0022025, 0.005015, 0.00228, 0.00509, 0.002355, 0.0051675, 0.0024325, 0.0052425, 0.0025075, 0.0053175, 0.0025825, 0.005395, 0.00266]
tpattern =
tr = 1s
tslice =
tzero = 0.003

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 521, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 639, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 751, in _run_command
f"Exception raised while executing Node {self.name}.\n\n{result.runtime.traceback}"
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node slice_timing_correction.

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 454, in aggregate_outputs
setattr(outputs, key, val)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py”, line 330, in validate
value = super(File, self).validate(objekt, name, value, return_pathlike=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py”, line 135, in validate
self.error(objekt, name, str(value))
File “/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py”, line 172, in error
value )
traits.trait_errors.TraitError: The ‘out_file’ trait of a TShiftOutputSpec instance must be a pathlike object or string representing an existing file, but a value of ‘/scratch/06866/nkell12/fmriprep/fmriprep_wf/single_subject_CCX010_wf/func_preproc_ses_1_task_extinction_wf/bold_stc_wf/slice_timing_correction/sub-CCX010_ses-1_task-extinction_bold_tshift.nii.gz’ <class ‘str’> was specified.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 401, in run
outputs = self.aggregate_outputs(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 461, in aggregate_outputs
raise FileNotFoundError(msg)
FileNotFoundError: No such file or directory ‘/scratch/06866/nkell12/fmriprep/fmriprep_wf/single_subject_CCX010_wf/func_preproc_ses_1_task_extinction_wf/bold_stc_wf/slice_timing_correction/sub-CCX010_ses-1_task-extinction_bold_tshift.nii.gz’ for output ‘out_file’ of a TShift interface

Hello,

Might just be a fluke in writing to the scratch directory. Does the error message repeat if you rerun the subject, and if so maybe try a fresh working directory?

Has this error happened consistently and on multiple subjects? If so, is it the same kind of acquisition across subjects?

Best,
Steven

Hello,

Thanks for your response! The error hasn’t happened with any other subjects, which is why I thought it was weird (it is the same kind of acquisition across subjects). All the other subjects are in the same scratch directory.

Can you try rerunning that subject with a fresh working directory?

Hello! Thanks for the suggestion. I tried doing re-running the subject with a fresh working directory but it didn’t fix the issue for this particular extinction run (however unrelated, doing this actually fixed an issue with two other subjects that were giving me errors so thank you for that!).

Here is the json file for the extinction run for this subject, where it is failing to do the slice_timing_correction:

{“InPlanePhaseEncodingDirectionDICOM”: “COL”, “DeviceSerialNumber”: “175689”, “AcquisitionMatrixPE”: 86, “ImageOrientationPatientDICOM”: [0.997168, 0.0234641, 0.0714484, -0.038656, 0.974881, 0.219344], “EffectiveEchoSpacing”: 0.000540004, “TotalReadoutTime”: 0.0459003, “ManufacturersModelName”: “MAGNETOM_Vida”, “ProtocolName”: “Run3_extinction”, “PhaseEncodingDirection”: “j-”, “BandwidthPerPixelPhaseEncode”: 21.533, “RepetitionTime”: 1, “BodyPartExamined”: “BRAIN”, “SeriesNumber”: 19, “MRAcquisitionType”: “2D”, “SpacingBetweenSlices”: 2.5, “SliceThickness”: 2.5, “AcquisitionNumber”: 1, “InstitutionName”: “UT_Health_Austin_3T”, “MultibandAccelerationFactor”: 6, “ImageType”: [“ORIGINAL”, “PRIMARY”, “FMRI”, “NONE”], “DerivedVendorReportedEchoSpacing”: 0.000540004, “PixelBandwidth”: 2422, “Manufacturer”: “Siemens”, “PercentPhaseFOV”: 100, “ReconMatrixPE”: 86, “FlipAngle”: 73, “InstitutionAddress”: “1601B_Trinity_Austin_Houston_US_78712”, “SeriesDescription”: “Run3_extinction_RR”, “ConversionSoftwareVersion”: “v1.0.20181114 GCC7.3.0”, “AcquisitionTime”: “16:18:56.182500”, “MagneticFieldStrength”: 3, “TaskName”: “extinction”, “CoilString”: “HeadNeck_64_CS”, “ReceiveCoilActiveElements”: “HC1-7”, “EchoTime”: 0.03, “SequenceVariant”: “SK”, “SliceTiming”: [0.002735, 0, 0.0028125, 7.75e-05, 0.0028875, 0.0001525, 0.0029625, 0.0002275, 0.00304, 0.000305, 0.003115, 0.00038, 0.0031925, 0.0004575, 0.0032675, 0.0005325, 0.0033425, 0.0006075, 0.00342, 0.000685, 0.003495, 0.00076, 0.00357, 0.000835, 0.0036475, 0.0009125, 0.0037225, 0.0009875, 0.0038, 0.001065, 0.003875, 0.00114, 0.00395, 0.001215, 0.0040275, 0.0012925, 0.0041025, 0.0013675, 0.00418, 0.001445, 0.004255, 0.00152, 0.00433, 0.001595, 0.0044075, 0.0016725, 0.0044825, 0.0017475, 0.0045575, 0.001825, 0.004635, 0.0019, 0.00471, 0.001975, 0.0047875, 0.0020525, 0.0048625, 0.0021275, 0.0049375, 0.0022025, 0.005015, 0.00228, 0.00509, 0.002355, 0.0051675, 0.0024325, 0.0052425, 0.0025075, 0.0053175, 0.0025825, 0.005395, 0.00266], “ImagingFrequency”: 123.224, “EchoTrainLength”: 86, “ConversionSoftware”: “dcm2niix”, “SoftwareVersions”: “syngo_MR_XA20”, “StationName”: “AWP175689”, “Modality”: “MR”, “PatientPosition”: “HFS”}

And here it is for a different subject where there were no errors:

{“Modality”: “MR”, “MagneticFieldStrength”: 3, “ImagingFrequency”: 123.223, “Manufacturer”: “Siemens”, “ManufacturersModelName”: “MAGNETOM_Vida”, “InstitutionName”: “UT_Health_Austin_3T”, “InstitutionAddress”: “1601B_Trinity_Austin_Houston_US_78712”, “DeviceSerialNumber”: “175689”, “StationName”: “AWP175689”, “BodyPartExamined”: “BRAIN”, “PatientPosition”: “HFS”, “SoftwareVersions”: “syngo_MR_XA20”, “MRAcquisitionType”: “2D”, “SeriesDescription”: “Run3_extinction”, “ProtocolName”: “Run3_extinction”, “SequenceVariant”: “SK”, “ImageType”: [“ORIGINAL”, “PRIMARY”, “FMRI”, “NONE”], “SeriesNumber”: 15, “AcquisitionTime”: “15:30:46.992500”, “AcquisitionNumber”: 1, “SliceThickness”: 2.5, “SpacingBetweenSlices”: 2.5, “EchoTime”: 0.03, “RepetitionTime”: 1, “FlipAngle”: 73, “ReceiveCoilActiveElements”: “HC1-7”, “CoilString”: “HeadNeck_64_CS”, “MultibandAccelerationFactor”: 6, “PercentPhaseFOV”: 100, “EchoTrainLength”: 86, “AcquisitionMatrixPE”: 86, “ReconMatrixPE”: 86, “BandwidthPerPixelPhaseEncode”: 21.533, “EffectiveEchoSpacing”: 0.000540004, “DerivedVendorReportedEchoSpacing”: 0.000540004, “TotalReadoutTime”: 0.0459003, “PixelBandwidth”: 2422, “PhaseEncodingDirection”: “j-”, “SliceTiming”: [0.002735, 0, 0.00281, 7.5e-05, 0.0028875, 0.0001525, 0.0029625, 0.0002275, 0.00304, 0.000305, 0.003115, 0.00038, 0.00319, 0.000455, 0.0032675, 0.0005325, 0.0033425, 0.0006075, 0.00342, 0.000685, 0.003495, 0.00076, 0.00357, 0.000835, 0.0036475, 0.0009125, 0.0037225, 0.0009875, 0.0037975, 0.0010625, 0.003875, 0.00114, 0.00395, 0.001215, 0.0040275, 0.0012925, 0.0041025, 0.0013675, 0.0041775, 0.0014425, 0.004255, 0.00152, 0.00433, 0.001595, 0.0044075, 0.0016725, 0.0044825, 0.0017475, 0.0045575, 0.0018225, 0.004635, 0.0019, 0.00471, 0.001975, 0.004785, 0.0020525, 0.0048625, 0.0021275, 0.0049375, 0.0022025, 0.005015, 0.00228, 0.00509, 0.002355, 0.005165, 0.00243, 0.0052425, 0.0025075, 0.0053175, 0.0025825, 0.005395, 0.00266], “ImageOrientationPatientDICOM”: [0.999616, 0.0125816, 0.0246746, -0.0130857, 0.999707, 0.0203749], “InPlanePhaseEncodingDirectionDICOM”: “COL”, “ConversionSoftware”: “dcm2niix”, “ConversionSoftwareVersion”: “v1.0.20181114 GCC7.3.0”, “Dcm2bidsVersion”: “2.1.4”, “TaskName”: “extinction”}

The only difference I spot is that in the subject where it failed the “ProtocolName” (Run3_extinction) and the “SeriesDescription” (Run3_extinction_RR) name are different, could this be causing the issue?

Thank you!

Glad it at least helped a bit!

That should not be causing an issue, but as a test, could you try to rerun after making a json for the run that isn’t working that has all the same parameters (besides slice timing) as the working json, but keep the slice timing. (make sure to keep a copy of the original json)

Best,
Steven

I will try this and update! Thank you for your help.