You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patient ID and other information is under the label of associated images under the Image tab in QuPath. We can use Optical Character Recognition (OCR) library such as Keras-OCR to extract the info we needed.
The complete workflow of auto-extract the Patient ID and other info from the label of associated images under the Image tab within a svs file:
1. Extract the Slide Label Image:
importopenslide# Open the .svs fileslide=openslide.OpenSlide('an.svs')
# Extract the slide label imagelabel_image=slide.associated_images['label']
# Save the label image for the next step Optical Character Recognition (OCR) processinglabel_image.save('patient_id.png')
2. Perform OCR on the Extracted Image
#!/usr/bin/env python3importkeras_ocr# Create the pipelinepipeline=keras_ocr.pipeline.Pipeline()
# Read the imageimages= [keras_ocr.tools.read('patient_id.png')]
# Perform OCR and Recognize text in imagesprediction_groups=pipeline.recognize(images)
# Print the recognized textforpredictionsinprediction_groups:
fortext, boxinpredictions:
print(text)
Metadata
The text was updated successfully, but these errors were encountered: