Skip to content

Commit

Permalink
Merge pull request JuliaHealth#4 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 e302bdf + d2f3683 commit aee5b1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
11 changes: 0 additions & 11 deletions src/DICOM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 8 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit aee5b1f

Please sign in to comment.