Macro to visualize ellipse, major and minor axes on objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro to visualize ellipse, major and minor axes on objects

picheral
I would like to visualize the best fitted ellipse and its axes (minor and major) on the object analysed in a vignette. Is there a macro for that ?
Regards
Marc P.

Reply | Threaded
Open this post in threaded view
|

Re: Macro to visualize ellipse, major and minor axes on objects

jmutterer
Marc,

The following macro draws the axes on the elipses image of analyzed objects.
Sincerely,

Jerome.

//Draw axes on objects elipses
run("Blobs (25K)");
run("Make Binary");
run("Set Measurements...", "  min centroid bounding fit shape area_fraction
limit redirect=None decimal=3");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00
show=Ellipses display exclude clear add");
run("RGB Color");
for(i=0; i<nResults; i++) {
    x=getResult('X',i);
    y=getResult('Y',i);
    d=getResult('Major',i);
    a = getResult('Angle',i)*PI/180;
    setColor("blue");
    drawLine(x+(d/2)*cos(a),y-(d/2)*sin(a),x-(d/2)*cos(a),y+(d/2)*sin(a));
    d=getResult('Minor',i);
    a=a+PI/2;
    setColor("red");
    drawLine(x+(d/2)*cos(a),y-(d/2)*sin(a),x-(d/2)*cos(a),y+(d/2)*sin(a));
}
// end


On Thu, Feb 12, 2009 at 6:28 PM, picheral <[hidden email]> wrote:

> I would like to visualize the best fitted ellipse and its axes (minor and
> major) on the object analysed in a vignette. Is there a macro for that ?
> Regards
> Marc P.
>
>
> --
> View this message in context:
> http://n2.nabble.com/Macro-to-visualize-ellipse%2C-major-and-minor-axes-on-objects-tp2316250p2316250.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro to visualize ellipse, major and minor axes on objects

picheral
Thanks a lot !
I will try it tomorrow.
Regards
Marc P.


>
>
>
> Marc,
>
> The following macro draws the axes on the elipses image of analyzed
> objects.
> Sincerely,
>
> Jerome.
>
> //Draw axes on objects elipses
> run("Blobs (25K)");
> run("Make Binary");
> run("Set Measurements...", "  min centroid bounding fit shape
> area_fraction
> limit redirect=None decimal=3");
> run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00
> show=Ellipses display exclude clear add");
> run("RGB Color");
> for(i=0; i<nResults; i++) {
>     x=getResult('X',i);
>     y=getResult('Y',i);
>     d=getResult('Major',i);
>     a = getResult('Angle',i)*PI/180;
>     setColor("blue");
>     drawLine(x+(d/2)*cos(a),y-(d/2)*sin(a),x-(d/2)*cos(a),y+(d/2)*sin(a));
>     d=getResult('Minor',i);
>     a=a+PI/2;
>     setColor("red");
>     drawLine(x+(d/2)*cos(a),y-(d/2)*sin(a),x-(d/2)*cos(a),y+(d/2)*sin(a));
> }
> // end
>
>
> On Thu, Feb 12, 2009 at 6:28 PM, picheral <[hidden email]>
> wrote:
>
>> I would like to visualize the best fitted ellipse and its axes (minor
>> and
>> major) on the object analysed in a vignette. Is there a macro for that ?
>> Regards
>> Marc P.
>>
>>
>> --
>> View this message in context:
>> http://n2.nabble.com/Macro-to-visualize-ellipse%2C-major-and-minor-axes-on-objects-tp2316250p2316250.html
>> Sent from the ImageJ mailing list archive at Nabble.com.
>>
>
>
> ______________________________________
>
> This email is a reply to your post @
> http://n2.nabble.com/Macro-to-visualize-ellipse%2C-major-and-minor-axes-on-objects-tp2316250p2317797.html
> You can reply by email or by visting the link above.
>
>


--
Marc Picheral
Laboratoire d'Oceanologie de Villefranche
CNRS-UPMC
Station Zoologique
Chemin du Lazaret
06234 Villefranche sur mer
Tel: +4 93 76 38 08
Fax: +4 93 76 38 34