예제 #1
0
def planar_imaging_start():

    colormaps = ["gray", "Greys", "brg", "prism"]
    displayname = request.forms.hidden_displayname
    username = request.get_cookie("account", secret=config.SECRET_KEY)
    if not username:
        redirect("/login")
    try:
        variables = general_functions.Read_from_dcm_database()
    except ConnectionError:
        return template(
            "error_template",
            {"error_message": "Orthanc is "
             "refusing connection."})
    variables["displayname"] = displayname
    response.set_cookie("account",
                        username,
                        secret=config.SECRET_KEY,
                        samesite="lax")
    variables["colormaps"] = colormaps

    # Get list of machines/beams/phantoms from the database
    machines_and_beams = {}
    for k in config.PLANARIMAGING_PHANTOMS:
        machines_and_beams[k] = general_functions.get_machines_and_energies(
            general_functions.get_treatmentunits_planarimaging(k))

    variables["machines_beams_phantoms"] = machines_and_beams
    return template("planar_imaging", variables)
예제 #2
0
def starshot_module():
    displayname = request.forms.hidden_displayname
    username = request.get_cookie("account", secret=config.SECRET_KEY)
    if not username:
        redirect("/login")
    try:
        variables = general_functions.Read_from_dcm_database()
        variables["displayname"] = displayname
        response.set_cookie("account", username, secret=config.SECRET_KEY, samesite="lax")
    except ConnectionError:
        return template("error_template", {"error_message": "Orthanc is refusing connection."})
    return template("starshot", variables)
예제 #3
0
def image_review():

    colormaps = ["Greys", "gray", "brg", "prism"]
    displayname = request.forms.hidden_displayname
    username = request.get_cookie("account", secret=config.SECRET_KEY)
    if not username:
        redirect("/login")
    try:
        variables = general_functions.Read_from_dcm_database()
        variables["colormaps"] = colormaps
        variables["displayname"] = displayname
        response.set_cookie("account", username, secret=config.SECRET_KEY, samesite="lax")
    except ConnectionError:
        return template("error_template", {"error_message": "Orthanc is refusing connection."})
    return template("image_review", variables)