Batch exploration of segmentation results

Prerequisites

Before starting this lesson, you should be familiar with:

Learning Objectives

After completing this lesson, learners should be able to:
  • Use various tools to efficiently inspect segmented images and corresponding object measurements.

Motivation

Deriving scientifically sound conclusions from microscopy experiments typically requires batch analysis of large image data sets. Once the analysis has been conducted it is critical to visually inspect the results to identify errors and to make scientific discoveries. To do so efficiently requires making oneself familiar with appropriate tools.

Concept map

graph TD I("Images") --> BA("Batch analysis") BA --> S("Segmentations") S --> M("Object measurements") I --> Q("Visual inspection") S --> Q M --> Q



Figure


Depiction of a typical bioimage analysis workflow, where batch analysis of many input images yields object segmentation images and measurements, which must be quality controlled and explored for scientific discovery.






Activities

Batch explore segmented images

This activity will show how to efficiently batch explore potentially many segmented images.

Please download the example data (including the CellProfiler pipeline used to create the segmentations).

After unzipping, the data for this activity can be found in the batch_qc_practical sub-folder.


Show activity for:  

Fiji MoBIE

  • Open Fiji with the MoBIE update site installed.
  • Open Well_1_C0.tif and Well_1_nuclei_labels.tif in Fiji
    • Optional: Change the LUT for the labels to glasbey_inverted
  • Check for segmentation errors
  • Appreciate that manually inspecting all nuclei segmentations like this would be tedious
  • Close the two images in Fiji
  • Now use MoBIE to open all images and segmentations
  • [ Plugins › MoBIE › Open › Open Image and Labels… ]
    • Image URI: [ Browse ] to Well_1_C0.tif and then, to open all wells, replace _1_ by _.*_ such that it reads .../Well_.*_C0.tif
    • Label Mask URI: [ Browse ] to Well_1_nuclei_labels.tif and, same as above, replace _1_ by _.*_
    • Label Mask Table URI: Leave empty
    • SpatialCalibration: Does not matter here, because the images are only in pixel units anyway
    • Grid: Transformed (Stitched performs better if you have >100 images)
    • Click [ OK ]
  • The MoBIE UI and BigDataViewer will open allowing you to conveniently browse all data
  • Browsing suggestions
    • Use [ Ctrl L ] to shuffle the nuclei label colors
    • Use the table to move between images
    • Table Menu: Table > Add text column, call it “Notes” and add comments while browsing through the table
    • Explore the MoBIE layers UI, e.g.
      • Fit to page button
      • Toggle layers on and off
      • Change the labels layer opacity

napari (TODO)

# TODO

# If someone has an implementation please reach out :-)



Batch explore segmented images and object measurements

This activity will show how to efficiently batch explore, potentially many, segmented images and the corresponding object measurements.

Please download the example data (including the CellProfiler pipeline used to create the segmentations and object measurements).

After unzipping, the data for this activity can be found in the batch_qc_practical sub-folder.


Show activity for:  

Explore Images & Labels & Tables - Fiji MoBIE

  • Open Fiji with the MoBIE update site installed
  • Inspect Well_1_nuclei.txt in Fiji and observe that the table contains measurements for each nucleus
  • Use MoBIE to inspect segmented nuclei and nuclei measurements
  • [ Plugins › MoBIE › Open › Open Image and Labels… ]
    • Image URI: [ Browse ] to Well_1_C0.tif and then, to open all wells, replace _1_ by _.*_ such that it reads .../Well_.*_C0.tif
    • Label Mask URI: [ Browse ] to Well_1_nuclei_labels.tif and, as above, replace _1_ by _.*_
    • Label Mask Table URI: [ Browse ] to Well_1_nuclei.txt and, as above, replace _1_ by _.*_
    • SpatialCalibration: Does not matter here, because the images are only in pixel units anyway
    • Grid: Transformed (Stitched performs better if you have >100 images)
    • Click [ OK ]
  • The MoBIE UI and BigDataViewer will open allowing you to conveniently browse all data
  • Browsing suggestions:
    • Sort the nuclei table by AreaShape_Area and browse to the largest and smallest nuclei, as those are likely representing segmentation errors
    • BDV: Ctrl+Click on a particularly large nucleus and observe that the corresponding table row is moved to the top of the table
    • Table menu: Color > Color by Column, select the AreaShape_Area measurement and color it blue-white-red
    • Table menu: Annotate (this requires some practice…)

Explore Objects Table - Fiji MoBIE

  • Open Fiji with the MoBIE update site installed.
  • Open All_Wells_cells.txt in Fiji and identify the columns that contain file names, as those will be needed to open the table with MoBIE
  • [ Plugins › MoBIE › Open › Open Table… ]
    • Table Path: [ Browse ] to All_Wells_cells.txt
    • Image Path Column(s): FileName_DNA, FileName_PLA
    • Labels Path Column(s): FileName_CellLabels, FileName_PLALabels
    • Data Root Folder: [ Browse ] to data folder
    • SpatialCalibration: Does not matter as everything is in pixel units
    • Grid: Transformed (Stitched performs better if you have > 100 images)
    • Click [ OK ]
  • The MoBIE UI and BigDataViewer will open, allowing you to conveniently browse all data
  • Browsing suggestions:
    • Cell table: Color > Color by Column: Children_PLA_dots_Count with blueWhiteRed LUT
      • This will paint cells red that have a lot of PLA spots
    • Image table: Color > Color by Column: Mean [Object Number] with blueWhiteRed LUT
      • This will outline images red that have a lot of cells



Batch explore ilastik output

This activity demonstrates how to efficiently batch explore output generated with the ilastik software.


Show activity for:  

Explore ilastik tracking results - Fiji MoBIE

  • Open Fiji with the MoBIE update site installed.
  • Download 2 GB ilastik tracking example data and unzip
  • [ Plugins › MoBIE › Open › Open Image and Labels… ]
    • Image URI: [ Browse ] to a file ending with --raw.tif and then, to open all data, replace the text in the filename before --raw.tif by .* such that it reads .../.*--raw.tif (do not change the folder names)
    • Label Mask URI: [ Browse ] to a file ending with --tracking-oids.h5 and, as above, change the path to .../.*--tracking-oids.h5
    • Label Mask Table URI: [ Browse ] to a file ending with --tracking-table.csv and, as above, change the path to .../.*--tracking-table.csv
    • SpatialCalibration: UsePixelUnits; this is important, because the raw.tif images are calibrated, but, unfortunately, ilastik does not persist this calibration in the output data.
    • Grid: Transformed
    • Click [ OK ]
  • The MoBIE UI and BigDataViewer will open allowing you to conveniently browse all data
  • Browsing suggestions
    • Table menu: Color by Column: lineage_id with glasbey
    • Use the BDV time slider to go through the movie
    • Look for particular shape measurements and check that the appearance of the worm corresponds to this






Assessment

Fill in the blanks

  1. TODO ___ .
  2. TODO ___ .

Solution

  1. TODO
  2. TODO




Follow-up material

Recommended follow-up modules:

Learn more: