virtualscanner.coms.coms_ui¶
Communications with front end
coms_server_flask.py¶
-
allowed_file
(filename)¶ Checks that the file extension is within the application allowed extensions.
- Parameters
filename (str) – Uploaded file name
- Returns
Allowed or not allowed extension
- Return type
bool
-
launch_virtualscanner
()¶ Runs the server in the specified machine’s local network address.
-
log_in
()¶ Renders the log-in html page on the web and requests user log-in information (e-mail) and choice of user mode (Standard/Advanced).
- Returns
- Redirects to register page if user-name exists and Standard mode is selectedORRedirects to recon page if user-name exists and Advanced mode is selectedORRenders log-in template
- Return type
AppContext
-
on_acq
()¶ Renders the acquire html page on the web.
- Returns
- Renders acquire templateMay also pass variables:success : intEither 1 or 0 depending on acquisition successaxial : listFile names for generated axial imagessagittal : listFile names for generated sagittal imagescoronal : listFile names for generated coronal imagespayload : dictForm inputted values sent back to display together with template
- Return type
AppContext
-
on_analyze
()¶ Renders the analyze html page on the web.
- Returns
- Renders analyze templateMay also pass variables:roi_success/map_success/load_success : intEither 1 or 0 depending on analyze steps successpayload1/payload2/payload3 : dictForm inputted values and output results sent back to display together with template
- Return type
AppContext
-
on_recon
()¶ Renders the recon html page on the web.
- Returns
- Renders recon templateMay also pass variables:success : intEither 1 or 0 depending on recon successpayload : dictForm inputted values and output results sent back to display together with template
- Return type
AppContext
-
on_register
()¶ Renders the registration html page on the web.
- Returns
- Renders register pageORRedirects to register success page if registration occurs
- Return type
AppContext
-
on_register_success
()¶ Renders the registration html page on the web with a success message when registration occurs.
- Returns
- Renders register page with registration success messageMay also pass variables:success : intEither 1 or 0 depending on registration successpayload : dictForm inputted values sent back to display together with template
- Return type
AppContext
-
on_rx
()¶ Renders the rx html page on the web.
- Returns
- Renders rx templateMay also pass variables:success : intEither 1 or 0 depending on rx successpayload : dictForm inputted values and output results sent back to display together with template
- Return type
AppContext
-
on_tx
()¶ Renders the tx html page on the web.
- Returns
- Renders tx templateMay also pass variables:success : intEither 1 or 0 depending on tx successpayload : dictForm inputted values and output results sent back to display together with template
- Return type
AppContext
-
worker
()¶ Receives form inputs from the templates and applies the server methods.
- Returns
Either renders templates or redirects to other templates
- Return type
AppContext
coms_ui.py¶
This script unit starts and tests the communications between server and client(s). Requires coms_server_flask to be running before the unit test is run (run coms_server_flask first).