bar graphs

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

bar graphs

Hui Wang-6
Does anyone know if there's any macro that plots bar
graphs? I'm using the "Plot.add" macro right now. It
doesn't have "bars" as an option for the first
argument. Any help will be greatly appreciated.

Hui Wang
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Gabriel Landini
On Monday 03 December 2007 17:23:29 Hui Wang wrote:
> Does anyone know if there's any macro that plots bar
> graphs? I'm using the "Plot.add" macro right now. It
> doesn't have "bars" as an option for the first
> argument. Any help will be greatly appreciated.

Have a look at the code related to the command "Analyze>Distribution".
It converts the data into an image and uses the histogram to display it as a
bar graph.

Cheers,
G.
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Gluender
In reply to this post by Hui Wang-6
>Does anyone know if there's any macro that plots bar
>graphs? I'm using the "Plot.add" macro right now. It
>doesn't have "bars" as an option for the first
>argument. Any help will be greatly appreciated.
>
>Hui Wang

Dear Hui Wang,

please realize that ImageJ is an image processing software.

You may export your data to one of the many programs for data
analysis -- maybe Excel.

Best
--


                   Herbie

          ------------------------

          <http://www.gluender.de>
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Hui Wang-6
Herbie,

Thanks for reminding me. I guess it's just my habit
that as a former Matlab user I'd like to generate nice
graphs within the same application where my image
analysis is done.

Hui

--- Gluender <[hidden email]> wrote:

> >Does anyone know if there's any macro that plots
> bar
> >graphs? I'm using the "Plot.add" macro right now.
> It
> >doesn't have "bars" as an option for the first
> >argument. Any help will be greatly appreciated.
> >
> >Hui Wang
>
> Dear Hui Wang,
>
> please realize that ImageJ is an image processing
> software.
>
> You may export your data to one of the many programs
> for data
> analysis -- maybe Excel.
>
> Best
> --
>
>
>                    Herbie
>
>           ------------------------
>
>           <http://www.gluender.de>
>
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Ben G
I have a (hopefully) related question, so here goes:

I am trying to learn how to call the Analyze/Distribution commands from inside a macro.
I am going through a stack of images with the measure command, which generates a Results window.  

I then execute the Analyze/Distribution command which takes the list in the Results window and displays a histogram of values in a Mean Distribution window.  Clicking on the List command shows a second window named Mean Distribution with bins and counts.  I need the second number in the "bin start" column to use as a threshold in other calculations.

So far, I have figured out how use run("...) commands to get all the way to showing the first Mean Distribution window, but I can't get it to show the List Window, or get any values out of the list.

I tried recording a macro and walking through the steps, but it doesn't record the commands either.  So far, the record function is the only systematic way I have of finding internal commands.  Otherwise I just have to trip over them in other example macros.

I would appreciate any help.
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Gabriel Landini
On Wednesday 27 August 2008, Ben G wrote:

> I have a (hopefully) related question, so here goes:
>
> I am trying to learn how to call the Analyze/Distribution commands from
> inside a macro.
> I am going through a stack of images with the measure command, which
> generates a Results window.
>
> I then execute the Analyze/Distribution command which takes the list in the
> Results window and displays a histogram of values in a Mean Distribution
> window.  Clicking on the List command shows a second window named Mean
> Distribution with bins and counts.  I need the second number in the "bin
> start" column to use as a threshold in other calculations.
>
> So far, I have figured out how use run("...) commands to get all the way to
> showing the first Mean Distribution window, but I can't get it to show the
> List Window, or get any values out of the list.
>
> I tried recording a macro and walking through the steps, but it doesn't
> record the commands either.  So far, the record function is the only
> systematic way I have of finding internal commands.  Otherwise I just have
> to trip over them in other example macros.
>
> I would appreciate any help.

I do not think that there is a way to simulate pressing the "List" button to
then save the contents of the 2nd table, but you can have a look at the
/source/ij/plugin/Distribution.java where all the distribution calculations
are done and reimplement it in your macro.

Wayne mentioned recently the need of a Plot.getValues(xvalues, yvalues) macro
command, but as far as I know that is not implemented yet.

G.
Reply | Threaded
Open this post in threaded view
|

Re: bar graphs

Wayne Rasband
In reply to this post by Ben G
> I have a (hopefully) related question, so here goes:
>
> I am trying to learn how to call the Analyze/Distribution commands from
> inside a macro.
> I am going through a stack of images with the measure command, which
> generates a Results window.
>
> I then execute the Analyze/Distribution command which takes the list
> in the
> Results window and displays a histogram of values in a Mean
> Distribution
> window.  Clicking on the List command shows a second window named Mean
> Distribution with bins and counts.  I need the second number in the
> "bin
> start" column to use as a threshold in other calculations.
>
> So far, I have figured out how use run("...) commands to get all the
> way to
> showing the first Mean Distribution window, but I can't get it to show
> the
> List Window, or get any values out of the list.
>
> I tried recording a macro and walking through the steps, but it doesn't
> record the commands either.  So far, the record function is the only
> systematic way I have of finding internal commands.  Otherwise I just
> have
> to trip over them in other example macros.

The ImageJ 1.41k daily build adds a Plot.getValues() macro function
that retrieves the X and Y values from plot and histogram windows. Here
is an example:

    run("Blobs (25K)");
    setAutoThreshold();
    run("Analyze Particles...", "size=0 circularity=0.00 clear");
    run("Distribution...", "parameter=Area automatic");
    Plot.getValues(x, y);
    for (i=0; i<x.length; i++)
        print(x[i], y[i]);

-wayne