-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old DICOM file loads using dcm_parse(file; preamble=false)
, but the same file returns false
when runningisdicom
function
#84
Comments
That is kinda the expected, albeit annoying, behaviour of On the package side, we could update |
What about modifying function find_dicom_files(dir; kwargs...)
files = joinpath.(dir, readdir(dir))
dicom_files = []
for file in files
try
dcm = dcm_parse(file; kwargs...)
push!(dicom_files, file)
catch
nothing
end
end
return dicom_files
end |
Since that function is already calling function find_dicom_files(dir; kwargs...)
files = joinpath.(dir, readdir(dir))
- dicom_files = []
+ dcms = []
for file in files
try
dcm = dcm_parse(file; kwargs...)
- push!(dicom_files, file)
+ push!(dcms, dcm)
catch
nothing
end
end
- return dicom_files
+ return dcms
end or if everything in the folder is a dicom file, then the following could work too: dir = "PATH/TO/DIR"
dcms = [DICOM.dcm_parse(file; preamble=false) for file in readdir(dir; join=true)] The try/catch is a good practical solution, however, I think it would be better for the package if |
I am trying to load a directory of DICOM files using
dcmdir_parse
. Each file in the directory loads when runningdcm_parse(file; preamble=false)
but loading the directory returns an empty array. While trying to determine the cause, I found thatisdicom(file)
returns false, butdcm_parse(file; preamble=false)
works. Any idea if this is an issue or if I am missing something on my end?The text was updated successfully, but these errors were encountered: