Posted by
Jan Eglinger on
Nov 09, 2015; 7:32pm
URL: http://imagej.273.s1.nabble.com/help-with-3D-segmentation-tp5014798p5014900.html
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/7cc228b9a5e57cce44a0Here's what I changed:
https://gist.github.com/imagejan/7cc228b9a5e57cce44a0/revisions> On 05/11/2015 12:58 PM, Aryeh Weiss wrote:
>> 1. Albert Cardona suggested trying the 3D (actually multi-D) difference
>> of Gaussians (DoG) filter. This looks promising, plus it introduced me
>> to imglib.
Albert's excellent tutorials unfortunately make use of the
now-deprecated ImgLib1 code that was superseded by ImgLib2 [2].
Jean-Yves Tinevez's TrackMate plugin is a great example how to use
ImgLib2. It's `LogDetector` [3] and `DogDetector` [4] classes show how
to detect spots using ImgLib2 implementations of LoG and DoG.
I added a script to the ImageJ wiki illustrating how to use
`DogDetector` from a Python script:
http://imagej.net/Jython_Scripting#Find_peaks_in_a_3D_imageHope that helps,
Jan
PS: Let's continue the discussion on the ImageJ forum, it's much easier
to read conversations and code there:
http://forum.imagej.net/[1]:
http://javadoc.imagej.net/Fiji/index.html?mpicbg/imglib/algorithm/scalespace/DifferenceOfGaussianPeak.html[2]:
https://github.com/imglib[3]:
https://github.com/fiji/TrackMate/blob/master/src/main/java/fiji/plugin/trackmate/detection/LogDetector.java#L95-L152[4]:
https://github.com/fiji/TrackMate/blob/master/src/main/java/fiji/plugin/trackmate/detection/DogDetector.java#L40-L105--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html