def setCovid19ImageToWindow_ViaDragAndDrop(filename):
    app._PRIOR_IMAGE.destroy() #destroy old image
    load = Image.open(filename)
    load = load.resize((CONSTANT_DIAGNOSIS_IMAGE_SPAN, CONSTANT_DIAGNOSIS_IMAGE_SPAN),Image.ANTIALIAS) #Resized "load" image to constant size on screen. However, neural network still runs on on original image scale from filename.
    render = ImageTk.PhotoImage(load)
    img = Label(image=render)
    img.image = render
    img.place(x=(int(screenWidth)/2)-CONSTANT_DIAGNOSIS_IMAGE_SPAN/2, y=((int(screenHeight)/2))-CONSTANT_DIAGNOSIS_IMAGE_SPAN/2-80)
    app.DIAGNOSIS_RESULT += "**Covid19 Mode (Drag & Drop) Result** \n" + filename+"\n\n"
    app.DIAGNOSIS_RESULT += covid19_ai_diagnoser.doOnlineInference_covid19Pneumonia (filename)
    print(app.DIAGNOSIS_RESULT)
    app._PRIOR_IMAGE = img #set latest instance of old image
    app.addDiagnosisResult(app.DIAGNOSIS_RESULT)
    enableDiagnosisResultColouring ( )
Beispiel #2
0
def loadCovid19ImageFromName(filename):
    app._PRIOR_IMAGE.destroy()  #destroy old image
    load = Image.open(filename)
    render = ImageTk.PhotoImage(load)
    img = Label(image=render)
    img.image = render
    img.place(x=(int(screenWidth) / 2) - load.width / 2,
              y=((int(screenHeight) / 2)) - load.height / 2)
    outputContent = "#############################################\n" + filename + "\n\n"
    outputContent += covid19_ai_diagnoser.doOnlineInference_covid19Pneumonia(
        filename)
    print(outputContent)
    app._PRIOR_IMAGE = img  #set latest instance of old image
    messagebox.showinfo(title=windowTitle + " : Result ",
                        message=outputContent)