Search code examples
imagejimagej-macro

ImageJ export list of histogram data


I'm trying to record a macro on ImageJ. I found this post

http://imagej.1557.x6.nabble.com/Saving-histogram-list-to-Excel-file-td3682144.html

which is similar to what I want to do but it refers to RGB channel. How can i export the histogram of gray levels and not of single RGB channels?


Solution

  • You can record all actions in the ImageJ macro recorder to get the right commands:

    https://imagej.nih.gov/ij/docs/guide/146-31.html#sub:Record...

    http://imagej.net/Introduction_into_Macro_Programming

    Here an recorded Windows histogram example how to save the results of a histogram (change the file path and execute this code as an ImageJ macro!):

    run("Blobs (25K)");
    run("Histogram");
    saveAs("Results", "C:\\Users\\xxx\\Histogram of blobs.csv");