Login  Register

Re: Own Histograms in Imagej

Posted by m_a_x-2 on Jun 28, 2007; 10:12am
URL: http://imagej.273.s1.nabble.com/Own-Histograms-in-Imagej-tp3698964p3698970.html

Hello,
Excuse me, when beeing a pain in the a..., but i can't believe that none of the cracks here is able to answer ma little question below.
I would really appreciate any kind of hint or help .
I it's not possible, would be nice to know as well.
Many thanks in advance
Max

M_a_x wrote
Dear all,
my name is Max and i am from Germany.

I just bought this (http://www.imagingbook.com/) very nice book , authors Burger and Burge.
Found this forum, while looking for an answer to a little exercise where i got stuck.

In the german version it was exercise 4.2., page 52.
I try to translate it correctly:
Exercise was to programm a plugin, which should be displayed in ImageJ after sum calculation.
My  problem is, that i don't know how to update the histogram.
here is the (small) code:


////////////////////begin code:
public class ComputeCulmulatedHistogram_ implements  PlugInFilter{


public int setup(String arg, ImagePlus img){

return DOES_8G+NO_CHANGES;
}


public void run(ImageProcessor ip){

int H[]=ip.getHistogram(); //histogram data of current picture


for(int i=1;i<H.length;i++) //modifa histogram data
{H[i]=H[i]-1+H[i];H[i]=125;
}
}
}

//////////////////////end code


My problem now is how to show the updated histogram.
I would be very grateful, if someone could help me out.

Best Regards from Germany
Max

P.S.: i appologize, if this is too low level for you, but i just started with ImageJ <smiley image='smile.png' text=':)' />