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

Cannot construct a DICOM object from a file without a file meta information header #83

Closed
ziqiangxu opened this issue Nov 1, 2020 · 8 comments · Fixed by #84
Closed

Comments

@ziqiangxu
Copy link

And this is the error message:

ParseMetaDataSet { source: NotDicom { backtrace: Backtrace(()) } }

Some DICOM file is just OK, but I have several files that will occur the error above. If you need the files, I will upload it after anonymization dealings be done.

@ziqiangxu
Copy link
Author

when read those files by pydicom:

import pydicom
dcm = pydicom.dcmread('data/_RAW_DIC/1_2_800A.DCM', force=True)  #  parameter force need to be set True
if not dcm.file_meta.get('TransferSyntaxUID'):
    dcm.file_meta.TransferSyntaxUID = pydicom.uid.ImplicitVRLittleEndian  

@Enet4
Copy link
Owner

Enet4 commented Nov 1, 2020

Thank you for reporting!

Yes, an anonymized file would help pinpoint the issue. But looking at how pydicom is being used here, I suspect that the file does not have a file meta group. If that is the case, creating an object from it might not be impossible, but does require going through extra hoops, so I agree that the API can be improved in that regard. See also #50.

@ziqiangxu
Copy link
Author

The anonymized DICOM file
anonymized.zip

@ziqiangxu
Copy link
Author

image

@Enet4
Copy link
Owner

Enet4 commented Nov 2, 2020

Thank you for the details. The file indeed does not have a file meta information header. Some DICOM implementations are able to identify the data set's transfer syntax on a best-effort basis or provide a workaround so that the expected transfer syntax of the data set can be defined by the user. I agree that one should be able to do the latter in DICOM-rs.

I will update the title of this issue and reuse it for tracking the capability of reading DICOM data sets without a file meta information header, by specifying the transfer syntax as one of the input parameters. Please let me know if you are interested in tackling this, so that I may provide some guidance.

@Enet4 Enet4 changed the title Failed to construct a dicom object when function dicom_object:open_file("path to dicom file") is called Cannot construct a DICOM object from a file without a file meta information header Nov 2, 2020
@ziqiangxu
Copy link
Author

Thank you for the details. The file indeed does not have a file meta information header. Some DICOM implementations are able to identify the data set's transfer syntax on a best-effort basis or provide a workaround so that the expected transfer syntax of the data set can be defined by the user. I agree that one should be able to do the latter in DICOM-rs.

I will update the title of this issue and reuse it for tracking the capability of reading DICOM data sets without a file meta information header, by specifying the transfer syntax as one of the input parameters. Please let me know if you are interested in tackling this, so that I may provide some guidance.

I am glad to do this, but I am not familiar with Rust and DICOM, so I am not sure that if I can handle this.

@Enet4
Copy link
Owner

Enet4 commented Nov 2, 2020

No worries, I'll try to work on a quick draft for the feature this week.

@ziqiangxu
Copy link
Author

No worries, I'll try to work on a quick draft for the feature this week.

OK 😃

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

Successfully merging a pull request may close this issue.

2 participants