Morphometrics macro question

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

Morphometrics macro question

mcpeek
Hi,

I'm new to ImageJ, and looking to solve what I imagine is a simple problem.  I want to take morphometric measurements from pictures on insects, and am looking to automate the process.  What I want to do is open a picture of an insect individual, and then measure the areas of the wings and the lengths of various parts, and then have the measurements written to a file.  I am a very good Java programmer and am looking for some example macros where such tasks have been automated.  

Thanks in advance for any advice and guidance.

Mark
Reply | Threaded
Open this post in threaded view
|

Re: Morphometrics macro question

dscho
Hi,

On Tue, 10 Aug 2010, mcpeek wrote:

> I'm new to ImageJ, and looking to solve what I imagine is a simple
> problem. I want to take morphometric measurements from pictures on
> insects, and am looking to automate the process.  What I want to do is
> open a picture of an insect individual, and then measure the areas of
> the wings and the lengths of various parts, and then have the
> measurements written to a file.  I am a very good Java programmer and am
> looking for some example macros where such tasks have been automated.

It depends how you want the user interface to look like.

Using a macro, you could call the waitForUser(string) function to wait
until a selection has been made (line selection for length measurements,
free hand ROI for the wing areas). You could even use the setTool(tool)
function to switch automatically to the tool appropriate for the next
task.

To measure the area, you can use the getStatistics() function, and for the
length of the line selection, I'd recommend to use the
getSelectionCoordinates() function.

The results, you could put into the results table, as illustrated in this
example: http://rsb.info.nih.gov/ij/macros/SineCosineTable.txt

If you want to do something more specialized (such as intercepting when
the user has selected something, and not requiring a click on the
wait-for-user dialog's OK button), you'll have to use Java. Just make up
your mind what you want, and describe it in a bit more detail.

Ciao,
Johannes