Commit 3baa5232 authored by Dominik Kutra's avatar Dominik Kutra

added initial content from Jonas Notebook

parent 62d7bf61
Pipeline #10469 passed with stage
in 3 minutes and 51 seconds
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Preprocessing, Filters\n",
"\n",
"The presented material is based on material prepared by *Jonas Hartmann (Gilmour group, EMBL Heidelberg)*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Table of Contents\n",
"\n",
"1. [Background](#Background)\n",
"1. [Convolutional Filters](#Convolutional-Filters)\n",
"1. [Rank Filters]()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Background\n",
"\n",
"The goal of image preprocessing is to prepare or optimize the images to make further analysis easier. Usually, this boils down to increasing the signal-to-noise ratio by removing noise and background and by enhancing structures of interest.\n",
"\n",
"The specific preprocessing steps used in a pipeline depend on the type of sample, the microscopy technique used, the image quality, and the desired downstream analysis. \n",
"\n",
"The most common operations include:\n",
"\n",
"\n",
"- Deconvolution\n",
" - Image reconstruction based on information about the PSF of the microscope\n",
" - These days deconvolution is often included with microscope software\n",
" - *Our example images are not deconvolved, but will do just fine regardless*\n",
"\n",
"\n",
"- Conversion to 8-bit images to save memory / computational time\n",
" - *Our example images are already 8-bit*\n",
"\n",
"\n",
"- Cropping of images to an interesting region\n",
" - *The field of view in our example images is fine as it is*\n",
"\n",
"\n",
"- Smoothing of technical noise\n",
" - This is a very common step and usually helps to improve almost any type of downstream analysis\n",
" - Commonly used filters are the `Gaussian filter` and the `median filter`\n",
" - *Here we will be using a Gaussian filter.*\n",
"\n",
"\n",
"- Corrections of technical artifacts\n",
" - Common examples are uneven illumination and multi-channel bleed-through\n",
" - *Here we will deal with uneven signal by adaptive/local thresholding*\n",
"\n",
"\n",
"- Background subtraction\n",
" - There are various ways of sutracting background signal from an image\n",
" - Two different types are commonly distinguished:\n",
" - `uniform background subtraction` treats all regions of the image the same\n",
" - `adaptive or local background subtraction` automatically accounts for differences between regions of the image\n",
" - *Here we will do something similar to adaptive background subtraction when we do adaptive thresholding*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Convolutional Filters\n",
"\n",
"### Gaussian Smoothing\n",
"\n",
"A Gaussian filter smoothens an image by convolving it with a Gaussian-shaped kernel. In the case of a 2D image, the Gaussian kernel is also 2D and will look something like this:\n",
"\n",
"<img src=\"../session-3to5/ipynb_images/gaussian_kernel_grid.png\" alt=\"Gaussian Kernel Figure\" style=\"width: 300px;\"/>\n",
"\n",
"How much the image is smoothed by a Gaussian kernel is determined by the standard deviation of the Gaussian distribution, usually referred to as **sigma** ($\\sigma$). A higher $\\sigma$ means a broader distribution and thus more smoothing.\n",
"\n",
"**How to choose the correct value of $\\sigma$?**\n",
"\n",
"This depends a lot on your images, in particular on the pixel size. In general, the chosen $\\sigma$ should be large enough to blur out noise but small enough so the \"structures of interest\" do not get blurred too much. Usually, the best value for $\\sigma$ is simply found by trying out some different options and looking at the result. \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment