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

GE data: 'DICOM File Meta Information header or the 'DICM' prefix missing from header #433

Open
RebeccaThornley opened this issue Jun 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@RebeccaThornley
Copy link
Collaborator

Reporting this on behalf of David Price. When trying to run acr_snr on data from a GE scanner, he recieved the following error:
pydicom.errors.InvalidDicomError: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the header. Use force=True to force reading.

Full code from terminal
(hazen-venv) davidprice@medphys037-mac ~ % hazen acr_snr ACR_Hd_tra_SNR1 --measured_slice_width=5.2 --subtract ACR_Hd_tra_SNR2 --report
2024-06-13 08:04:32 I [ACRObject.py:sort_dcms:47] image orientation is axial
2024-06-13 08:04:32 I [ACRObject.py:order_phantom_slices:78] Slice order inversion is not required.
Traceback (most recent call last):
File "/Users/davidprice/hazen-venv/bin/hazen", line 8, in
sys.exit(main())
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/hazenlib/init.py", line 155, in main
result = task.run()
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/hazenlib/tasks/acr_snr.py", line 88, in run
data2 = [pydicom.dcmread(dicom) for dicom in filepaths]
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/hazenlib/tasks/acr_snr.py", line 88, in
data2 = [pydicom.dcmread(dicom) for dicom in filepaths]
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/pydicom/filereader.py", line 1029, in dcmread
dataset = read_partial(
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/pydicom/filereader.py", line 780, in read_partial
preamble = read_preamble(fileobj, force)
File "/Users/davidprice/hazen-venv/lib/python3.9/site-packages/pydicom/filereader.py", line 724, in read_preamble
raise InvalidDicomError(
pydicom.errors.InvalidDicomError: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the header. Use force=True to force reading.
(hazen-venv) davidprice@medphys037-mac ~ % force=True
(hazen-venv) davidprice@medphys037-mac ~ % hazen acr_snr ACR_Hd_tra_SNR1 --measured_slice_width=5.2 --subtract ACR_Hd_tra_SNR2 --report

I will try and dig out images and send to Molly via email

@RebeccaThornley RebeccaThornley added the bug Something isn't working label Jun 14, 2024
@mollybuckley mollybuckley self-assigned this Jun 21, 2024
@mollybuckley
Copy link
Collaborator

Hi Becky, thanks for flagging this - I think it works now! Adding the force=True statement as an argument in the dcmread function in acr_snr (line 88) forces the function to read the DICOM files even if the prefix is not as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants