presidio
presidio copied to clipboard
Returned verification image is empty if no text is detected
Describe the bug
When calling .verify_dicom_instance
using the DicomImagePiiVerifyEngine
, the returned verification image is empty when no PII text is detected.
To Reproduce Steps to reproduce the behavior:
- Open a Python notebook
- Load a DICOM file that does not have text PII burnt-in (
instance = pydicom.dcmread(YOUR_DCM_FILE_PATH_HERE)
) - Run the following code:
engine = DicomImagePiiVerifyEngine()
verify_image, ocr_results, analyzer_results = engine.verify_dicom_instance(instance, display_image=True)
- You should now see an empty image displayed
Expected behavior The correct behavior we expect would be for the image to still display, but just without any bounding boxes since there is no text that can be picked up as PII.
Screenshots Example of the bug: