src package

Submodules

src.factory module

prediction.factory

Provides the flask application

src.factory.create_app(config_mode='Production', config_file=None)

Flask app creator that accepts configuration modes

Kwargs:
config_mode (str): Configuration mode. Must be one of ‘Production’,
‘Development’, or ‘Test’. Default: ‘Production’. Overridden if config_file is given.
config_file (str): Path to a Python configuration file. Overrides
config_mode.
Returns:A Flask app
Return type:(obj)

Examples

>>> create_app('Test')
>>> create_app('/path/to/config.py')

src.views module

prediction.src.views

Provides main api endpoints

src.views.home()

Shows the API info

src.views.predict(algorithm)

Performs various predictions for a path to a DICOM directory (folder of scans).

A GET request will give the documentation for the endpoint.

A POST request with Content-Type set to “application/json” and the right parameters for the algorithm will call predict.

All of the algorithms take a dicom_path parameter with a path to the file to perform the prediction on.

Some algorithms also take:
centroids (list[dict]): A list of centroids of the form::
{‘x’: int,
‘y’: int, ‘z’: int}
Parameters:algorithm (str) – The prediction algorithm to use. One of ‘segment’, ‘classify’, or ‘identify’.

Module contents