Skip to content

Commit 16606ff

Browse files
authored
Update reference.md
Adding digital image basics primer for reference
1 parent 86a1342 commit 16606ff

1 file changed

Lines changed: 62 additions & 6 deletions

File tree

learners/reference.md

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,63 @@
11
---
22
title: Reference
33
---
4-
## Glossary
4+
## Primer on the Basics of Digital Images
55

6-
binary image
7-
: an image of pixels with only two possible values, 0 and 1. Typically, the two colours used for a binary image are black and white.
6+
### Pixels and Intensity
7+
Microscopy images are made up of pixels arranged in a grid. Each pixel stores a numerical value representing how bright that part of the image is, often referred to as the intensity. In most images, higher values mean brighter areas. These values are the foundation for all image-based measurements.
88

9-
bit
10-
: in computing a unit with a state of either 0 or 1.
9+
### Bit Depth
10+
Bit depth determines the range of intensity values that can be stored per pixel. An 8-bit image stores values from 0 to 255, while a 16-bit image allows values from 0 to 65,535. Higher bit depth enables better representation of subtle brightness differences, which is important when imaging faint or low-contrast structures.
11+
12+
### Image Dimensions
13+
Microscopy data often has more than two dimensions. In addition to spatial (x, y), you may also have:
14+
- **z-stacks** (depth),
15+
- **Time series** (t),
16+
- **Multiple channels** (c).
17+
18+
This results in 3D, 4D, or even 5D images. Tools like Napari are built to work with n-dimensional image data.
19+
20+
### Channels
21+
Each channel represents a different signal or fluorophore, captured using specific excitation and emission settings (e.g., DAPI for nuclei or GFP-tagged proteins). These are usually stored as separate grayscale images and can be visualized together as composite images. Different channels are often analysed separately, depending on what they label.
22+
23+
### Brightness and Contrast
24+
Brightness and contrast settings determine how intensity values are mapped to your screen. You usually set a display minimum and maximum and for a linear grayscale look up table intensities below the minimum will appear black, above the maximum appear white, and values in between are scaled accordingly. These adjustments affect only the display, making things appear brighter or giving them more contrast. The underlying data is not affected by this.
25+
26+
### File Formats
27+
Microscopy images come in a range of formats:
28+
- **Open formats** like `.tif` (TIFF) are commonly used and broadly supported by analysis tools.
29+
- **Proprietary formats** like `.nd2`, `.czi`, and `.lif` are produced by specific microscope systems and often contain embedded metadata.
30+
31+
When exporting images for analysis, use formats that preserve full bit depth and metadata.
32+
33+
### Metadata
34+
Metadata is "data about data" — it describes how to interpret the intensity grid. This includes pixel size (e.g., microns per pixel), z-step size, channel names, and microscope settings like exposure time or objective lens. Metadata is essential for accurate measurements and reproducibility, especially in 3D or time-lapse datasets.
1135

36+
### Noise and Convolution
37+
All microscopy images contain **noise** — random fluctuations in pixel values that do not reflect the actual structure of the sample. Common sources include:
38+
- **Shot noise** from the light detection process,
39+
- **Electronic noise** from the detector,
40+
- **Background autofluorescence** from the sample or mounting media.
1241

42+
**Convolution** in microscopy refers to how light from a single point in the sample spreads into a shape called the **point spread function (PSF)** due to diffraction and optical limitations. This blurs the image and limits resolution. Many image processing steps aim to reverse or account for this effect and the effect of noise.
43+
44+
### Filters
45+
Filters are used to reduce noise, enhance contrast, or correct illumination. Common examples:
46+
- **Gaussian blur**: smooths the image by averaging nearby pixels.
47+
- **Median filter**: removes speckle noise while preserving edges.
48+
- **Background subtraction**: removes uneven illumination using techniques like rolling ball or difference of Gaussians.
49+
These filters can improve the performance of downstream analysis like segmentation.
50+
51+
### Segmentation
52+
Segmentation is the process of identifying and outlining objects of interest (e.g., nuclei, cells, vesicles). It’s a key step in quantitative image analysis. Approaches include:
53+
- **Thresholding** is the process of deciding which pixels belong to the object or background based on their intensity.
54+
- **Binarisation** is the result of thresholding — it converts the image into two values (typically 0 and 1) where one represents the object and the other the background.
55+
- **Watershed**: splits touching objects based on shape/topography.
56+
- **Semantic segmentation**: labels each pixel according to class (e.g., cell vs. background).
57+
- **Instance segmentation**: detects and labels each object individually.
58+
- **Deep learning-based tools**: [Cellpose](https://www.cellpose.org/), [StarDist](https://github.com/stardist/stardist), and [Instanseg](https://github.com/instanseg/instanseg) use pre-trained neural networks to perofrm instance segmentation. They can often give good results of complex or low-contrast images that are very difficult to segment usuing traditional image processing methods.
59+
60+
1361
## Python syntax primer
1462

1563
As this is a course on image analysis, some prior knowledge of Python syntax is assumed.
@@ -222,4 +270,12 @@ for val in values:
222270

223271
else:
224272
print(str(val) + ' is less than 0')
225-
```
273+
```
274+
275+
## Glossary
276+
277+
binary image
278+
: an image of pixels with only two possible values, 0 and 1. Typically, the two colours used for a binary image are black and white.
279+
280+
bit
281+
: in computing a unit with a state of either 0 or 1.

0 commit comments

Comments
 (0)