Skip to main content

An image analysis tool for measuring microorganism colony growth

Project description

PyPI version Known Vulnerabilities GitHub

ColonyScanalyser

An image analysis tool for measuring microorganism colony growth.

ColonyScanalyser will analyse and collate statistical data from agar plate images. It provides fast, high-throughput image processing.

ColonyScanalyser can provide information on:

  • Colony appearance time
  • Growth parameters (lag time, rate, carrying capacity)
  • Growth and appearance time distribution
  • Colony colour (e.g. staining or other visual indicators)

ColonyScanalyser is suitable for analysing series of images from a fixed point that show the development of microorganism colonies over time.

Several image plots will be output after analysis is complete to enable quick verification of the data. A complete set of data is provided in CSV format for further study.

Getting Started

  • Install the prerequisites and package
  • Locate your image series in a folder e.g. /user/images/series1
  • Run the analysis using ColonyScanalyser
scanalyser /user/images/series1

There are various command line arguments that can alter the way the package is run. To see a list of arguments and information on each, run the command

scanalyser --help

Documentation

A full set of documentation is available at https://erik-white.github.io/ColonyScanalyser/

Prerequisites

ColonyScanalyser requires Python version 3.7 or greater, and the Pip package manager. Pip is included with Python version 3.4 and up.

The remaining Python package dependencies are automatically handled by Pip when installing the Colonyscanalyser package.

Optionally use a virtual environment, such as Pipenv, or a containerised instance of the package.

For testing:

Installing

Using pip

pip install colonyscanalyser

From github (requires git install)

git clone https://github.com/erik-white/colonyscanalyser.git
cd colonyscanalyser
pip install -e .

Testing

Install the package with the extra test packages: pip install colonyscanalyser[test]

Run the tests: pytest --cov colonyscanalyser

Contributing

Please read the contribution guidelines for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the releases.

License

This project is licensed under the GPLv3 - see the licence file for details

Acknowledgments

  • Levin-Reisman et al. for their work developing the ScanLag technique
  • Fabio Zanini for his original attempts at a Python implementation

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[0.6.2] - 2021-01-25

Added

  • Savitzky–Golay filtering for curve fitting and plotting

Fixed

  • Removed leftover debugging message

[0.6.0] - 2021-01-24

Added

  • An align subpackage containing image alignment functionality
  • Image alignment verification and correction before processing images
  • Command line arguments to adjust image alignment strategy and tolerance

Changed

  • Growth curves now use a windowed median which should help to smooth the curve

Fixed

  • Various warnings emitted when running the tests

[0.5.3] - 2020-09-07

Changed

  • Updated and improved IdentifiedCollection, now backed by a Dictionary for easier lookup

Fixed

  • Images are now correctly converted when creating image animations, fixing buffer errors

[0.5.2] - 2020-07-05

Changed

  • Removes the temporary fix used when identifying plate centres

[0.5.1] - 2020-06-07

Fixed

  • RGB images are correctly handled during colour mode conversion

[0.5.0] - 2020-06-05

Added

  • Utilize multiprocessing for grouping and filtering Timepoints to Colonies
  • silent command line argument to prevent output to console
  • animation command line argument to output
  • New class function, from_path, for building an ImageFileCollection

Changed

  • Improved plot labels/legends
  • plots command line argument replaced with no-plots switch
  • multiprocessing command line argument replaced with single-process switch
  • Reworked command line arguments, using simplified switches for boolean arguments
  • Reworked command line arguments to follow GNU conventions
  • Refactored main module
  • Improve access model and remove forward typing

Fixed

  • Ensure image files are converted to RGB

[0.4.4] - 2020-06-03

Fixed

  • Plots are now saved to the correct directory again

[0.4.3] - 2020-06-02

Added

  • --version command line argument to display installed package version number
  • --image_formats command line argument to display supported image formats
  • Package configuration and now consolidated and loaded from a settings module

Changed

  • Improved the output from the --help command line argument to make it a little clearer

[0.4.2] - 2020-05-18

Added

  • Support for bmp image files

Fixed

  • Wrong type reference in colony.colonies_from_timepoints

Changed

  • image_file._load_image will now retry once if it fails

[0.4.1] - 2020-05-11

Added

[0.4.0] - 2020-03-26

