Login  Register

Re: help with 3D segmentation - update

Posted by Aryeh Weiss on Nov 13, 2015; 10:32am
URL: http://imagej.273.s1.nabble.com/help-with-3D-segmentation-tp5014798p5014944.html

Hi Jan

First of all, a belated thank you for this reply -- it exactly answered
my question (and more).

On 09/11/2015 9:40 PM, Jan Eglinger wrote:

> Hi Aryeh,
>
> On 08.11.15 08:10, Aryeh Weiss wrote:
>> Further on my adventures using the DoG function:
>>
>> I mentioned that the DoGPeaks function appears to find minima as well as
>> maxima. I decided to go to the Difference of Gaussian function
>> http://javadoc.imagej.net/Fiji/mpicbg/imglib/algorithm/scalespace/DifferenceOfGaussian.html#DifferenceOfGaussian(mpicbg.imglib.image.Image,%20mpicbg.imglib.image.ImageFactory,%20mpicbg.imglib.function.Converter,%20mpicbg.imglib.outofbounds.OutOfBoundsStrategyFactory,%20double[],%20double[],%20B,%20B)
>>
>>
>> Here I see that it explicitly states that it extracts local minima and
>> maxima of a certain size. I wonder if I can get only the maxima fro this
>> function.
>
> You have to go one step further: the `DifferenceOfGaussian` class has
> a `findPeaks` method that gives you a list of
> `DifferenceOfGaussianPeak`s.
>
> In its Javadoc [1] you find the methods:
>     boolean isMin()
>     boolean isMax()
> that you can use to differentiate between minima and maxima.
>
> I modified your script to only get the maxima:
> https://gist.github.com/imagejan/7cc228b9a5e57cce44a0
>

Works well. I had to make a minor correction at lines 40 and 41
The if statement is not properly indented.

for p in peaks:
if p.isMin():
     maxima.append(p)

should be

for p in peaks:
     if p.isMin():
         maxima.append(p)

(sorry -- I do not yet know how to fix this in github.)
>
>
> PS: Let's continue the discussion on the ImageJ forum, it's much
> easier to read conversations and code there: http://forum.imagej.net/
>
>
I signed into the forum, but I still dont know how to use it. (Sorry --
I just have no social media experience...)
I checked the option to have it send me email, but so far I have not
seen anything from it, so maybe I did not do that correctly.

Best regards,
--aryeh

--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html