Hi there,
I wanna measure the mean of line with width of w pixels. the line is from point ps to pe. the plugin is like this: Line line = new Line(ps.x, ps.y, pe.x, pe.y); line.setWidth(w); imp.setRoi(line); is = ImageStatistics.getStatistics(ip, Measurements.MEAN+Measurements.AREA, imp.getCalibration()); return is.mean; The result from this plugin is different from the one got from Menu->Analyze->Measure command. Does anyone know why is this? --------------------------------- New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. |
> Hi there,
> I wanna measure the mean of line with width of w pixels. > the line is from point ps to pe. > the plugin is like this: > Line line = new Line(ps.x, ps.y, pe.x, pe.y); > line.setWidth(w); > imp.setRoi(line); > is = ImageStatistics.getStatistics(ip, Measurements.MEAN > +Measurements.AREA, imp.getCalibration()); > return is.mean; > > The result from this plugin is different from the one got from Menu- > >Analyze->Measure command. > > Does anyone know why is this? The getStatistics() method does not work with line selections. Here is how the Measure command (measureLength method in Analyzer class) calculates the mean of the values along the line: ProfilePlot profile = new ProfilePlot(imp); double[] values = profile.getProfile(); ImageProcessor ip2 = new FloatProcessor(values.length, 1, values); ImageStatistics stats = ImageStatistics.getStatistics(ip2, Measurements.MEAN, null); double mean = stats.mean; -wayne |
1. So, what does the result from my code mean then? if it is not the average along the line.
2. the mean from the Measure command is the mean of the whole line, i mean, including all pixels within the width of the line. is it correct? Thanks. Bian Rasband Wayne <[hidden email]> wrote: > Hi there, > I wanna measure the mean of line with width of w pixels. > the line is from point ps to pe. > the plugin is like this: > Line line = new Line(ps.x, ps.y, pe.x, pe.y); > line.setWidth(w); > imp.setRoi(line); > is = ImageStatistics.getStatistics(ip, Measurements.MEAN > +Measurements.AREA, imp.getCalibration()); > return is.mean; > > The result from this plugin is different from the one got from Menu- > >Analyze->Measure command. > > Does anyone know why is this? The getStatistics() method does not work with line selections. Here is how the Measure command (measureLength method in Analyzer class) calculates the mean of the values along the line: ProfilePlot profile = new ProfilePlot(imp); double[] values = profile.getProfile(); ImageProcessor ip2 = new FloatProcessor(values.length, 1, values); ImageStatistics stats = ImageStatistics.getStatistics(ip2, Measurements.MEAN, null); double mean = stats.mean; -wayne --------------------------------- Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2ยข/min with Yahoo! Messenger with Voice. |
In reply to this post by Ben Liu-3
Would someone use morena & twain plugin to acquire with a scanner ?
It crashes on both macosX and XP with latest imageJ? Could someone know about this bug ? Ronan. |
I have a small stack (~6 frames) of RGB fluroescent images that I tried the
Extended Depth of Field pluggin on. I used the 'Easy Mode'. In the initial pass, I used the 'Fast' setting' on the quality slider and got a rapid result. I then cranked the slider up to 'high' quality and repeated the run. The progress bar showed one bar and did not progress from there over the next 30 min. I got a couple more bars on the medium setting and then it seemed to not progress. At this point, I increased ImgagJ memory (from I think 300 Mb) to 1000 Mb and the medium setting worked like a charm. The high setting seemed still to stall out, but I think I got more than 1 bar on the progress indicator before it stalled. When it stalls there is no indicator, and the memory shown by the Extended Depth of Field Plugin shows higher numbers than the memory monitor for ImageJ. On 'medium high' it progressed to 7 completion bars with 1000 Mb of memory for ImageJ, the plugin reports using ~300 mb and this number continues to fluxuate, but the ImageJ memory monitor claims only 78 Mb (7%) and this number also fluxuates. First am I correct that it is really stalled? If so, this leads to some additional questions: 1. When I increased ImageJ memory to 1699Mb it would no longer start the Java machine so I guess this is a limitation. The memory dialog seems to suggest ImageJ start-up will be okay up until 1700 Mb. What exactly is the memory limit for ImageJ or is it OS and machine dependent? 2. Is there a way to figure out how much memory is required for the extended depth of field plug-in? Am I right that it is stalled when the progress bar doesn't move for an hour or so (given that the intial bars appeared in well less than a minute)? Are there any suggestions for using the Expert Mode to avoid this 'stall phenomenon' and still get an idea of what the 'high quality' rendering looks like. 3. Finally, the stack slider disappears during the process, so if I cancel the plug-in the image has no slider. If I duplicate the stack, the duplicate stack has a slider again. Any idea what is going on here? Is this a plug-in issue or an ImageJ issue. Machine: 2.4 GHz Pentium 4 CPU with 1Gb memory. Windows XP Java 1.5.0_06b05 ImageJ 1.36b Current config file: C:\PROGRA~1\ImageJ\ C:\Program Files\Java\jre1.5.0_06\bin\javaw.exe -Xmx1000m -cp ij.jar;C:\PROGRA~1\ImageJ\ij.jar ij.ImageJ Thanks for any insights, Rob Baer |
Rob,
Have you tried just using a maximum projection on these images? Works pretty good for fluor images. Mike On Apr 28, 2006, at 11:35 AM, Robert W. Baer, Ph.D. wrote: > I have a small stack (~6 frames) of RGB fluroescent images that I > tried the Extended Depth of Field pluggin on. I used the 'Easy > Mode'. In the initial pass, I used the 'Fast' setting' on the > quality slider and got a rapid result. > > I then cranked the slider up to 'high' quality and repeated the > run. The progress bar showed one bar and did not progress from > there over the next 30 min. I got a couple more bars on the medium > setting and then it seemed to not progress. At this point, I > increased ImgagJ memory (from I think 300 Mb) to 1000 Mb and the > medium setting worked like a charm. The high setting seemed still > to stall out, but I think I got more than 1 bar on the progress > indicator before it stalled. When it stalls there is no indicator, > and the memory shown by the Extended Depth of Field Plugin shows > higher numbers than the memory monitor for ImageJ. On 'medium > high' it progressed to 7 completion bars with 1000 Mb of memory for > ImageJ, the plugin reports using ~300 mb and this number continues > to fluxuate, but the ImageJ memory monitor claims only 78 Mb (7%) > and this number also fluxuates. > > First am I correct that it is really stalled? If so, this leads to > some additional questions: > > 1. When I increased ImageJ memory to 1699Mb it would no longer > start the Java machine so I guess this is a limitation. The memory > dialog seems to suggest ImageJ start-up will be okay up until 1700 > Mb. What exactly is the memory limit for ImageJ or is it OS and > machine dependent? > > 2. Is there a way to figure out how much memory is required for > the extended depth of field plug-in? Am I right that it is stalled > when the progress bar doesn't move for an hour or so (given that > the intial bars appeared in well less than a minute)? Are there > any suggestions for using the Expert Mode to avoid this 'stall > phenomenon' and still get an idea of what the 'high quality' > rendering looks like. > > 3. Finally, the stack slider disappears during the process, so if > I cancel the plug-in the image has no slider. If I duplicate the > stack, the duplicate stack has a slider again. Any idea what is > going on here? Is this a plug-in issue or an ImageJ issue. > > Machine: 2.4 GHz Pentium 4 CPU with 1Gb memory. Windows XP Java > 1.5.0_06b05 ImageJ 1.36b > Current config file: > C:\PROGRA~1\ImageJ\ > C:\Program Files\Java\jre1.5.0_06\bin\javaw.exe > -Xmx1000m -cp ij.jar;C:\PROGRA~1\ImageJ\ij.jar ij.ImageJ > > > Thanks for any insights, > Rob Baer Michael J. Herron, U of MN, Dept. of Entomology [hidden email] 612-624-3688 (office) 612-625-5299 (FAX) |
In reply to this post by Ronan BOURGEOIS
Ronan BOURGEOIS wrote:
> Would someone use morena & twain plugin to acquire with a scanner ? > It crashes on both macosX and XP with latest imageJ? > > Could someone know about this bug ? > > Ronan. Hi Ronan, Trying to reuse an "old" ccd camera(with twain capabilities), I was unable to use morena on a PIV/win2k/sdk-1.5.05. Could not even grab an image using any demo code included with morena. I read this tutorial by "javajeff" Friesen http://today.java.net/pub/a/today/2004/11/18/twain.html http://today.java.net/pub/a/today/2005/01/25/twain.html http://today.java.net/pub/a/today/2005/04/11/twain.html which I found really interesting, but I had the same kind of JVM crash with the same set-up. The funny thing is I could acquire images with IrfanView/twain, and on top of that, I tried the sample code included in javajeff's tutorial on another PC, with an old scanner (cheap usb scanner from canon) and it worked perfectly. This will certainly not solve your problem quickly but you might want to have a look at Jeff's tutorial (mostly the sample code). If this works it would be possible to modify the ImageJ plugin to use Jeff's library instead of Morena. seb |
Free forum by Nabble | Edit this page |