MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / run

Method run

ij/src/main/java/ij/plugin/BatchMeasure.java:11–30  ·  view source on GitHub ↗
(String arg)

Source from the content-addressed store, hash-verified

9 public class BatchMeasure implements PlugIn {
10
11 public void run(String arg) {
12 String dir = IJ.getDirectory("Choose a Folder");
13 if (dir==null) return;
14 String[] list = (new File(dir)).list();
15 if (list==null) return;
16 Analyzer.setMeasurement(Measurements.LABELS, true);
17 for (int i=0; i<list.length; i++) {
18 if (list[i].startsWith(".")) continue;
19 String path = dir + list[i];
20 IJ.showProgress(i+1, list.length);
21 IJ.redirectErrorMessages(true);
22 ImagePlus imp = !path.endsWith("/")?IJ.openImage(path):null;
23 IJ.redirectErrorMessages(false);
24 if (imp!=null) {
25 IJ.run(imp, "Measure", "");
26 imp.close();
27 } else if (!path.endsWith("/"))
28 IJ.log("IJ.openImage() returned null: "+path);
29 }
30 }
31
32}

Callers

nothing calls this directly

Calls 10

getDirectoryMethod · 0.95
setMeasurementMethod · 0.95
showProgressMethod · 0.95
redirectErrorMessagesMethod · 0.95
openImageMethod · 0.95
runMethod · 0.95
closeMethod · 0.95
logMethod · 0.95
startsWithMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected