Posted by
federica viti on
May 02, 2008; 2:16pm
URL: http://imagej.273.s1.nabble.com/list-histogram-values-without-GUI-tp3696342p3696346.html
Thank you very much guys!
You are right: actually I found out that the differences I saw in the 2
outputs (through GUI and through macro) have nothing to do with histogram
routine.
They dipend on the previous passage, the plot surface definition (which is
the input for my histogram analysis).
Concerning that, I'm using the following parameters:
"Polygon=100 shade draw smooth"
but the 'draw' parameter refers to 'Draw Wireframe' (which I'm not
interested in), while I can't find around how to indicate 'Draw Axis'.
That implied the difference between the 2 outputs, the one with Draw
Wireframe option set (within the macro) and the one with Draw Axis (manually
chosen thruogh GUI).
Sorry for the mistake, and.. have you go t something to suggest me for
indicating the use of axis in the macro?
Thanks
Federica
On Tue, Apr 29, 2008 at 6:25 PM, Michael Schmid <
[hidden email]>
wrote:
> Hi Federica,
>
> your macro seems to work well - the only difference I see is
> the numbering of the rows:
> ImageJ starts numbering the rows in the "Results" window with 1,
> not 0, so everything is shifted by one.
>
> To avoid this, you could add a column for the value:
>
> getHistogram(values, counts, 256);
> for (row=0; row<256; row++) {
> setResult("Value", row, row);
> setResult("Count", row, counts[row]);
> }
> updateResults();
>
> When saving and reading the results, ignore the first column.
>
> By the way, when testing the macro one easy way to get fooled
> is first running Analyze>Histogram, then running the macro for
> comparison. This will create a histogram of the "Histogram"
> window, not of the original window. So make sure that the
> correct foreground image is selected when running the macro.
>
> Michael
> ________________________________________________________________
>
>
> On 29 Apr 2008, at 14:22, federica viti wrote:
>
> Hi guys,
> > you helped me last time and I hope I'll be lucky also this time..
> >
> > I am working with ImageJ 1.38 without GUI.
> > I want to extract data from the histogram of a surface plot.
> > I tried with the code suggested on line..something like that (the input
> > is
> > the saved Surface Plot):
> >
> > row = 0;
> > getHistogram(values, counts, 256);
> > for (i=0; i<256; i++) {
> > setResult("Count", row, counts[i]);
> > row++;
> > }
> > updateResults();
> > selectWindow("Results");
> > directory="/my/dir";
> > name="myResults";
> > txtPath = directory+name+".txt";
> > save(txtPath);
> >
> > It works, but actually the list of values that I obtain is different
> > from
> > the one that I have in the GUI mode.
> > In the latter mode I apply the 'Histogram' function to the Surface Plot
> > and
> > then I can visualize histogram data clicking on the 'List' option on the
> > histogram window.
> > I'm wondering if I can access to the same list of value, maybe running
> > the
> > 'List' command in NO GUI mode, so that I can obtain in a programmatic
> > way
> > (only running my macro) the list of histogram values that I'm interested
> > into.
> >
> > Hope I've been clear..
> >
> > Thank you,
> > Federica
> >
>