// Takes real GUI screenshots of ImageJ 1.54r (run under Xvfb). Argument: "" d = getArgument(); run("Record..."); // Plugins > Macros > Record... (Macro Recorder window) wait(600); open(d + "/images/B_noisy.tif"); setLocation(20, 60); run("Set Scale...", "distance=1 known=0.5 pixel=1 unit=um"); run("Threshold..."); // Image > Adjust > Threshold... window wait(800); setAutoThreshold("Otsu"); wait(800); call("ij.plugin.frame.ThresholdAdjuster.update"); run("Capture Screen"); saveAs("PNG", d + "/screenshots/01_threshold_otsu_B_noisy.png"); close(); selectImage("B_noisy.tif"); run("Set Measurements...", "area centroid shape redirect=None decimal=4"); run("Analyze Particles...", "size=20-Infinity pixel circularity=0.00-1.00 show=[Overlay Outlines] display exclude clear include summarize"); wait(1200); run("Capture Screen"); saveAs("PNG", d + "/screenshots/02_analyze_particles_results_B_noisy.png"); close();