This project provides a tool to preprocess and process medical images of bonescans using Python scripts. It includes functionalities for cropping, resizing, enhancing, and segmenting bone images using the BtrflyNet model.
-
Run the GUI application.
python app.py
Or simply double-click on the
app.exe
file. -
Select source folders and choose options for preprocessing and processing tasks. You can use imgs/wholeBodyANT and imgs/wholeBodyPOST as sample input folders.
-
Use the GUI interface to run the desired tasks.
-
The processed images will be saved in the output folder, which is created in the same directory as the source folder.
Before running the scripts, you need to set up a virtual environment and install the required dependencies. You can do this using the following steps:
-
Install
virtualenv
(if not already installed):pip install virtualenv
-
Create a virtual environment:
virtualenv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On Linux/macOS:
source venv/bin/activate
-
-
Install the required dependencies:
pip install -r requirements.txt
-
Download the model here and place it in this directory.
-
Run the GUI:
python app.py
-
Or run the individual scripts:
# Use provided imgs/wholeBodyANT and imgs/wholeBodyPOST as sample input folders # Preprocessing python modules/preprocessing.py --src_front imgs/wholeBodyANT --src_back imgs/wholeBodyPOST
# Processing python modules/engine.py \ --src_front imgs/wholeBodyANT_preprocessed \ --src_back imgs/wholeBodyPOST_preprocessed
Run the scripts with the
--help
flag to see the available options.
To benchmark the threaded and nonthreaded versions of the preprocessing and processing scripts, run the following command:
python modules/benchmarking.py
The results will be saved in the logs/benchmarking.txt
file.
pyinstaller --onefile \
--distpath . \
app.py
This will create an executable file (app.exe
) in the current directory. You can run this file to launch the GUI application.
If you encounter any issues or errors while running the scripts, please ensure that the virtual environment is activated and the required dependencies are installed.