From 5dac42e8f248638aebb1abc6c6043479e0964d44 Mon Sep 17 00:00:00 2001 From: Dale-Black Date: Fri, 26 Nov 2021 17:42:01 -0800 Subject: [PATCH 1/2] finalize --- src/DICOM.jl | 10 ---------- test/runtests.jl | 16 ++++++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/DICOM.jl b/src/DICOM.jl index 439432c..0e24bdc 100644 --- a/src/DICOM.jl +++ b/src/DICOM.jl @@ -132,20 +132,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] From d2f3683fa86e0f5268d6e0ab437259f06f2f8b3b Mon Sep 17 00:00:00 2001 From: Dale-Black Date: Fri, 26 Nov 2021 17:43:06 -0800 Subject: [PATCH 2/2] finalize --- src/DICOM.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/DICOM.jl b/src/DICOM.jl index 0e24bdc..de14b51 100644 --- a/src/DICOM.jl +++ b/src/DICOM.jl @@ -131,7 +131,6 @@ always_implicit(grp, elt) = function find_dicom_files(dir) files = joinpath.(dir, readdir(dir)) - dicom_files = [] dicom_files = filter(file -> isdicom(file), files) return dicom_files end