Re: Fixing the bug of MaximumFinder
Posted by
Rasband, Wayne (NIH/NIMH) [E] on
Sep 09, 2010; 3:23am
URL: http://imagej.273.s1.nabble.com/Fixing-the-bug-of-MaximumFinder-tp3687009p3687011.html
On Sep 8, 2010, at 8:33 PM, Nico Stuurman wrote:
>> 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?
This bug fix is in the v1.44g9 daily build. You can view the changes on the Git repository at
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=imagej.git-wayne