Login  Register

Re: Own Histograms in Imagej

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

Hello Wilhelm,
many thanks for answering.
i don't know, if i understood you the right way, because i am no native english speaker.

My problem is not to calculate the culmulative histogram.
My question is, how to update and display the histogram.
When i tried to use "HistogramWindow hw=new HistogramWindow(img);", i just get the unmodified (not the culmulative) histogram.

Sorry for that stupid questions, but would be nice to get some hints about that.

Many thanks and once again kudos to this book.
Regards from Germany



Burger Wilhelm wrote
The translated text of this assignment is:

----------------------------------
Exercise 4.2. Develop an ImageJ plugin that computes the cumulative histogram of an 8-bit
grayscale image and displays it as a new image, similar to ImageJ's built-in histogram
function available in menu Analyze->Histogram.
----------------------------------

Equ. (4.6) on the same page of the book describes exacly how to compute the cumulative histogram "in place" from a given ordinary histogram, which is obtained in ImageJ by using the ImageProcessor method int[] getHistogram() - as you did already. Don't forget to scale the resulting values appropriately.

Hope this helps -
Wilhelm


W. Burger
www.imagingbook.com



> -----Original Message-----
> From: ImageJ Interest Group [mailto:IMAGEJ@LIST.NIH.GOV] On
> Behalf Of M_a_x
> Sent: Thursday, June 28, 2007 11:13 AM
> To: IMAGEJ@LIST.NIH.GOV
> Subject: Re: Own Histograms in Imagej
>
> 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 :)
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Own-Histograms-in-Imagej-tf3990969.html#
> a11339626
> Sent from the ImageJ mailing list archive at Nabble.com.
>