Added

  • plate_labels command line argument
  • base module with base classes to provide core functionality throughout the package
  • geometry module with base shape classes
  • plate module with Plate and PlateCollection classes
  • image_file module with ImageFile and ImageFileCollection classes
  • growth_curve module to provide curve fitting and parameters
  • plot_plate_images_animation outputs animated gifs for each plate in two sizes
  • Output a summary of plate properties to plates_summary.csv
  • Full type hinting for all modules

Changed

  • Extended compatibility to Python 3.8
  • Cached data is now not used by default
  • Individual plots for each plate are now output by default
  • use_saved command line argument renamed to use_cached_data
  • Compressed serialised data filename changed to cached_data
  • save_plots command line argument renamed to plots
  • plate_size now defaults to 90 mm, the visible size of a 100 mm plate in a plate holder
  • plate_edge_cut is now a percentage of the plate diameter, instead of a fixed pixel value
  • Refactored most of the functions from main as static methods in the plate or image_file modules
  • Improved flexibility when detecting date and time stamp information in file names
  • Replaced growth properties in Colony, now implemented as growth_curve.GrowthCurveModel
  • Modified plots to use new GrowthCurveModel properties
  • Improved colony segmentation in low contrast images and under poor growth conditions
  • Grouping of colony Timepoints is now faster and more accurate
  • Colonies are no longer identified based on circularity

Fixed

  • A rare error when opening images using skimage.io.imread
  • Corrected default DPI settings and conversion factor

Removed

  • A number of Colony properties - now implemented by growth_curve.GrowthCurveModel

[0.3.4] - 2020-01-18

Added

  • plate_edge_cut command line argument
  • Plate and colony ID map to show how they have been identified

Changed

  • Add border exclusion and slightly relax colony circularity filtering in segment_image

[0.3.3] - 2019-12-19

Added

  • Colony colour identification and grouping
  • Webcolors package and rgb_to_name function to provide CSS colour groupings

Fixed

  • crop_image will now correctly handle images without an alpha channel

[0.3.2] - 2019-11-11

Added

[0.3.1] - 2019-11-04

Fixed

  • Adjust setup to correctly find packages in implicit namespaces

[0.3.0] - 2019-11-04

Added

  • Added changelog

Changed

  • Update package to use src structure
  • Update setup for readme compatability with PyPi

[0.2.2] - 2019-11-02

Added

  • GitHub action for automatically linting and testing pushes
  • GitHub action for building and releasing package to PyPi

Fixed

  • Linting errors highlighted by flake8

[0.2.1] - 2019-10-31

Added

  • Graceful exit if no colonies are found
  • Workaround function to ensure correct plates are found in images

Changed

  • Improve Timepoint grouping by using distance comparison instead of rounding
  • Updated Scikit-image to v0.16

Removed

  • Depreciated Tk import
  • Removed depreciated regionprop coordinates

[0.2.0] - 2019-10-28

Added

  • Multiprocessing: greatly improves image processing speed
  • Now shows a progress bar when processing images
  • Snyk security checks for dependencies

Changed

  • Per image processing: now processes a single image at a time
  • Improve colony filtering, removes virtually all merged colonies
  • Updated readme with images and code examples

Fixed

  • Greatly reduced memory usage by using per-image processing
  • Filter out system files when locating images to process
  • Rare divide by zero error when processing colony object data

[0.1.2] - 2019-10-13

Inital release

Added

  • Image processing, plotting and data aggregation
  • Python package uploaded to PyPi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colonyscanalyser-0.6.2.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

colonyscanalyser-0.6.2-py3-none-any.whl (59.4 kB view details)

Uploaded Python 3

File details

Details for the file colonyscanalyser-0.6.2.tar.gz.

File metadata

  • Download URL: colonyscanalyser-0.6.2.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for colonyscanalyser-0.6.2.tar.gz
Algorithm Hash digest
SHA256 e54dfbafe0cafbbe662876d6a21a6e52ba5f90a7d2b8ed5ab9d064b69a0d86a7
MD5 93eafbc4740a3f1375ea270eca757c72
BLAKE2b-256 715d4620e8bde0c17bdce4ce32263e8b724fb6b6ee68359ab807479de6bd65f9

See more details on using hashes here.

File details

Details for the file colonyscanalyser-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: colonyscanalyser-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 59.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for colonyscanalyser-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1f44100207ff880ec3bd03d1bb6188a6556b5d9ce39acac839f3e0724c691a
MD5 0055a128663c3fad05a464950b2bbe40
BLAKE2b-256 f6c6e46d23c33fffd4380422d8a8ebca54866aa6a4a83b1426ac16ab80296c75

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page