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=':)' /> |
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
|
In reply to this post by m_a_x-2
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:[hidden email]] On > Behalf Of M_a_x > Sent: Thursday, June 28, 2007 11:13 AM > To: [hidden email] > 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. > |
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
|
In reply to this post by m_a_x-2
The group may get bored to death if we keep discussing this here - I'll send you some hints on this assignment (in German) -
Wilhelm > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On > Behalf Of M_a_x > Sent: Thursday, June 28, 2007 1:24 PM > To: [hidden email] > Subject: Re: Own Histograms in Imagej > > 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 > > > |
Of cause it is not my intention to bore anyone to death with my stupid beginner questions.
and many, many thanks to Wilhelm, who kept the promise to help me already. Regards from Germany Max
|
In reply to this post by Burger Wilhelm
Hi,
Apologies for the unspecific subject, but, it was hard to be both descriptive & brief enough. At NIWA (where I work) we are using ImageJ to derive data describing the contents of seabed (benthic) photos. The data captured includes scaling of images (real world coverage), categorising of images, as well as recording taxa & substrate information (numbers of points or no & %area for areas) describing the photo content. This is pretty much a manual process, with various taxonomists, biologists & geologists providing input. The plugin is essentially a single window allowing all these data to be captured easily & quickly, in a session based approach. All data, including ROI's, are written to, stored in & retrieved from a Postgres (PostGIS) database. Image data can be linked to image location data in the database, so that (using PostGIS to manage the location) data can easily be queried spatially & mapped using a wide range of FOSS GIS & web mapping tools. It is nearing completion, with final tweaking/bug fixing/user trials being carried out. While our intended use is primarily seabed oriented, the application would be just as useful for terrestrial work using aerial or satellite photos. We are still in the final testing stage for our users, but it should soon be possible to make copies available to others interested in using or testing it. Note that we do plan on making it publicly available. If anyone is interested in using this application, especially if they are willing to help with the final debugging, testing & documenting processes, please let me know. Cheers, Brent Wood |
Free forum by Nabble | Edit this page |