Hi Fred,

you are missing an
  imp.repaintWindow();
after setting the slice label.

Without this, for some reason that I don't understand the old subtitle line sometimes sticks. Maybe a Java bug (Java 1.8.0_345 under Linux)

Michael
________________________________________________________________
On 02.06.24 04:41, Fred Damen wrote:
Greetings,

Perform File/New/Image...
then run below plugin. The slice label does not change, albeit when
zooming in the slice label is display garbled. Duplicating this image
displays a correct slice label. Performing Image/Stack/Tools/SetLabel
shows the correct label.

Fred


import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;
import ij.plugin.frame.*;

public class TestSetSliceLabel implements PlugIn {

    public void run(String arg) {
       ImagePlus imp = IJ.getImage();
       imp.show();
       imp.getStack().setSliceLabel("p=1\\n",1);
       }

}

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Reply via email to