font size for outline labels

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

font size for outline labels

Simon Hamlet
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.

If thy were larger I would be able to access them from the preview of the
whole scan.
Reply | Threaded
Open this post in threaded view
|

Re: font size for outline labels

Michael Schmid
Hi Simon,

I fear that the user currently can't change that.
Label font and size are hardcoded in line 357 of the
ParticleAnalyzer.java:

drawIP.setFont(new Font("SansSerif", Font.PLAIN, 9));


What you could try as a workaround is take articleAnalyzer.java
from the sources and convert it into an external plugin:
- Rename it (and the class in line 28) to Particle_Analizer
- In Line 1, "replace package ij.plugin.filter;" by
   "import ij.plugin.filter.*;"
Then use "Compile and Run" as with other plugins.

I don't know whether it works with the ParticleAnalyzer, but
for most plugins in ij.plugin.filter this works.

In your plugin, you can use whatever font size you like.


Michael
________________________________________________________________

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.
>
> If thy were larger I would be able to access them from the preview  
> of the
> whole scan.
Reply | Threaded
Open this post in threaded view
|

Re: font size for outline labels

Gabriel Landini
 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<-----------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: font size for outline labels

Justin McGrath
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<-----------------------------------
>