中文文档: README.zh-CN.md
This tool reads a folder of fluorescence images, calculates grayscale intensity values above a selected threshold, and exports one row per image to Excel.
It provides both a Tkinter desktop UI and a command-line entry point.
- Batch process
.jpgand.jpegimages in one folder - Supports image paths containing Chinese characters
- Applies a grayscale threshold before calculating intensity
- Exports image name, maximum intensity, total intensity, and average intensity to
.xlsx - Can be run from source or packaged with PyInstaller
.
├── examples/ # Input format and command example
├── packaging/ # PyInstaller spec
├── src/
│ └── fluorescence_intensity_batch_calculator/
│ ├── calculator.py # Core image processing logic
│ ├── cli.py # Command-line entry point
│ └── ui.py # Tkinter GUI
├── .gitignore
├── pyproject.toml
└── README.md
python -m venv .venv
.venv\Scripts\activate
python -m pip install -e .On macOS/Linux, activate the environment with:
source .venv/bin/activatefluorescence-intensity-guiYou can also run it as a module:
python -m fluorescence_intensity_batch_calculatorfluorescence-intensity "path/to/image-folder" --threshold 20 --output result.xlsxIf --output is omitted, the Excel file is saved next to the image folder as <folder-name>.xlsx.
图像名称: source image filename without extension最大值: maximum grayscale value after thresholding总光强: sum of grayscale values above the threshold平均光强: total intensity divided by total pixel count
The threshold accepts values from 0 to 255. The average is calculated over the full image, including pixels removed by the threshold.
python -m pip install -e ".[dev]"
python -m pytest -qThe tests cover threshold calculation, invalid input, Chinese paths, batch ordering, and Excel export.
Install the build dependencies:
python -m pip install -e ".[build]"Then run PyInstaller:
pyinstaller packaging/fluorescence-intensity-batch-calculator.spec