This project segments and analyzes Retinal Pigment Epithelium (RPE) cells in microscope images, providing tools to upload, process, and visualize cell segmentation. Follow the steps below for setup, usage, troubleshooting, and contributing.
- Internet Connection: Needed only for the setup phase.
- Python Version: Python 3.10 or 3.11 (required for compatibility with PyTorch dependencies).
- Setup Script: Run once for initial configuration (see First Time Setup).
To prepare the program for use:
- Clone or Download the Repository: In the destination folder, open a terminal or PowerShell. If possible, clone the repository to simplify updates:
gh repo clone nshem/rpe_segmentation
- Windows-only Step: Enable script execution. Open PowerShell and run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
- Run the Setup Script: Go to the project’s root folder (“rpe_segmentation” or “rpe_segmentation-main”) and run the appropriate setup script:
./setup_windows.ps1 # For Windows
./setup_unix.sh # For macOS/Linux
This may take 3–20 minutes depending on your internet speed. The setup script installs dependencies and launches the program.
- After Setup: For future use, follow the Running the Program instructions below.
-
Open a Terminal: In the project’s root folder, open a terminal or PowerShell.
-
Start the Program: Run one of the following commands:
python -m src.main
or
python3 -m src.main
-
Access the Interface: Open http://localhost:5001 in Chrome (recommended) or another browser to access the web interface.
-
Gracefully Exit: To close the program, type Ctrl+C in the terminal before exiting.
- Uploading Files: Scroll to the “Upload” section, click Choose Files, select your images, and then click Upload.
- Generating Masks and Data Analysis: • For each image, masks must be generated before you can plot or export data. the ✨ emoji indicates that masks has been generated succesfully for the sample. • Use Select All for batch operations to process multiple images. Then, select an action from the menu (pink actions apply to all selected samples).
- Viewing Results: After processing, click "Plot" to see graphs and masks on a new tab, and "Export" to download an excel file.
• Stuck Loading Screen: This may occur if the program wasn’t shut down correctly. Run the following commands to force-terminate any lingering processes and restart the program: Mac/Linux:
for pid in $(lsof -ti :5001); do kill -9 $pid; done
Windows:
(Get-NetTCPConnection -LocalPort 5001 -State Listen).OwningProcess | ForEach-Object { Stop-Process -Id $_ -Force }
- Pull the Latest Changes: In the root folder, open a terminal and run:
git pull origin main
- Troubleshooting after update: • Database Errors: Delete the db.db file, then restart the program. • Python Dependency Errors: Rerun the setup script, then start the program again.
To contribute to the project please commit your changes to a side branch:
git checkout -b "<branch_name>"
git add --all
git commit -m "<description_of_changes>"
git push origin <branch_name>
Then, create a pull request on GitHub. Note: If you pull updates without merging your changes, conflicts may arise.