Open medihack opened 1 year ago
I don't see any downside to being more tolerant when reading. It might make sense to try reading first, and if an exception is raised issue a warning and try again with the force
option.
Anyone else have suggestions? @hackermd
I am unsure if this would be a good solution as it would try to read each dataset twice when it is not valid, which could be quite a performance hit when reading many invalid datasets. But maybe it would be a good default (with some warning when the reading initially fails) but still have some option to do a forced reading initially.
From the documentation for force
, it says it only checks for a metaheader, which I would think is very quick. But we could check if it's an issue.
You are right. It then sounds like a good solution. Maybe a little warning on the console could still be printed.
Currently
dcmread
is used without theforce
option in dicomweb-client. It would be nice to make this configurable to read also maybe not so valid DICOM files.