After completing this lesson, learners should be able to:
Create a basic image analysis workflow.
Understand that bioimage analysis workflows consist of a sequence of image analysis components.
Segment nuclei in a 2D image and measure their shapes and understand the components (concepts and methods) that are needed to accomplish this task.
Draw a biophysically meaningful conclusion from applying an image analysis workflow to a set of images.
Motivation
Detecting a set of objects in an image, counting them and measuring certain characteristics about their morphology is probably the most frequently occurring task in bioimage analysis. Depending on the image, even this task could become quite challenging and the workflow could become quite complex. Here we start with a relatively simple image where combining a minimal set of image analysis components into a simple workflow does the job.
Concept map
graph TD
I("Grayscale image") --> T("Intensity threshold")
T --> BI["Binary image"]
BI --> C("Connected component labeling")
C --> LI["Label image"]
LI --> S("Shape measurement")
S --> SFT["Object feature table"]
Figure
Workflow for nuclei segmentation and area measurement.
The images are two time points of a time lapse experiment where the INCENP gene was subjected to siRNA knock-down. The data are taken from the published mitocheck screen. In this screen the authors carried out a genome-wide phenotypic profiling of each of the ~21,000 human protein-coding genes by two-day live imaging of fluorescently labelled chromosomes. Phenotypes were scored quantitatively by computational image processing, which allowed them to identify hundreds of human genes involved in diverse biological functions including cell division, migration and survival.
The analysis that we do here is, of course, simpler than what the authors did in the publication, but the essence is already very similar. In addition, to simplify the task we work here on images that were cropped and slightly denoised.
Workflow
Apply the workflow outlined above (see concept map) to both images.
The modules listed in “Prerequisites” contain the information as to how to conduct each step of the workflow.
The nuclei in both images look quite different. Find shape measurements that quantify this.
Show activity for:
ImageJ GUI
[ Process › Binary › Options… ]
Black background
Open one of the input image (see above)
[ Image › Duplicate… ]
Title = binary
Draw a line profile to find a good threshold
Use the straight line tool in the Fiji menu bar
[ Analyze › Plot Profile ]
[ Live ] and move the line around, including nuclei and background pixels
# %%
# Import modules
importnaparifromOpenIJTIFFimportopen_ij_tifffromskimage.measureimportlabel,regionprops_tableimportpandasaspd# %%
# Instantiate the napari viewer
napari_viewer=napari.Viewer()# %%
# Read and inspect the image:
fpath='https://github.com/NEUBIAS/training-resources/raw/master/image_data/xy_8bit__mitocheck_incenp_t1.tif'image_t1,axes_t1,voxel_size_input_t1,units_t1=open_ij_tiff(fpath)napari_viewer.add_image(image_t1,name='frame 1')# %%
defnuclei_quantification(image,viewer,thr):print(f"Threshold: {thr}")# Binarize the image:
image=image>thrviewer.add_labels(image,name='binary')# Find labels:
img_labels=label(image)viewer.add_labels(img_labels,name='labels')# Obtain cell properties:
properties=regionprops_table(img_labels,properties={'label','area'})# Print areas for each cell:
areas=pd.DataFrame(properties)print(areas)# %%
# Run workflow on each image:
threshold=25nuclei_quantification(image_t1,napari_viewer,threshold)# Now try running the workflow using the second image!