Skip to content

Commit

Permalink
Merge pull request #65 from jscheithe/dicom-filter-magicbytes
Browse files Browse the repository at this point in the history
collect DICOM files based on magic bytes
  • Loading branch information
notZaki authored Sep 7, 2020
2 parents 1ddcda6 + f182433 commit f4c0019
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DICOM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ function find_dicom_files(dir)
return dicom_files
end

isdicom(file) = last(splitext(file)) == ".dcm"
function isdicom(file)
bytes = read(file, 132)[end-3:end]
String(bytes) == "DICM"
end

function dcmdir_parse(dir; kwargs...)
dicom_files = find_dicom_files(dir)
Expand Down

0 comments on commit f4c0019

Please sign in to comment.