Help with BIDS errors 66 and 75 in legacy dataset

Hello,

Please could I get some advice with solving two errors?

[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)^[[39m
                ./sub-109S4594/ses-20160502/func/sub-109S4594_ses-20160502_task-rest_bold.nii.gz
                        "SliceTiming" value/s contains invalid value as it is greater than RepetitionTime.  SliceTiming values should be in seconds not milliseconds (common mistake).

The associated .json file looks like the below, and it appears slice timing is in seconds:

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 127.722,
    "Manufacturer": "GE",
    "ManufacturersModelName": "Signa_HDxt",
    "InstitutionName": "HOWARD_UNIVERSITY",
    "DeviceSerialNumber": "613ILhuMDTcyYkk9.SUZ.Qk",
    "PatientPosition": "HFS",
    "SoftwareVersions": "24_LX_MR_Software_release:HD16.0_V02_1131.a",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "AXIAL_RS_fMRI_(EYES_OPEN)",
    "ProtocolName": "AXIAL_RS_fMRI_(EYES_OPEN)",
    "ScanningSequence": "EP_GR",
    "SequenceVariant": "SS",
    "ScanOptions": "MP_GEMS_EPI_GEMS",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "OTHER"
    ],
    "SeriesNumber": 5,
    "AcquisitionTime": "10:23:59.000000",
    "AcquisitionNumber": 1,
    "SliceThickness": 3.3,
    "SpacingBetweenSlices": 3.3,
    "SAR": 0.184911,
    "EchoTime": 0.03,
    "RepetitionTime": 2.925,
    "FlipAngle": 90,
    "PhaseEncodingPolarityGE": "Flipped",
    "CoilString": "8HRBRAIN",
    "PercentPhaseFOV": 100,
    "AcquisitionMatrixPE": 64,
    "ReconMatrixPE": 64,
    "EffectiveEchoSpacing": 0.000728,
    "TotalReadoutTime": 0.045864,
    "PixelBandwidth": 7812.5,
    "PhaseEncodingDirection": "j",
    "SliceTiming": [
        4.329,
        1.404,
        5.733,
        2.808,
        4.212,
        1.287,
        5.616,
        2.691,
        4.095,
        1.17,
        5.499,
        2.574,
        3.978,
        1.053,
        5.382,
        2.457,
        3.861,
        0.936,
        5.265,
        2.34,
        3.744,
        0.819,
        5.148,
        2.223,
        3.627,
        0.702,
        5.031,
        2.106,
        3.51,
        0.585,
        4.914,
        1.989,
        3.393,
        0.468,
        4.797,
        1.872,
        3.276,
        0.351,
        4.68,
        1.755,
        3.159,
        0.234,
        4.563,
        1.638,
        3.042,
        0.117,
        4.446,
        1.521,
        2.925,
        0
    ],
    "ImageOrientationPatientDICOM": [
1,
        0,
        0,
        0,
        1,
        0
    ],
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20181125  (JP2:OpenJPEG) (JP-LS:CharLS) GCC5.5.0",
    "Dcm2bidsVersion": "2.1.4"
}
  1. [ERR] NIfTI file's header is missing time dimension information. (code: 75 - NIFTI_PIXDIM4). I did not convert these and don’t have the Dicoms so unsure if I can solve it?

The associated headers look like:

sizeof_hdr      : 348
data_type       : b''
db_name         : b''
extents         : 0
session_error   : 0
regular         : b'r'
dim_info        : 57
dim             : [  3  80  80 365   1   1   1   1]
intent_p1       : 0.0
intent_p2       : 0.0
intent_p3       : 0.0
intent_code     : none
datatype        : int16
bitpix          : 16
slice_start     : 0
pixdim          : [-1.    2.94  2.94  3.31  3.    0.    0.    0.  ]
vox_offset      : 0.0
scl_slope       : nan
scl_inter       : nan
slice_end       : 0
slice_code      : unknown
xyzt_units      : 10
cal_max         : 0.0
cal_min         : 0.0
slice_duration  : 0.0
toffset         : 0.0
glmax           : 0
glmin           : 0
descrip         : b'TE=30;Time=0.000'
aux_file        : b''
qform_code      : scanner
sform_code      : scanner
quatern_b       : 0.0
quatern_c       : 1.0
quatern_d       : 0.0
qoffset_x       : 116.30556
qoffset_y       : -99.12399
qoffset_z       : -70.06402
srow_x          : [ -2.94   0.    -0.   116.31]
srow_y          : [ -0.     2.94  -0.   -99.12]
srow_z          : [  0.     0.     3.31 -70.06]
intent_name     : b''
magic           : b'n+1'

and

sizeof_hdr      : 348
data_type       : b''
db_name         : b''
extents         : 0
session_error   : 0
regular         : b'r'
dim_info        : 57
dim             : [ 3 64 64 15  1  1  1  1]
intent_p1       : 0.0
intent_p2       : 0.0
intent_p3       : 0.0
intent_code     : none
datatype        : int16
bitpix          : 16
slice_start     : 0
pixdim          : [-1.    3.31  3.31  6.62  3.    0.    0.    0.  ]
vox_offset      : 0.0
scl_slope       : nan
scl_inter       : nan
slice_end       : 0
slice_code      : unknown
xyzt_units      : 10
cal_max         : 0.0
cal_min         : 0.0
slice_duration  : 0.0
toffset         : 0.0
glmax           : 0
glmin           : 0
descrip         : b'TE=30;Time=93532.450'
aux_file        : b''
qform_code      : scanner
sform_code      : scanner
quatern_b       : 0.0
quatern_c       : 1.0
quatern_d       : 0.0
qoffset_x       : 107.208916
qoffset_y       : -107.971535
qoffset_z       : -65.90747
srow_x          : [ -3.31   0.    -0.   107.21]
srow_y          : [  -0.      3.31   -0.   -107.97]
srow_z          : [  0.     0.     6.62 -65.91]
intent_name     : b''
magic           : b'n+1'

Thank you very much for any help!

Hi @nclarke,

Looks like the SliceTiming field is doubled, as the max slice timing in your JSON suggests your TR is 6 seconds. I do not know much about your data, but maybe it would be safe to simply half the SliceTiming field in your JSONs. You can use the JSON package in Python to manipulate JSON files.

Try changing your file to have dim and pixdim from a vector of all dimensions to something like this

dim0           4
dim1           70
dim2           70
dim3           40
dim4           150
dim5           0
dim6           0
dim7           0
pixdim0        0.000000
pixdim1        3.000000
pixdim2        3.000000
pixdim3        3.300000
pixdim4        2.500000
pixdim5        0.000000
pixdim6        0.000000
pixdim7        0.000000
descrip        TE=30;Time=151942.027;phase=1

Note the dim4 and pixdim4 relate to TR. Also note how your descrip field to have a Time in ms that is not 0. Perhaps you can use Nilearn to manipulate file headers and save out images with BIDS valid headers.

Best,
Steven

Hi Steven, thanks so much for your quick response again and help. I will try those.