Login  Register

Re: Adding text "Destructively" to the image

Posted by Graeme Ball-3 on Feb 03, 2016; 3:34pm
URL: http://imagej.273.s1.nabble.com/Adding-text-Destructively-to-the-image-tp5015530p5015531.html

Hi Dave,

For an overlay, I think you can use:
  ImagePlus imp2 = imp.flatten();

Regards,

Graeme

--
---------------------------
Dr. Graeme Ball
Dundee Imaging Facility
College Of Life Sciences
University of Dundee
Dow Street
DD1 5EH
Email: [hidden email]
Phone: +44-1382-385741
---------------------------


On Wed, Feb 3, 2016 at 3:07 PM, davek604 <[hidden email]> wrote:

> Hello
>
> I'm writing a plugin to add text permanently to an image. It forms part of
> a
> loop which moves through an image stack adding numbers (as text) where
> required. I'm using the code below to add the text
>
>                String TheText = Integer.toString(count);
>                 Font font = new Font("SansSerif", Font.PLAIN, 9);
>                 TextRoi roi = new TextRoi(Xval, Yval, TheText, font);
>                 roi.setStrokeColor(Color.white);
>                 Overlay overlay = new Overlay();
>                 overlay.add(roi);
>                 Dupimp.setOverlay(overlay);
>
> This adds the text as an overlay which can't then be made part of the
> image.
> The Draw command will do this but the text would have to be a selection
> which I can't work out how to do. Any suggestions as to how I can make the
> text permanent would be appreciated.
>
> Regards
>
> David
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Adding-text-Destructively-to-the-image-tp5015530.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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