diff --git a/src/DICOM.jl b/src/DICOM.jl index 439432c..de14b51 100644 --- a/src/DICOM.jl +++ b/src/DICOM.jl @@ -131,21 +131,10 @@ always_implicit(grp, elt) = function find_dicom_files(dir) files = joinpath.(dir, readdir(dir)) - dicom_files = [] - # for file in 1:length(files) - # if isdicom(file) - # push!(dicom_files, file) - # end - # end dicom_files = filter(file -> isdicom(file), files) return dicom_files end -# function isdicom(file) -# bytes = read(file, 132)[end-3:end] -# String(bytes) == "DICM" -# end - function isdicom(file) try bytes = read(file, 132)[end-3:end] diff --git a/test/runtests.jl b/test/runtests.jl index 898d26e..bc7d6f1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -232,14 +232,14 @@ end @test length(dcms) == length(readdir(data_folder)) - 3 # -3 because of note above end -# @testset "isdicom" begin -# answer = DICOM.isdicom("test/testdata/brain.bmp") -# @test answer === nothing - -# fileDX = download_dicom("DX_Implicit_Little_Interleaved.dcm") -# answer2 = DICOM.isdicom(fileDX) -# @test answer2 == true -# end +@testset "isdicom" begin + answer = DICOM.isdicom("test/testdata/brain.bmp") + @test answer === false + + fileDX = download_dicom("DX_Implicit_Little_Interleaved.dcm") + answer2 = DICOM.isdicom(fileDX) + @test answer2 == true +end @testset "Test tag macro" begin @test tag"Modality" === (0x0008, 0x0060) === DICOM.fieldname_dict[:Modality]