Re: Fixing the bug of MaximumFinder
Posted by
Nico Stuurman-4 on
Sep 09, 2010; 12:33am
URL: http://imagej.273.s1.nabble.com/Fixing-the-bug-of-MaximumFinder-tp3687009p3687010.html
> I am writing a plugin and I want to use the findMaxima method in class
> MaximumFinder. However when the method finMaxima was called with outputType
> equaled List or Count. There was nothing appeared on the result table.
I just run into the same problem. Not sure why this happens as the MaximumFinder tries to get hold of the ResultsTable through the static method
ResultsTable rt = ResultsTable.getResultsTable();
which calls the static method
Analyzer.getResultsTable();
However, as a work around, you can run the MaximumFinder as follows:
IJ.run("Find Maxima...", "noise=50 output=List");
> Here is a example code:
>
> public class demo_findmax implements PlugIn {
>
> public void run(String arg) {
> ByteProcessor bp = new ByteProcessor(10,10);
> bp.putPixel(3, 4, 255);
> bp.putPixel(7, 8, 255);
> new ImagePlus("test", bp).show();
>
> MaximumFinder fd=new MaximumFinder();
>
> ByteProcessor fdB = fd.findMaxima(bp, 50,
> ImageProcessor.NO_THRESHOLD, 4, false, false);
>
> }
>
> }
>
> So I tried to look into the source code of MaximumFinder.java and did some
> modification to fix the problem. I am wondering if this modified
> MaximumFinder would be usable for the future ImageJ build.
> If so how should I do it ? Should I post the code here or upload it to
> somewhere ?
Curious what you found. Can you post the relevant snippets?
Best,
Nico