Dcm2niix error “FileSize < ImageSize” for one Philips MP2RAGEME INV2 PAR/REC series

Summary of what happened:

I am converting Philips PAR/REC data to BIDS using BIDScoin v4.3.0 with dcm2niix v1.0.20240202 inside a container. For almost all participants, both MP2RAGEME INV1 and INV2 convert correctly.

For one participant, the INV2 series fails with:

FileSize < (ImageSize + HeaderSize)
Warning: File not large enough to store image data

This causes dcm2niix to exit with error code 1. To rule out BIDScoin as the cause, I also ran dcm2niix directly on the PAR/REC files outside of BIDScoin, using the same command BIDScoin would generate. The standalone dcm2niix call produced the exact same error.

INV1 for the same participant converts without issues, and INV2 for all other participants converts normally.

Command used (and if a helper script was used, a link to the helper script or the command generated):

dcm2niix -v 2 -b y -z y -i n -l n -o test_output_manual_conversion sub-XXXXXX_MP2RAGEME07_INV2_6_1.PAR

Version & Environment (Docker, Singularity / Apptainer, custom installation):

  • dcm2niix: v1.0.20240202
  • BIDScoin: v4.3.0
  • Philips PAR/REC: PAR version 4.2
  • OS: Linux (inside container)

Relevant log outputs (up to 20 lines):

Chris Rorden's dcm2niiX version v1.0.20240202 (JP2:OpenJPEG) (JP-LS:CharLS)
Warning: dcm2niix PAR is not actively supported (hint: use dicm2nii)
Warning: PAR/REC intensity scaling varies between slices (please validate output).
Warning: Intensity slope/intercept varies between slices!
slices*grad*bval*cardiac*echo*dynamic*mix*labels = 300*1*1*1*4*1*1*1
Done reading PAR header version 4.2, with 2400 slices
Warning: Multiple Echo (4) or Cardiac (1). Carefully inspect output
Warning: Philips enhanced DICOMs (hint: export as classic DICOM)
FileSize < (ImageSize+HeaderSize): 304873472 < (491520000+0)
Warning: File not large enough to store image data: sub-XXXXXX_MP2RAGEME07_INV2_6_1.REC

Screenshots / relevant information:

File sizes

Problematic subject

  • INV1 REC: 235 MB
  • INV2 REC: 582 MB

Other participants (working)

  • INV1: 235 MB / INV2: 938 MB
  • INV1: 200 MB / INV2: 800 MB

INV2 for this problematic participant is somewhat smaller, but not a lot?

I compared the PAR headers, no obvious structural differences.

Summary

  • dcm2niix concludes the INV2 file is “too small”
  • INV1 for the same participant converts fine
  • other participants’ INV2 files convert fine

Hi @e.vanheese and welcome to neurostars!

Have you tried updating dcm2niix?

Best,
Steven

Thanks, Steven!

I did, I also tried version v1.0.20241211 and v1.0.20250505 but I got the same error. I also found someone else with the same problem, with version v1.0.20190902, which made me think it might not be related to the version.

Do you have any other ideas?

I would guess that this is a corrupted file - can be it re-exported from your scanner?

I was afraid so… Unfortunately not, but I will do some digging to see if another version exists elsewhere. Thanks for thinking along!