public void applyTSTAMP(ImagePlus imp, LsmFileInfo lfi) {
int x = 2;
int y = 20;
ImageStack stack = imp.getStack();
Font font = new Font("SansSerif", Font.PLAIN, 20);
ImageProcessor ip = imp.getProcessor();
Rectangle roi = ip.getRoi();
if (roi.width < ip.getWidth() || roi.height < ip.getHeight()) {
x = roi.x;
y = roi.y + roi.height;
}
Color c = Toolbar.getForegroundColor();
CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) lfi.imageDirectories
.get(0)).TIF_CZ_LSMINFO;
if ((cz.DimensionTime == 1)
^ (cz.DimensionZ == 1)) {
//int size = imp.getStackSize();
for (int slice = 1; slice <= cz.timeStamps.NumberTimeStamps; slice++) {
IJ.showStatus("MinMax: " + slice + "/"
+ cz.timeStamps.NumberTimeStamps);
String s = IJ
.d2s(
cz.timeStamps.TimeStamps[slice - 1],
2)
+ " s";
ip = stack.getProcessor(slice);
ip.setFont(font);
float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c
.getBlue(), null);
ip.setColor(Color.getHSBColor(255, 255, 255 - hsb[2]));
ip.moveTo(x, y);
ip.drawString(s);
}
} else if ((cz.DimensionTime != 1)
&& (cz.DimensionZ != 1)) {
for (int slicet = 1; slicet <= cz.DimensionTime; slicet++) {
IJ.showStatus("MinMax: " + slicet + "/"
+ cz.DimensionTime);
String s = IJ.d2s(
cz.timeStamps.TimeStamps[slicet - 1],
2)
+ " s";
for (int slicez = 1; slicez <= cz.DimensionZ; slicez++) {
ip = stack
.getProcessor((int) cz.DimensionZ
* (slicet - 1) + slicez);
ip.setFont(font);
float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c
.getBlue(), null);