Error with node '_split' using fMRIPREP (distortion correction with fieldmap data)

Hi,

I encountered an error ‘Node split failed to run on host d8e02eaca1d2’ while running fMRIPREP.

The issue seems to be directly relevant to one of the Python scripts ‘genericpath.py’ where it fails to read paths to all EPI files from _phasediff.json for distortion correction.

I’ve converted raw DICOM to NIFTI using HeuDiConv and manually inputed ‘IntendedFor’: [‘path/to/file,’ ‘path/to/file2’, …] in each phasediff.json file. All subject directories passed bids validation.

I couldn’t find any error reports similar to this one, so I’d really appreciate if someone can help me solve it.

Below is the error log:

Node:fmriprep_wf.single_subject_00001_wf.func_preproc_ses_01_task_prl_run_02_wf.sdc_estimate_wf.phdiff_wf.split
Working directory: /tmp/work/fmriprep_wf/single_subject_00001_wf/func_preproc_ses_01_task_prl_run_02_wf/sdc_estimate_wf/phdiff_wf/split

Node inputs:

function_str = def _split(phasediff):
    return phasediff

phasediff = [('/data/sub-00001/ses-01/fmap/sub-00001_ses-01_phasediff.nii.gz', {'AcquisitionMatrixPE': 64, 'AcquisitionNumber': 1, 'AcquisitionTime': '11:05:23.795000', 'BaseResolution': 64, 'CoilString': 'C:HEA;HEP', 'ConversionSoftware': 'dcm2niix', 'ConversionSoftwareVersion': 'v1.0.20190410  GCC6.3.0', 'DeviceSerialNumber': '35422', 'DwellTime': 2.99e-05, 'EchoNumber': 2, 'EchoTime': 0.00738, 'EchoTime1': 0.00492, 'EchoTime2': 0.00738, 'FlipAngle': 40, 'ImageOrientationPatientDICOM': [0.999994, 0.000279046, 0.0034682, 2.03591e-10, 0.996779, -0.0801994], 'ImageType': ['ORIGINAL', 'PRIMARY', 'P', 'ND'], 'ImagingFrequency': 123.177, 'InPlanePhaseEncodingDirectionDICOM': 'ROW', 'InstitutionAddress': 'kwanakro_599_C4F276_Seoul_KR_ZIP', 'InstitutionName': 'SNUBIC', 'InstitutionalDepartmentName': 'Department', 'IntendedFor': ['ses-01/func/sub-00001_ses-01_task-prl_run-01_bold.nii.gz', 'ses-01/func/sub-00001_ses-01_task-prl_run-02_bold.nii.gz', 'ses-01/func/sub-00001_ses-01_task-sst_run-01_bold.nii.gz', 'ses-01/func/sub-00001_ses-01_task-sst_run-02_bold.nii.gz', 'ses-01/func/sub-00001_ses-01_task-sst_run-03_bold.nii.gz'], 'MRAcquisitionType': '2D', 'MagneticFieldStrength': 3, 'Manufacturer': 'Siemens', 'ManufacturersModelName': 'TrioTim', 'Modality': 'MR', 'PartialFourier': 1, 'PatientPosition': 'HFS', 'PercentPhaseFOV': 100, 'PhaseEncodingDirection': 'i', 'PhaseEncodingSteps': 64, 'PhaseResolution': 1, 'PixelBandwidth': 261, 'ProcedureStepDescription': 'SNU_SAVED', 'ProtocolName': 'field_map', 'PulseSequenceDetails': '%SiemensSeq%_gre_field_mapping', 'ReceiveCoilName': '32Ch_Head', 'ReconMatrixPE': 64, 'RepetitionTime': 0.3, 'SAR': 0.146315, 'ScanningSequence': 'GR', 'SequenceName': '_fm2d2r', 'SequenceVariant': 'SP', 'SeriesDescription': 'field_map', 'SeriesNumber': 3, 'ShimSetting': [-4139, -29739, -2012, 713, -33, 146, -354, -87], 'SliceThickness': 5, 'SoftwareVersions': 'syngo_MR_B17', 'SpacingBetweenSlices': 5, 'StationName': 'MRC35422', 'TxRefAmp': 430.638, 'dcmmeta_affine': [[-3.7499773502349854, 7.634674004108888e-10, 0.017396926879882812, 121.58599853515625], [-0.0010464233346283436, 3.7379207611083984, -0.40099430084228516, -97.57661437988281], [0.013005749322474003, 0.3007477819919586, 4.983863830566406, -58.784324645996094], [0.0, 0.0, 0.0, 1.0]], 'dcmmeta_reorient_transform': [[0.0, -1.0, 0.0, 63.0], [1.0, 0.0, 0.0, 0.0], [0.0, 0.0, -1.0, 25.0], [0.0, 0.0, 0.0, 1.0]], 'dcmmeta_shape': [64, 64, 26], 'dcmmeta_slice_dim': 2, 'dcmmeta_version': 0.6, 'global': {'const': {'AcquisitionMatrix': [0, 64, 64, 0], 'AcquisitionNumber': 1, 'AngioFlag': 'N', 'BitsAllocated': 16, 'BitsStored': 12, 'Columns': 64, 'EchoNumbers': 2, 'EchoTime': 7.38, 'EchoTrainLength': 1, 'FlipAngle': 40.0, 'HighBit': 11, 'ImageOrientationPatient': [0.99999394684365, 0.00027904621272, 0.0034681997174, 2.035913e-10, 0.99677883955191, -0.0801994078628], 'ImageType': ['ORIGINAL', 'PRIMARY', 'P', 'ND'], 'ImagedNucleus': '1H', 'ImagingFrequency': 123.177337, 'InPlanePhaseEncodingDirection': 'ROW', 'MRAcquisitionType': '2D', 'MagneticFieldStrength': 3.0, 'Manufacturer': 'SIEMENS', 'ManufacturerModelName': 'TrioTim', 'Modality': 'MR', 'NumberOfAverages': 1.0, 'NumberOfPhaseEncodingSteps': 64, 'PercentPhaseFieldOfView': 100.0, 'PercentSampling': 100.0, 'PerformedProcedureStepStartTime': '105321.531000', 'PhotometricInterpretation': 'MONOCHROME2', 'PixelBandwidth': 261.0, 'PixelRepresentation': 0, 'PixelSpacing': [3.75, 3.75], 'ProtocolName': 'field_map', 'ReferencedPerformedProcedureStepSequence': [{'ReferencedSOPClassUID': '1.2.840.10008.3.1.2.3.3', 'ReferencedSOPInstanceUID': '1.3.12.2.1107.5.2.32.35422.30000020012900370873400000001'}], 'RepetitionTime': 300.0, 'RescaleIntercept': -4096.0, 'RescaleSlope': 2.0, 'RescaleType': 'US', 'Rows': 64, 'SAR': 0.14631525241136, 'SamplesPerPixel': 1, 'ScanningSequence': 'GR', 'SequenceName': '*fm2d2r', 'SequenceVariant': 'SP', 'SeriesDescription': 'field_map', 'SeriesNumber': 3, 'SeriesTime': '110603.312000', 'SliceThickness': 5.0, 'SoftwareVersions': 'syngo MR B17', 'SpacingBetweenSlices': 5.0, 'SpecificCharacterSet': 'ISO_IR 100', 'StudyID': '1', 'StudyTime': '105321.468000', 'TransmitCoilName': 'Body', 'VariableFlipAngleFlag': 'N', 'WindowCenterWidthExplanation': 'Algo1', 'dBdt': 0.0}, 'slices': {'AcquisitionTime': ['110523.795000', '110523.642500', '110523.805000', '110523.655000', '110523.817500', '110523.667500', '110523.827500', '110523.677500', '110523.840000', '110523.690000', '110523.852500', '110523.702500', '110523.862500', '110523.712500', '110523.875000', '110523.725000', '110523.887500', '110523.735000', '110523.897500', '110523.747500', '110523.910000', '110523.760000', '110523.922500', '110523.770000', '110523.932500', '110523.782500'], 'ContentTime': ['110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.343000', '110603.312000', '110603.343000', '110603.312000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000'], 'CsaImage.ICE_Dims': ['X_2_1_1_1_1_1_14_1_1_1_1_59', 'X_2_1_1_1_1_1_1_1_1_2_1_59', 'X_2_1_1_1_1_1_15_1_1_3_1_59', 'X_2_1_1_1_1_1_2_1_1_4_1_59', 'X_2_1_1_1_1_1_16_1_1_5_1_59', 'X_2_1_1_1_1_1_3_1_1_6_1_59', 'X_2_1_1_1_1_1_17_1_1_7_1_59', 'X_2_1_1_1_1_1_4_1_1_8_1_59', 'X_2_1_1_1_1_1_18_1_1_9_1_59', 'X_2_1_1_1_1_1_5_1_1_10_1_59', 'X_2_1_1_1_1_1_19_1_1_11_1_59', 'X_2_1_1_1_1_1_6_1_1_12_1_59', 'X_2_1_1_1_1_1_20_1_1_13_1_59', 'X_2_1_1_1_1_1_7_1_1_14_1_59', 'X_2_1_1_1_1_1_21_1_1_15_1_59', 'X_2_1_1_1_1_1_8_1_1_16_1_59', 'X_2_1_1_1_1_1_22_1_1_17_1_59', 'X_2_1_1_1_1_1_9_1_1_18_1_59', 'X_2_1_1_1_1_1_23_1_1_19_1_59', 'X_2_1_1_1_1_1_10_1_1_20_1_59', 'X_2_1_1_1_1_1_24_1_1_21_1_59', 'X_2_1_1_1_1_1_11_1_1_22_1_59', 'X_2_1_1_1_1_1_25_1_1_23_1_59', 'X_2_1_1_1_1_1_12_1_1_24_1_59', 'X_2_1_1_1_1_1_26_1_1_25_1_59', 'X_2_1_1_1_1_1_13_1_1_26_1_59'], 'CsaImage.ProtocolSliceNumber': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25], 'CsaImage.SliceMeasurementDuration': [37950.0, 37952.5, 37952.5, 37952.5, 37952.5, 37950.0, 37952.5, 37952.5, 37952.5, 37952.5, 37950.0, 37950.0, 37952.5, 37952.5, 37952.5, 37952.5, 37950.0, 37952.5, 37952.5, 37952.5, 37952.5, 37950.0, 37950.0, 37952.5, 37952.5, 37952.5], 'CsaImage.SlicePosition_PCS': [[-121.58599817, -137.912392, -39.83721886], [-121.60339509, -137.51139675, -34.85335503], [-121.62079214, -137.11040149, -29.8694912], [-121.63818918, -136.70940814, -24.88562737], [-121.65558623, -136.30841289, -19.90176354], [-121.67298328, -135.90741764, -14.91789971], [-121.69038032, -135.50642333, -9.93403588], [-121.70777737, -135.10542903, -4.95017109], [-121.72517441, -134.70443378, 0.03369274], [-121.74257146, -134.30343948, 5.01755705], [-121.75996851, -133.90244518, 10.00142117], [-121.77736555, -133.50144992, 14.98528518], [-121.7947626, -133.10045562, 19.96914901], [-121.81215965, -132.69946132, 24.95301285], [-121.82955669, -132.29846607, 29.93687668], [-121.84695374, -131.89747177, 34.92074051], [-121.86435066, -131.49647747, 39.90460624], [-121.88174771, -131.09548221, 44.88847008], [-121.89914476, -130.69448791, 49.87233391], [-121.9165418, -130.29349361, 54.85619774], [-121.93393885, -129.89249835, 59.84006157], [-121.95133589, -129.49150405, 64.8239254], [-121.96873294, -129.09050975, 69.80778923], [-121.98612999, -128.6895145, 74.79165306], [-122.00352703, -128.2885202, 79.77551689], [-122.02092396, -127.8875259, 84.75938072]], 'CsaImage.TimeAfterStart': [0.4525, 0.3025, 0.465, 0.315, 0.4775, 0.325, 0.4875, 0.3375, 0.5, 0.35, 0.5125, 0.36, 0.5225, 0.3725, 0.535, 0.385, 0.545, 0.395, 0.5575, 0.4075, 0.57, 0.42, 0.58, 0.43, 0.5925, 0.4425], 'DataSetTrailingPadding': ['\x00\x..x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'], 'ImagePositionPatient': [[-121.5859981654, -137.91239200098, -39.837218859219], [-121.60339509228, -137.51139674647, -34.853355028653], [-121.62079213837, -137.11040149195, -29.869491198087], [-121.63818918446, -136.70940814478, -24.88562736752], [-121.65558623055, -136.30841289027, -19.901763536954], [-121.67298327664, -135.90741763575, -14.917899706387], [-121.69038032272, -135.50642333491, -9.934035875821], [-121.70777736881, -135.10542903407, -4.9501710915803], [-121.7251744149, -134.70443377955, 0.03369273898608], [-121.74257146099, -134.30343947871, 5.0175570463896], [-121.75996850708, -133.90244517786, 10.001421174979], [-121.77736555317, -133.50144992335, 14.98528518436], [-121.79476259926, -133.10045562251, 19.969149014926], [-121.81215964535, -132.69946132166, 24.953012845492], [-121.82955669144, -132.29846606715, 29.936876676059], [-121.84695373753, -131.8974717663, 34.920740506625], [-121.86435066441, -131.49647746546, 39.90460624454], [-121.8817477105, -131.09548221094, 44.888470075107], [-121.89914475659, -130.6944879101, 49.872333905673], [-121.91654180267, -130.29349360926, 54.856197736239], [-121.93393884876, -129.89249835474, 59.840061566806], [-121.95133589485, -129.4915040539, 64.823925397372], [-121.96873294094, -129.09050975306, 69.807789227939], [-121.98612998703, -128.68951449854, 74.791653058505], [-122.00352703312, -128.2885201977, 79.775516889072], [-122.02092396, -127.88752589686, 84.759380719638]], 'InstanceCreationTime': ['110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.328000', '110603.312000', '110603.343000', '110603.312000', '110603.343000', '110603.312000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000', '110603.343000', '110603.328000'], 'InstanceNumber': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], 'LargestImagePixelValue': [4091, 4088, 4088, 4090, 4092, 4091, 4078, 4079, 4031, 4087, 4069, 4084, 4085, 4083, 4074, 4091, 4014, 4068, 4082, 4064, 4090, 4087, 4094, 4087, 4092, 4094], 'SliceLocation': [-50.346034420456, -45.346034567572, -40.346034714274, -35.346035013942, -30.346035160644, -25.346035307345, -20.346035530531, -15.346034803119, -10.346034949821, -5.3460346977075, -0.3460346238312, 4.6539654077042, 9.6539651845191, 14.653964961334, 19.653964814632, 24.653964591447, 29.653966269041, 34.653966122339, 39.653965899154, 44.653965675969, 49.653965529267, 54.653965306082, 59.653965082897, 64.653964936196, 69.65396471301, 74.65396448941], 'SmallestImagePixelValue': [13, 6, 1, 1, 1, 0, 0, 34, 1, 17, 78, 61, 16, 22, 23, 31, 1, 1, 6, 2, 6, 0, 22, 4, 0, 2], 'WindowCenter': [-456.0, -492.0, -332.0, -334.0, -246.0, -284.0, -232.0, -132.0, -90.0, -62.0, 18.0, 4.0, -166.0, -24.0, -20.0, -132.0, -142.0, -168.0, -52.0, -222.0, -78.0, -258.0, -138.0, -198.0, -222.0, -220.0], 'WindowWidth': [5972.0, 5926.0, 6048.0, 6090.0, 5922.0, 5712.0, 5496.0, 5514.0, 5366.0, 5260.0, 5440.0, 5294.0, 4500.0, 4926.0, 4834.0, 4476.0, 4490.0, 4516.0, 5216.0, 4578.0, 5220.0, 4618.0, 5156.0, 5410.0, 5508.0, 5678.0]}}})]

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
    self.procs[jobid].run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 486, in run
    self._get_hashval()
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 1189, in _get_hashval
    hash_method=self.config["execution"]["hash_method"]
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 259, in get_hashval
    val, hash_method=hash_method, hash_files=hash_files
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 300, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 300, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 287, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 287, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 287, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 300, in _get_sorteddict
    hash_files=hash_files,
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/specs.py", line 311, in _get_sorteddict
    and os.path.isfile(objekt)
  File "/usr/local/miniconda/lib/python3.7/genericpath.py", line 30, in isfile
    st = os.stat(path)
ValueError: embedded null byte


When creating this crashfile, the results file corresponding
to the node could not be found.

Thanks for your help in advance!

hi @Jihyuncindyhur

this looks like there was a problem with the DICOM metadata extraction, my guess is the null byte is in one of the fields in your phasediff.json (maybe DataSetTrailingPadding). I’m opening an issue in heudiconv to make a note of this, but meanwhile you can use the --minmeta flag to avoid extracting all the DICOM metadata in future conversions.

1 Like

It worked!! fMRIPREP is now running fine. Thanks so much!