Login  Register

Re: font size for outline labels

Posted by Justin McGrath on Jan 11, 2008; 2:36pm
URL: http://imagej.273.s1.nabble.com/font-size-for-outline-labels-tp3697609p3697612.html

I also use ImageJ to measure leaf area.  I assume you want to see the
fonts so you can record the data.  Why not just add the data to the
results table?  Then you don't have to type anything.

If that's not an option, then this demo macro has many examples of
setting the font: http://rsb.info.nih.gov/ij/macros/TextDemo.txt

Justin

On Jan 11, 2008 5:15 AM, Gabriel Landini <[hidden email]> wrote:

>  On 11 Jan 2008, at 04:34, Simon Hamlet wrote:
> > I am using ImageJ to analyse leaf area. Using 200 dpi A4 scans.
> > Is there a way to have the program return large sized number labels
> > for the outlines when using Analyse Particles.
> >
> > A large part of my processing time is taken up zooming in an
> > getting these numbers.
>
> Maybe you can adapt the following macro and set the font size to do what you
> want.
> Mind the line breaks.
>
> Cheers,
>
> G.
>
> //-----------------------8<-----------------------------------
> // NumberParticles.txt
> // G. Landini
> // Analyses and numbers white or black particles
> // Labels particles at their centre of mass (approx).
> // Requires Particles8_class
> //
> // Do not use this macro with stacks!
>
> requires("1.30e");
> w=getBoolean("White particles?");
>
> if(w){
>   //setThreshold(127,255);
>   run("Particles8 ", "white  show=Particles minimum=0 maximum=999999 display
> overwrite");
>   }
>  else{
>   //setThreshold(0,127);
>   run("Particles8 ", "  show=Particles minimum=0 maximum=999999 display
> overwrite");
> }
>
> run("Duplicate...", "title=Numbered");
>
> selectWindow("Numbered");
> run("RGB Color");
>
> for (i=0; i<nResults; i++) {
>     //x = getResult('XStart', i); // start points
>     //y = getResult('YStart', i);
>
>     x = getResult('XM', i); //centre of mass
>     y = getResult('YM', i);
>
>     setColor(255, 0, 0);
>
>     // approx the centre of mass (never sure how wide & tall the font is)
>     drawString((i+1), x-5, y+5);
> }
> //-----------------------8<-----------------------------------
>