Login  Register

Re: how to save the data file from an histogram?

Posted by Carles Rentero-2 on Feb 04, 2011; 1:41pm
URL: http://imagej.273.s1.nabble.com/how-to-save-the-data-file-from-an-histogram-tp3685792p3685793.html

Hi Anthony,
what about something like that?:

        getHistogram(values, counts, nBins);

        d=File.open("Histogram.xls");
        print(d, "Intensity Counts");
        for (k=0; k<nBins; k++) {
                print(d, k+" "+counts[k]);
        }
        File.close(d);

You only have to direct the 'Histogram.xls' file to the folder you want.

I hope it helps. Cheers,
Carles.



--
Carles Rentero, PhD
Dept. de Biologia Cel·lular, Immunologia i Neurociències
Institut d'Investigacions Biomèdiques August Pi i Sunyer (IDIBAPS)
Facultat de Medicina - Hospital Clínic de Barcelona
Universitat de Barcelona (UB)

c/ Casanova, 143
08036 Barcelona
SPAIN

phone: +34 93 227 5400 ext. 3358
FAX: +34 93 402 1907

-----Mensaje original-----
De: ImageJ Interest Group [mailto:[hidden email]] En nombre de Anthony
Combessis
Enviado el: viernes, 04 de febrero de 2011 14:05
Para: [hidden email]
Asunto: how to save the data file from an histogram?

Hi everyone,

I’m actually editing my first ImageJ macro and I have a little problem:

The purpose of my macro is to generate a 1000bins histogram from a 16
bit grey level image, starting from 0 and ending at 65536. Then I would
like to save the results in a file.

The first part of the macro works, IJ shows a window containing the
asked histogram. But I have to click manually on the “List” button and
save the data file. Which command do I have to write in my macro to make
IJ save the results automatically?


Thanks for your help,
best regards

Anthony

--
Anthony COMBESSIS
Doctorant LMOPS
Bat.IUT - Université de Savoie
73376 Le Bourget du Lac
04.79.75.87.61.
[hidden email]
www.lmops.univ-savoie.fr