dicomweb-client icon indicating copy to clipboard operation
dicomweb-client copied to clipboard

Allow to set force option of dcmread

Open medihack opened this issue 2 years ago • 4 comments

Currently dcmread is used without the force option in dicomweb-client. It would be nice to make this configurable to read also maybe not so valid DICOM files.

medihack avatar Aug 17 '23 09:08 medihack

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

pieper avatar Aug 17 '23 17:08 pieper

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.

medihack avatar Aug 17 '23 17:08 medihack

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.

pieper avatar Aug 17 '23 19:08 pieper

You are right. It then sounds like a good solution. Maybe a little warning on the console could still be printed.

medihack avatar Aug 17 '23 20:08 medihack