From 1987163310c704d3aca44374fd61661780bf1323 Mon Sep 17 00:00:00 2001 From: Dale-Black Date: Fri, 26 Nov 2021 15:21:46 -0800 Subject: [PATCH] fixed `isdicom` added `try` and `catch` statements which should get around the fact that not all directories are pure DICOM files --- src/DICOM.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/DICOM.jl b/src/DICOM.jl index cfcc45a..ad592c9 100644 --- a/src/DICOM.jl +++ b/src/DICOM.jl @@ -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...)