After completing this lesson, learners should be able to:
Automatically process a number of images
Motivation
Scientific discovery is based on reproducibility. Thus, it is very common to apply the same analysis workflow to a number of images, possibly comprising different biological conditions. To achieve this, it is very important to know how to efficiently “batch process” many images.
Concept map
graph TD
I1("Image 1") --> S("Analysis workflow")
I2("Image 2") --> S
IN("Image ...") --> S
S --> R1("Result 1")
S --> R2("Result 2")
S --> RN("Result ...")
Figure
Batch processing of many images, yielding many tables.
Measure the nuclei area and save the results in a table.
Show activity for:
ImageJ Macro Scijava
/**
* 2D Nuclei area measurement
*
* Requirements:
* - Update site: IJPB-Plugins (MorpholibJ)
*/// Scijava script parameters// Use the [ Batch ] button in the Fiji script editor to automatically analyse multiple files#@File(label="Input image")inputImageFile#@File(label="Output directory",style="directory")outputDir// Processing parametersthreshold=25;// Coderun("Close All");// avoid showing of image windows (unf. table windows are still popping up)setBatchMode(true);// black backgroundrun("Options...","iterations=1 count=1 black do=Nothing");open(inputImageFile);imageName=File.getNameWithoutExtension(inputImageFile);// segmentsetThreshold(threshold,65535);run("Convert to Mask");run("Connected Components Labeling","connectivity=4 type=[8 bits]");run("glasbey_on_dark");// save segmentationsaveAs("Tiff",outputDir+File.separator+imageName+"_labels.tif");// measurerun("Analyze Regions","area");// save measurementssaveAs("Results",outputDir+File.separator+imageName+".txt");run("Close");// close results table