A readme for the python-based Application that analyse the Lateral Flow Assay images and quantify their bands/spots.
The LFA Python App consists of mainly 3 tabs:
-
Band automatic detection which works mainly with the help of Hough line transform using OpenCV package
-
Background correction with different color conversion and thresholding methods.
-
Intensity data which creates datatable containing details like number of bands in that image and their respective mean and median.
-
Open the directory:
Windows/Unix/macOS:
cd LFAApp_git
-
In order to create the new virtual environment enter the command:
Windows:
python -m venv project_env
Unix/macOS:
python3 -m venv project_env
This will create a new virtual environment named “project_env”.
-
Once the environment is created, you can activate the environment using the command:
Windows:
project_env\Scripts\activate.bat
Unix/macOS:
project_env/bin/activate
-
Use requirements.txt file for a new person to install all dependencies.
Windows:
pip install -r /path/to/requirements.txt
Unix/macOS:
python3 -m pip install -r requirements.txt
To check, if all the packages and dependencies are successfully installed, use the command: Windows/Unix/macOS:
pip freeze
-
To deactivate the directory:
Windows/Unix/macOS:
deactivate
-
To delete or remove directory:
Windows:
rmdir project_env /s
Unix/macOS:
rm -r project_env
After installing the packages, run the main.py code.
In the first tab, firstly upload the LFA image from your folder. Select the image, then a ROI window opens up, crop the image without including the shadow regions and hit enter, then the upload button. The app displays the uploaded-cropped image. Next hit the "Apply detection" button, then the app displays the cropped band-detected image and also the in the next box the number of lines detected from that image.
Coming to the second tab, select the color conversion method from the dropdown options(Gray, Luminance, Red, Green, Blue). Then select any thresholding methods like OTSU, Li, Yen, Isodata, Triangle. For increasing the area for the better calculation of median and mean of the image, set an offset value(preferably 20). Then make sure to click on the "Apply background correction" button.
In the last tab, click "Create datatable" button, which will turn to a datatable containing intensity data and other related details of the detected-bands. Lastly download datatable, if you want to store the information of the uploaded image.