Skip to content

galledohm/AmScope-Mushroom-Spore-Easy-Measurement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AmScope Mushroom Spore Easy Measurement

License: MIT Python

Lightweight utility to calculate spore dimension statistics and mycological parameters from CSV measurements.

Features

  • Parses CSV rows with a "Length" column like "8.177, 5.515". These measurments are generated at the AMScope software using the "Vertical- Four Points" feature and then exporting the measurements to a CSV file.
  • Computes min/max/mean/std for length and width, Q (L/W) statistics, coefficient of variation C, Me (mean of extremes) and Qe.
  • Outputs a concise console summary and a detailed analysis log next to the input CSV.

Quick start

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the script:
python spore_mean_meas.py samples/Collybia_nuda.csv

Files and symbols

Usage details

  • Input CSV must contain a header with a column named Length where each cell is formatted "height, width" (quotes optional).
  • The script writes an analysis log file next to the CSV named <original>_analysis.log.

Example output (console)

6.11-7.52 (6.53) µm x 4.04-5.19 (4.56) µm; Q=1.43; σ=0.12; C=81.36%; Me=6.32 x 4.62; Qe=1.43
Analysis log saved to: samples/Collybia_nuda_analysis.log

Future improvements

The following enhancements are under consideration to improve code quality, readability, and statistical rigor:

Code Quality & Maintainability

  • Replace dictionary return value with a dataclass for better type safety and IDE support
  • Extract formatting logic into a single reusable function to eliminate duplication between console and log output
  • Migrate file path handling to pathlib.Path for modern, cross-platform file operations

Robustness

  • Improve CSV parsing to automatically strip whitespace: handle formats like "8.177, 5.515" seamlessly

Statistical Enhancements

  • Add median length and width statistics
  • Compute interquartile range (IQR) for robustness analysis
  • Include min/max of the Q ratio (L/W) across all measurements
  • Consider skewness and kurtosis for distribution shape analysis

Contributing

  • Open issues or pull requests for fixes and improvements.
  • Keep changes minimal and include tests where appropriate.

Acknowledgements

  • Special thanks to the outstanding work of the Asociación Micológica La Senderuela for their contributions to mycology, fieldwork, and community education — their efforts inspired and supported projects like this one.

License

  • Released under the MIT License — see LICENSE.

About

Python script to automate spore measurement statistics when using AmScope SW

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages