Giter Site home page Giter Site logo

whoisjack / python-bioimage-analysis-tutorial Goto Github PK

View Code? Open in Web Editor NEW
90.0 3.0 37.0 11.65 MB

A self-explanatory, hands-on intro to bioimage analysis in python. Slightly outdated but still much liked by learners.

License: MIT License

Jupyter Notebook 94.24% Python 5.76%
python image-analysis image-processing biology biological-data-analysis scikit-image

python-bioimage-analysis-tutorial's Introduction

Python BioImage Analysis Tutorial

originally created in 2016
updated and converted to a Jupyter notebook in 2017
updated and converted to python 3 in 2018
by Jonas Hartmann (Mayor group, University College London)


โš ๏ธ Note that some of the materials in this tuorial are slightly out of date by now (2023), but recent feedback has shown that the tutorial is still very useful and approachable for many learners. I would like to create an updated and slightly extended version at some point, but academic pressures limit my ability to work on this, so we'll have to see how it goes... ๐Ÿคž

(Latest maintenance update: 17.02.2023, python 3.9.16 (basic Anaconda distro), with thanks to @Koushouu!)


Aims and Overview

This tutorial teaches the basics of bio-image processing, segmentation and analysis in python. It integrates explanations and exercises in a (hopefully) self-explanatory fashion, enabling participants to build their own image analysis pipelines step by step.

The tutorial uses single-cell segmentation of 2D confocal fluorescence microscopy images to illustrate key concepts from preprocessing to segmentation to (very basic) data analysis. It concludes with a small section on how to apply such a pipeline to multiple images at once (batch processing).

Everything you need to know to get started can be found in the jupyter notebook image_analysis_tutorial.ipynb. To find out more about how to run these materials interactively, see the Jupyter documentation.

Note that this tutorial was part of a course aimed at people with basic knowledge of python. The course included introductory sessions/lectures on scientific python (in particular numpy and matplotlib) as well as on image analysis (see the slides in this repository). For those tackling this tutorial on their own, it is therefore recommended to first acquire basic scientific python knowledge elsewhere (e.g. at python-course.eu).

Content Overview

  • Lecture

    • Working with digital images
      • Images as arrays of numbers
      • Look-up tables (LUTs)
      • Dimensions
      • Bit-depth
    • Image analysis pipelines
      • Preprocessing: filters, kernels, convolution, background subtraction
      • Foreground detection: thresholding, morphological operations
      • Segmentation: labels, seeds, watershed
      • Postprocessing: object filtering
      • Making measurements
  • Tutorial

    • Importing Modules & Packages
    • Loading & Handling Image Data
    • Preprocessing
    • Manual Thresholding & Threshold Detection
    • Adaptive Thresholding
    • Improving Masks with Binary Morphology
    • Connected Components Labeling
    • Cell Segmentation by Seeding & Expansion
    • Postprocessing: Removing Cells at the Image Border
    • Identifying Cell Edges
    • Extracting Quantitative Measurements
    • Simple Analysis & Visualization
    • Writing Output to Files
    • Batch Processing

Old Versions and Other Sources

This was part of the EMBL Bio-IT/ALMF Image Analysis with Python 2018 course (see the EMBL Gitlab repo).

If you are looking for the python 2 version from 2017, see the 2017_legacy_python_version branch or the corresponding EMBL GitLab repo.

The original 2016 materials can be found in Karin Sasaki's corresponding Github repo.

Acknowledgements

The first version of this tutorial was created for the EMBL Python Workshop - Image Processing course organized by Karin Sasaki and Jonas Hartmann in 2016. Additional lecturers and TAs contributing to this course were Kota Miura, Volker Hilsenstein, Aliaksandr Halavatyi, Imre Gaspar, and Toby Hodges.

The second installment (the EMBL Bio-IT Image Processing Course, 2017) was organized and taught by Jonas Hartmann and Toby Hodges.

The third version of this tutorial was part of the EMBL Bio-IT/ALMF Image Analysis with Python 2018 course, organized by Jonas Hartmann and Toby Hodges in collaboration with Tobias Rasse and Volker Hilsenstein. Additional organizational help came from Christian Tischer and Malvika Sharan.

Many thanks to all the helpful collaborators and the interested students who were instrumental in making these courses a success.

Feedback

Feedback on this tutorial is always welcome! Please open an issue on GitHub or write to jonas.hartmann(AT)ucl.ac.uk.

python-bioimage-analysis-tutorial's People

Contributors

whoisjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-bioimage-analysis-tutorial's Issues

Future Update Megathread

A list of stuff I want to update/improve to get the tutorial back in shape.

Major points

  • Change to a more interesting dataset (multiple channels, more cell diversity)
  • Add a section on ML-based segmentation (using stardist or cellpose)
  • Finalize & incorporate the data analysis / data science notebook [WIP; see Hackday 2021 local?]
  • Update the lecture slides
    • New/better examples at the start
    • More on machine learning
    • Revisit and streamline existing content
    • Modern look
    • Bonus: less basic ML, more advanced stuff
  • Record the lectures & put them on YouTube

Minor points

  • Ensure all instructions and the solutions code are up to date (+streamline a bit where possible)
  • Better handling of input/output data [Done; see Hackday 2021 branch]
    • Put input data on figshare and write code that pulls it from there on first execution (may pull from elsewhere with new data)
    • Create outputs dir and ignore everything in it with an added new .gitignore, then change file writing funcs to write there
  • Provide more and updated links to other materials
  • Switch to (or at least introduce) napari for interactive image viewing?
  • Convenience: Automatic install of all dependencies?
    • At least provide an environment.yml to facilitate install [Done; see Hackday 2021 branch]
  • Convenience: Make notebook metadata ignore conda version & co.?
  • Convenience: Add binder as a way of looking at and testing the materials without install/download? [WIP; see Hackday 2021 branch]

Use different example data

Having more engaging, and more pertinent to a wider range of biologists, would be an improvement.

We discussed possibilities including

and these various IDR datasets

  • A reference library for assigning protein subcellular localizations by image-based machine learning: data, publication
  • Dynamics of the 4D genome during in vivo lineage specification and differentiation: data, publications
  • Molecular determinants of large cargo transport into the nucleus: data, publication

It would be important to choose a dataset that either doesn't need adapting of the code or remember to adapt the code accordingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.