Skip to content

Commit d1e7d85

Browse files
committed
show performance benchmark after load
1 parent 0a6c65d commit d1e7d85

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/swharden/imagej/QuickPV.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.swharden.imagej;
22

33
import java.io.File;
4+
import java.nio.file.Paths;
5+
import java.security.Timestamp;
46

57
import ij.IJ;
68
import ij.ImagePlus;
@@ -14,6 +16,8 @@ public class QuickPV implements PlugIn {
1416
@Override
1517
public void run(String arg) {
1618

19+
long timeStart = System.currentTimeMillis();
20+
1721
String xmlFilePath = IJ.getFilePath("Select XML file");
1822
if (xmlFilePath == null)
1923
return;
@@ -45,10 +49,12 @@ public void run(String arg) {
4549
arrayOfImages[i] = IJ.createImage("empty", "composite", width, height, depth);
4650
}
4751
}
48-
IJ.showStatus("");
52+
53+
IJ.showStatus("Creating hyperstack...");
4954

5055
ImagePlus imp = ImagesToStack.run(arrayOfImages);
5156
imp = HyperStackConverter.toHyperStack(imp, exp.ChannelCount, exp.StackDepth, exp.TimePoints, "composite");
57+
imp.setTitle(Paths.get(folderPath).getFileName().toString());
5258

5359
Calibration cal = new Calibration();
5460
cal.pixelWidth = exp.PixelWidth;
@@ -59,5 +65,8 @@ public void run(String arg) {
5965
imp.setCalibration(cal);
6066

6167
imp.show();
68+
69+
long timeElapsed = System.currentTimeMillis() - timeStart;
70+
IJ.showStatus(String.format("QuickPV loaded %d images in %.3f sec", exp.ImageCount, timeElapsed / 1000.0));
6271
}
6372
}

0 commit comments

Comments
 (0)