Commit ced5712d authored by Christian Tischer's avatar Christian Tischer

DoG

parent d8edc0f6
No preview for this file type
// create empty image
newImage("test", "8-bit black", 400, 400, 1);
// add offset
run("Add...", "value=10");
//
// draw uneven background
//
background = 100;
makeOval(150, 150, 100, 100);
run("Add...", "value=&background");
// remove selection (otherwise all following actions will only be executed in the selected region)
run("Select None");
// blur backgroud
run("Gaussian Blur...", "sigma=20");
//
// draw spots
//
diameter = 5;
spots = 40;
// draw spot
makeOval(170, 170, diameter, diameter);
run("Add...", "value=&spots");
// draw spot
makeOval(350, 350, diameter, diameter);
run("Add...", "value=&spots");
// remove selection (otherwise all following actions will only be executed in the selected region)
run("Select None");
// blur spots
run("Gaussian Blur...", "sigma=2");
//
// add noise
//
// add noise
run("Add Specified Noise...", "standard=5");
# Rank filters
## Basic rank filters
<img src='https://g.gravizo.com/svg?
digraph G {
shift [fontcolor=white,color=white];
"rank filters" -> awesome [label=" are"];
"rank filters" -> minimum [label=" e.g."] -> erosion [label=" aka"];
"rank filters" -> maximum [label=" e.g."] -> dilation [label=" aka"];
"rank filters" -> median [label=" e.g."];
}
'/>
### Activity: Explore rank filters on binary images
- Open image: xy_8bit_binary__two_spots_different_size.tif
- Explore how the structures grow and shrink when using erosion and dilation
### Activity: Explore rank filters on grayscale images
- Open image: xy_8bit__two_noisy_squares_different_size.tif
- Explore how a median filter
- removes noise
- removes small structures
- preserves egdes
- Compare median filter to a mean filter of same radius
### Formative assessment
TODO
## Morphological opening and closing
<img src='https://g.gravizo.com/svg?
digraph G {
shift [fontcolor=white,color=white];
"opening" -> "rank filter sequence" [label=" is"];
"closing" -> "rank filter sequence" [label=" is"];
"opening" -> "removes small structures";
"closing -> "fills small gaps";
}
'/>
```
opening( image ) = dilation( erosion( image ) )
```
```
closing( image ) = erosion( dilation ( image ) )
```
### Activity: Explore opening and closing on binary images
- Open image: xy_8bit_binary__for_open_and_close.tif
- Explore the effect of morphological closing and opening
- Closing can fill the hole
- Closing can connect the circle
- Opening can remove thin structures
### Formative assessment
TODO
## Top hat filter for local background subtraction
<img src='https://g.gravizo.com/svg?
digraph G {
shift [fontcolor=white,color=white];
"top hat filter" -> "rank filter sequence" [label=" is"];
"top hat filter" -> "local background subtraction";
}
'/>
```
topHat( image ) = image - dilation( erosion( image, r), r )
```
### Activity: Explore tophat filter
- Open image: xy_8bit__spots_local_background.tif
- Use topHat filter to remove local background
## Activity: Implement a tophat filter
- Devise code to implement a tophat filter using basic functions
## Activity: Explore tophat filter on biological data
- Open image: xy_16bit__autophagosomes.tif
- Use topHat filter to remove local background
## Activity: Explore tophat fiter on noisy data
- Open image: xy_8bit__spots_local_background_with_noise.tif
- Use topHat filter to remove local background
- Appreciate that noise poses a challenge to the tophat filter
### Formative assessment
TODO
## Median filter for local background subtraction
<img src='https§://g.gravizo.com/svg?
digraph G {
shift [fontcolor=white,color=white];
"median" -> "local background";
"median" -> "radius" -> "about 3 times larger than foreground objects";
}
'/>
```
median_based_background_correction = image - median( image, r)
```
### Activity: Implement median based background subtraction
- Write code to implement a median based background subtraction
### Activity: Explore median filter for local background subtraction
- Open images:
- xy_8bit__spots_local_background.tif
- xy_8bit__spots_local_background_with_noise.tif
-
- Use topHat filter to remove local background
- Devise code to implement a tophat filter using basic functions
### Formative assessment
TODO
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