JuliaHealth / DICOM.jl

Julia package for reading and writing DICOM (Digital Imaging and Communications in Medicine) files
MIT License
56 stars 21 forks source link

collect DICOM files based on magic bytes #65

Closed jscheithe closed 4 years ago

jscheithe commented 4 years ago

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

codecov[bot] commented 4 years ago

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%) :arrow_up:
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 commented 4 years ago

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.

jscheithe commented 4 years ago

Thanks for merging! Keep up the good work :)