mufidu / batch-processing-kupu

batch-processing-kupu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic ANT-POST Bone Scan Image Segmentation

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.

Usage

GUI Application

  1. Run the GUI application.

    python app.py

    Or simply double-click on the app.exe file.

  2. Select source folders and choose options for preprocessing and processing tasks. You can use imgs/wholeBodyANT and imgs/wholeBodyPOST as sample input folders.

  3. Use the GUI interface to run the desired tasks.

  4. The processed images will be saved in the output folder, which is created in the same directory as the source folder.

Development

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:

  1. Install virtualenv (if not already installed):

    pip install virtualenv
  2. Create a virtual environment:

    virtualenv venv
  3. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
    • On Linux/macOS:

      source venv/bin/activate
  4. Install the required dependencies:

    pip install -r requirements.txt
  5. Download the model here and place it in this directory.

  6. Run the GUI:

    python app.py
  7. 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.

Benchmarking

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.

Building

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.

Troubleshooting

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.

About

batch-processing-kupu


Languages

Language:Python 100.0%