Skip to content

Commit

Permalink
Merge pull request JuliaHealth#2 from Dale-Black/dale-fix
Browse files Browse the repository at this point in the history
Dale fix
  • Loading branch information
Dale-Black authored Nov 27, 2021
2 parents f8cb142 + 7aa402f commit ccb3d68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DICOM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function isdicom(file)
bytes = read(file, 132)[end-3:end]
String(bytes) == "DICM"
catch
not_dicom == true
println("not a dicom file")
end
end

Expand Down
12 changes: 11 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,19 @@ end
@testset "Parse entire folder" begin
# Following files have missing preamble and won't be parsed
# ["OT_Implicit_Little_Headless.dcm", "CT_Implicit_Little_Headless_Retired.dcm"]
# and brain.bpm is not a DICOM file
dcms = dcmdir_parse(data_folder)
@test issorted([dcm[tag"Instance Number"] for dcm in dcms])
@test length(dcms) == length(readdir(data_folder)) - 2 # -2 because of note above
@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 "Test tag macro" begin
Expand Down

0 comments on commit ccb3d68

Please sign in to comment.