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

collect DICOM files based on magic bytes #65

Merged
merged 2 commits into from
Sep 7, 2020

Conversation

jscheithe
Copy link
Contributor

@jscheithe jscheithe commented Sep 7, 2020

According to the DICOM standard [1], every DICOM file should has the characters "DICM" as their magic bytes.
This should be more reliable than checking the file extensions.

[1] http://dicom.nema.org/medical/dicom/current/output/chtml/part10/chapter_7.html#table_7.1-1

jscheithe added 2 commits September 7, 2020 13:48
According to the DICOM standard [1], every DICOM file should have the characters "DICM" as their magic bytes.
This should be more reliable than checking the file extensions.

[1] http://dicom.nema.org/medical/dicom/current/output/chtml/part10/chapter_7.html#table_7.1-1
@codecov
Copy link

codecov bot commented Sep 7, 2020

Codecov Report

Merging #65 into master will increase coverage by 0.93%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
+ Coverage   88.82%   89.75%   +0.93%     
==========================================
  Files           2        2              
  Lines         340      371      +31     
==========================================
+ Hits          302      333      +31     
  Misses         38       38              
Impacted Files Coverage Δ
src/DICOM.jl 89.11% <100.00%> (+0.94%) ⬆️
src/DICOMData.jl 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ddcda6...f182433. Read the comment docs.

@notZaki
Copy link
Member

notZaki commented Sep 7, 2020

This is indeed a much better way of identifying DICOM files. Thanks!

I'll make a note here that in some applications, the DICOM file doesn't contain the magic bytes (#5) but this is uncommon and can be addressed later.

@notZaki notZaki merged commit f4c0019 into JuliaHealth:master Sep 7, 2020
@jscheithe
Copy link
Contributor Author

Thanks for merging! Keep up the good work :)

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 this pull request may close these issues.

2 participants