Skip to content

Commit

Permalink
fixed isdicom
Browse files Browse the repository at this point in the history
added `try` and `catch` statements which should get around the fact that not all directories are pure DICOM files
  • Loading branch information
Dale-Black committed Nov 26, 2021
1 parent d1e5567 commit 1987163
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/DICOM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ function find_dicom_files(dir)
end

function isdicom(file)
bytes = read(file, 132)[end-3:end]
String(bytes) == "DICM"
try
bytes = read(file, 132)[end-3:end]
String(bytes) == "DICM"
catch
not_dicom == true
end
end

function dcmdir_parse(dir; kwargs...)
Expand Down

0 comments on commit 1987163

Please sign in to comment.