- Python >= 3.6.1
- Matlab >= R2022b
- Statistics and Machine Learning Toolbox Add-on
- Symbolic Math Toolbox
- Simulink
git clone https://github.com/liu-allan/Leukemia-Treatment-Application.git
cd <path/to/Leukemia-Treatment-Application>
pip install --upgrade pip
pip install -r requirements.txt
git submodule update --init --recursive
-
To run matlabengine on MacOS M1, need to install Rosetta2 on the machine.
-
To check whether the terminal is Rosetta2 enabled
uname -m
- if it returns x86_64, then it means you are on a Rosetta2 enabled terminal
- if it returns arm64, then it means it is not enabled
-
To install Rosetta2, open Terminal and run this command:
softwareupdate --install-rosetta --agree-to-license
-
After installing Rosetta2, please follow this youtube link: https://www.youtube.com/watch?v=9W8rTTE1WEA
- Go to Finder -> Applications -> Utilities -> Terminal
- Right click on the Terminal app and select "Duplicate" and rename the duplicate app to something else
- Then right click on the duplicated Terminal and select "Get Info" and checkmark "Open using Rosetta"
-
Now you can run the first command again to check whether you are running on x86_64
-
Download miniconda3 x86_64 bash installer using this link: https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
-
Follow step 4 and onwards to download miniconda3: https://towardsdatascience.com/how-to-install-miniconda-x86-64-apple-m1-side-by-side-on-mac-book-m1-a476936bfaf0
-
After success installation of miniconda3 x86_64, to run the entire project:
- Open Rosetta2 enabled terminal
- Set up virtual environment using the following command:
/usr/bin/python3 -m venv env source env/bin/activate
- Then continue to follow the 1.0 Setup.
- When the Leukemia Treatment Project is updated, need to use the following command to make sure that the repo contains the newest update from the submodule.
git submodule update --recursive
Open the application in the root directory of the repository.
python app.py
Login with credentials. To create a new user, see section 5.0
There are two existing example oncologists profiles in the database. The account usernames and passwords are the following:
- Username: allan, Password: wordpass
- Username: angus, Password: password
After logging in, log out at any time by pressing the Log Off
button in the top right of the application.
- To create a patient profile, click on the plus icon in the top left.
- To search for an existing patient, type the patient's name into the search bar
- Press Advanced search button to toggle between default and advanced search. Advanced search allows the user to search patients by name and ID. Only patients that satisfy both the name and ID entered will be displayed.
- To select an existing patient, click on the patient's tile.
- To delete an existing patient, press the delete button inside the patient's list item.
- Fill in patient parameters
- Press Save to add the new patient to the list
- Press Cancel to return to the previous page
- Press Edit to change patient parameters.
- If there is new data, input the prescribed dosage, ANC measurement and date of measurement.
- Press Save to save the record into the database.
- Input the number of cycles into the future to run (Note: no negative numbers or numbers > 99 as the calculate button will be disabled) (if '1' is inputted, there will actually be 2 cycles ran)
- Press Calculate to run the model with the newest and previously saved records.
Navigate to other pages by pressing the icons on the left. If the model has already been run for the patient, the user can return to the dashboard without running the model again by pressing the Dashboard icon on the left.
Note: The model only takes the most recent dosage and ANC measurement into consideration. The code needs to be modified in order to run the entire patient's history.
The model can take a few minutes (4-5 minutes per cycle) to complete. This is normal. The dashboard page will be shown as below when performing calculation. When performing calculation, all other buttons are disabled to prevent multiple calculation happening simultaneously.
After calculation, the dashboard page will show two main components.
- The top part is the ANC trajectories for two strategies.
- The bottom part is the dosage tables for two strategies.
- Navigate to previous pages using the tabs on the left.
- Press and hold left click to pan the graph.
- Press and hold right click to stretch the axes (place the cursor on the axes when you do this).
- Use the scroll wheel on the graph to zoom in and out.
The Matlab Model is called through runModel()
found in matlab_script.py
. It calls runController.m
found in the /Leukemia-Treatment-Project
directory
To view tables on vscode, install https://marketplace.visualstudio.com/items?itemName=alexcvzz.vscode-sqlite
id | user_id | name | phone_number | birthday | age | blood_type | all_type | weight | height | body_surface_area | oncologist_id | sex |
---|---|---|---|---|---|---|---|---|---|---|---|---|
int | string | string | string | string (yyyyMMdd) | string | string | string | string | string | string | string | string |
The Patients Table is encrypted with the plaintext password as the key.
time | anc_measurement | dosage_measurement | patient_id |
---|---|---|---|
string (yyyyMMdd) | float | float | int |
username | password | full_name | is_admin |
---|---|---|---|
string (yyyyMMdd) | float | float | bool |
To get a better understanding of the tables, one can look at the schemas in database.py
To create a new user, login with credentials: username: admin, password: admin
Then click on the plus icon in the top left.
Fill out the form and press save to complete registration.
Logout from the admin account and login with the newly created account.
For further details about the project, one can visit the team drive for more reports/documents.