NIH LISTSERV
NIH LISTSERV
IMAGEJ archives -- July 2004 (#29)

Go to: Previous Message | Next Message
Previous in Topic | Next in Topic
Previous by Same Author | Next by Same Author
Previous Page (July 2004) | Back to Main IMAGEJ Page


Options: Reply | Post a New Message | Join or Leave IMAGEJ, or Change Options | Search
View: Chronologically | Most Recent First | Wrap Text (Proportional Font) | Don't Wrap Text (Non-proportional Font)
*

References:  <[log in to unmask]>
Content-Type: text/plain; charset="iso-8859-1"
Message-ID:  <004901c46262$17db46a0$75d96b86@PERICO>
Date:         Mon, 5 Jul 2004 09:31:31 +0200
Reply-To:     Pedro Ramos <[log in to unmask]>
Sender:       ImageJ Interest Group <[log in to unmask]>
From:         Pedro Ramos <[log in to unmask]>
Organization: Max Planck Institute for neurological research
Subject:      Re: Calculating average roundness

The following macro is not the most elegant approach to your problem, but it works. You need a binary image (do Thresholding first) and then run the macro. The system asks you to introduce a minimum value for the circularity and for the perimeter of the particles (particles with a perimeter OR a circularity lower than the specified ones are filtered out) and then it measures area, circularity (roundness??) and perimeter of the remaining particles, displaying the results. If you want to run the macro without introducing the minimum perimeter and circularity any time just replace the lines: permin=getString("minimal perimeter","20"); circmin=getString("minimal circularity","0.8"); by permin=20; circmin=0.8; where you can use any value you like instead of 20 and 0.8. I hope something like this can help you. Cheers, Pedro //Definition of what a particle is (minimal perimeter and circularity) permin=getString("minimal perimeter","20"); circmin=getString("minimal circularity","0.8"); //Main program run("Rename...", "title=image01"); run("Set Measurements...", " circularity perimeter decimal=3"); run("Analyze Particles...", "minimum=1 maximum=1000 bins=0 show=Masks clear record "); for (i=0; i<nResults; i++) { x = getResult('XStart', i); y = getResult('YStart', i); circularity = abs(getResult('Circ.', i)); perimeter = getResult('Perim.', i); if (circularity<circmin || perimeter<permin) { doWand(x,y); run("Clear"); } } selectWindow("Mask of image01"); run("Rename...", "title=image02"); run("Threshold"); run("Set Measurements...", "area perimeter circularity display redirect=None decimal=3"); run("Analyze Particles...", "minimum=1 maximum=1000 bins=0 show=Outlines display summarize"); ------------------------------------------------------ Pedro Ramos Cabrer Max Planck Institute for Neurological Research Gleueler str. 50, 50931 Cologne, Germany [log in to unmask] -------------------------------------------------------




Back to: Top of message | Previous page | Main IMAGEJ page

NIH LISTSERV Home Page

CIT
Center for Information Technology
National Institutes of Health
Bethesda, Maryland 20892
301 594 6248 (v) 301 496 8294 (TDD)
Comments and Assistance
Accessibility wheelchair icon