Re: Help requested for finding 3D local maxima

Posted by David Webster on
URL: http://imagej.273.s1.nabble.com/Help-requested-for-finding-3D-local-maxima-tp3691210p3691214.html

Thomas,

I tried jni3d_.class. It is much faster. I ran your script with a few mods
as there were some name differences. Here it is


xr=5; yr=5; zr=5;
rename("stack");
// this may have changed fro mthe version o nthe internet ;-)
//run("3D Filters", "filter=Maximum radius_x=5 radius_y=5 radius_z=5");
// Note space after jni3d
run("jni3d ", "filter=Maximum radius_x=xr radius_y=yr radius_z=zr");
imageCalculator("Difference create stack", "stack","3D Maximum");
run("Invert", "stack");
//run("Set 3D Measurements", "  centroid mean_gray_value dots_size=16
font_size=10
store_results_within_a_table_named_after_the_image_(macro_friendly)
redirect_to=stack");
run("Set Measurements", "  centroid mean_gray_value dots_size=16
font_size=10
store_results_within_a_table_named_after_the_image_(macro_friendly)
redirect_to=stack");
//run("3D Objects Counter...", "threshold=255 slice=13 min.=1 max.=1134972
exclude_objects_on_edges statistics");
run("3D object counter...", "threshold=255 slice=13 min.=1 max.=1134972
exclude_objects_on_edges statistics");
David Webster

On Thu, Sep 10, 2009 at 7:14 AM, Thomas Boudier <
[hidden email]> wrote:

> Hi,
>
> I know this plugin is not very fast, but you can use the maximum filter in
> my fast JNI filter and compute the difference between the original and max
> filtered image, a max local should then be at zero in this difference image.
> Here a small macro that uses 3D object counter to detect the max local
> pixels and display their coordinates :
>
> rename("stack");
> // this may have changed fro mthe version o nthe internet ;-)
> run("3D Filters", "filter=Maximum radius_x=5 radius_y=5 radius_z=5");
> imageCalculator("Difference create stack", "stack","3D Maximum");
> run("Invert", "stack");
> run("Set 3D Measurements", "  centroid mean_gray_value dots_size=16
> font_size=10
> store_results_within_a_table_named_after_the_image_(macro_friendly)
> redirect_to=stack");
> run("3D Objects Counter...", "threshold=255 slice=13 min.=1 max.=1134972
> exclude_objects_on_edges statistics");
>
> The 3D filters in fiji are nice and fast, but it looks like they work on a
> 3x3x3 cube, I personally prefer to work with spheres.
>
> best,
>
>
> Thomas
>
>
>
> David Webster a écrit :
>
> All,
>>
>> These functions seem to be real slow. You might want to try Fiji's
>> Plugins/Process/Maximum (3D), if a 3x3 local neighborhood for defining the
>> local max is OK.
>> Also, this seems to only filter an image, so does not return a list of
>> points. You may need to write a macro or a plugin to do this if something
>> doesn't exist already.
>>
>> David Webster
>> On Mon, Sep 7, 2009 at 3:20 AM, Thomas Boudier <
>> [hidden email]> wrote:
>>
>> Hi,
>>>
>>> You can have a look to these plugins :
>>>
>>>
>>> http://imagejdocu.tudor.lu/doku.php?id=plugin:morphology:3d_binary_morphological_filters:start
>>>
>>> Best,
>>>
>>> Thomas
>>>
>>>
>>> Brad Busse a écrit :
>>>
>>> Hey all,
>>>>
>>>> I'd like to give imagej (or a plugin therein) a volume and an ideal
>>>> radius
>>>> and have it spit out where the 3D local maxima are.  The task is similar
>>>> to
>>>> what "Process->Filters->Maximum..." already does in 2D, except I'm only
>>>> interested in the maxima locations (so single points or a point list
>>>> would
>>>> be ideal).  I figure there must be a plugin that does exactly this, but
>>>> I'm
>>>> at a loss for finding it.  Anyone have any ideas?
>>>>
>>>> Thanks!
>>>> Brad
>>>>
>>>>
>>>>
>>>> --
>>>  /**********************************************************/
>>>    Thomas Boudier, MCU Université Pierre et Marie Curie,
>>>    IFR 83. Bat B 7ème étage, porte 709, Jussieu.
>>>    Tel : 01 44 27 20 11  Fax : 01 44 27 22 91
>>> /*******************************************************/
>>>
>>>
>>
>>
> --
>  /**********************************************************/
>     Thomas Boudier, MCU Université Pierre et Marie Curie,
>     IFR 83. Bat B 7ème étage, porte 709, Jussieu.
>     Tel : 01 44 27 20 11  Fax : 01 44 27 22 91
> /*******************************************************/
>