Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Philips EPI conversion: TR is incorrect when there is a discrepancy between TR and other temporal measures #911

Open
ohinds opened this issue Jan 23, 2025 · 1 comment

Comments

@ohinds
Copy link

ohinds commented Jan 23, 2025

Describe the bug

Converting a dicom directory containing a single EPI series collected on a Philips scanner results in an incorrect value for the repetition time in the resulting nifti header.

Related to #560 and its fix.

To reproduce

  1. git clone [email protected]:datalad/example-dicom-functional.git
  2. dcm2niix example-dicom-functional/dicoms
  3. nifti_tool -disp_hdr -infiles example-dicom-functional/dicoms/dicoms_func_task-oneback_run-1_20140425155335_401.nii

Expected behavior

The repetition in the output nifti header should be 2.000001.

I've confirmed that this is the correct value for TR via

  1. Inspection of the dicom header (I know this is unreliable)
  2. Reading the methods section of the paper resulting from this data: https://www.nature.com/articles/sdata201693
  3. Performing a basic fMRI analysis on both the dcmniix output volume (with TR=1.793548) AND a volume where I manually changed the TR to 2.000001 using nifti_tool. The results of the analysis were nonsensical with TR=1.793548 and showed strong activation in visual areas with TR=2.000001.

Output log

Output of step 2:

Chris Rorden's dcm2niiX version v1.0.20220720  (JP2:OpenJPEG) GCC13.2.0 x86-64 (64-bit Linux)
Found 5460 DICOM file(s)
Warning: Discrepancy between reported (2s) and estimated (1.79355s) repetition time (issue 560).
Warning: Images sorted by instance number [0020,0013](1..5460), but AcquisitionTime [0008,0032] suggests a different order (160423..160223) 
Philips Scaling Values RS:RI:SS = 4.00757:0:0.0132383 (see PMC3998685)
Convert 5460 DICOM as example-dicom-functional/dicoms/dicoms_func_task-oneback_run-1_20140425155335_401 (80x80x35x156)
Conversion required 1.265110 seconds (1.265096 for core code).

Output of step 3:

N-1 header file 'example-dicom-functional/dicoms/dicoms_func_task-oneback_run-1_20140425155335_401.nii', num_fields = 43

all fields:
  name                offset  nvals  values
  ------------------- ------  -----  ------
  sizeof_hdr             0      1    348
  data_type              4     10    
  db_name               14     18    
  extents               32      1    0
  session_error         36      1    0
  regular               38      1    r
  dim_info              39      1    57
  dim                   40      8    4 80 80 35 156 1 1 1
  intent_p1             56      1    0.0
  intent_p2             60      1    0.0
  intent_p3             64      1    0.0
  intent_code           68      1    0
  datatype              70      1    4
  bitpix                72      1    16
  slice_start           74      1    0
  pixdim                76      8    -1.0 3.0 3.0 3.3 1.793548 0.0 0.0 0.0
  vox_offset           108      1    352.0
  scl_slope            112      1    75.538353
  scl_inter            116      1    0.0
  slice_end            120      1    0
  slice_code           122      1    0
  xyzt_units           123      1    10
  cal_max              124      1    0.0
  cal_min              128      1    0.0
  slice_duration       132      1    0.0
  toffset              136      1    0.0
  glmax                140      1    0
  glmin                144      1    0
  descrip              148     80    TE=30;Time=160422.680
  aux_file             228     24    
  qform_code           252      1    1
  sform_code           254      1    1
  quatern_b            256      1    -0.006598
  quatern_c            260      1    -0.993392
  quatern_d            264      1    -0.114346
  qoffset_x            268      1    116.119316
  qoffset_y            272      1    -87.935989
  qoffset_z            276      1    -54.290836
  srow_x               280      4    -2.999414 0.044372 0.043218 116.119316
  srow_y               296      4    0.034284 2.921288 -0.750018 -87.935989
  srow_z               312      4    0.048343 0.681253 3.213348 -54.290836
  intent_name          328     16    
  magic                344      4    n+1

Version

dcm2niiX version v1.0.20220720 (JP2:OpenJPEG) GCC13.2.0 x86-64 (64-bit Linux)

Troubleshooting

Does the latest commit on the development branch resolve your issue?

I compiled from a fresh git clone and it does not resolve the issue.

@neurolabusc
Copy link
Collaborator

This is a limitation of your DICOM images, not dcm2niix. dcm2niix assumes that DICOM headers are truthful, and is unable to resolve when different values are reported by RepetitionTime (0018,0080) versus both TriggerTime (0018,1060) and AcquisitionTime (0008,0032). When there is a discrepancy, dcm2niix generates a warning (referencing issue 560) and assumes the RepetitionTime is inaccurate, as it reflects the requested rather than acquired TR (e.g. it is known to be inaccurate for Philips data with prospect. motion corr.). I would check the provenance of the DICOM images (to see if an anonymization stage scrambled values) and work with the Philips clinical scientist associated with the center where the data were acquired to resolve this. For more details, see issue 560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants