Re: New user of ImageJ has a question about inserting text on an image.

Posted by Christopher Coulon-2 on
URL: http://imagej.273.s1.nabble.com/New-user-of-ImageJ-has-a-question-about-inserting-text-on-an-image-tp5004002p5004010.html

> Hello Everyone,
>     I am new to this forum and new to using imageJ.  I can see it is a great program that has an infinite range of usage.  However, I just need to know how to post text on an imagine that is vertical instead of horizontal.  I know how to place a text on the image, I would just like to have that text vertical.  If there is a script I can write would someone out there help me with writing that script.  I am very new to everything so be gentle on me.  
>
> Thank you,
>
> Barry Stephens

Barry,

Here is one workaround:

        origIm = getImageID();
       
        run("Colors...", "foreground=black background=white selection=yellow");
        setTool("text");
        setFont("SansSerif", 18, " antialiased");
       
        ID = getImageID();
        title = "Type text";
        msg = "Type your text in the image\nthen click \"OK\".";
        waitForUser(title, msg);
        selectImage(ID);  
       
        run("Draw");
        run("Duplicate...", "title=[temp]");
        selectWindow("text test");
        run("Clear", "slice");
        run("Select None");
        selectWindow("temp");
        run("Rotate 90 Degrees Right");
        run("Select All");
        run("Copy");
        close();
        selectWindow("text test");
        run("Paste");

This can be adapted to your special needs for arbitrary rotation, adjustment of text style and size, etc.  

Chris Coulon





Christopher Coulon, Ph.D.
The GAIA Group
http://gaiag.net




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

PastedGraphic-2.tiff (114K) Download Attachment