Automation for void space calculation

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

Automation for void space calculation

ben.s.carlson
Hello,

I'm fairly new to ImageJ and I'm hoping some of the more experienced users
can provide me with some advice.

I am currently processing several hundred images.  The idea is to measure
the percentage of void space that is found in dead logs on the forest
floor.  When I come across a log, I cut a cylinder out of it with chainsaw
and take a picture.  The log will either have void space or it will not.
 Either way, I always measure the outer circumference of the log.  If there
 is void space, I then measure the inner circumference of the log (there
can be one or more areas of void space in a log).

I've written a macro to automate most of these steps, however the process
is still pretty manual,.  If anybody has thoughts how I might automate more
of this process I'd really appreciate it.

Here is the macro:

file = "100,100 150+2.9";

open("C:\\Users\\benc\\Documents\\mp\\data\\plot
32\\Photos\\Analyzed\\"+file +".JPG");
run("In [+]");
run("In [+]");
run("In [+]");
setTool("hand");
waitForUser( "Pause","Focus on the ruler");
setTool("line");
waitForUser( "Pause","Draw a line and set scale");
run("Out [-]");
run("Out [-]");
run("Out [-]");
setTool("freehand");

//area of cylinder
waitForUser( "Pause","Draw the cylinder");
run("Add Selection...");
run("To ROI Manager");
roiManager("Show None");
roiManager("Show All with labels");
roiManager("Show All");
roiManager("Show All");
roiManager("Select", 0);
waitForUser( "Pause","Save the ROI: " + file + " cyl.roi");
roiManager("Measure");
roiManager("Select", 0);
roiManager("Delete");

if (getBoolean("Is there void space?")) {
//area of void space
waitForUser( "Pause","Enter the measurement and draw the void space");
 run("Add Selection...");
run("To ROI Manager");
roiManager("Show None");
 roiManager("Show All with labels");
roiManager("Show All");
roiManager("Show All");
 roiManager("Select", 0);
waitForUser( "Pause","Save the ROI: " + file + " void.roi");
 roiManager("Measure");
roiManager("Select", 0);
roiManager("Delete");
}
//cleanup
selectWindow(file+".JPG");
close();

Thank you!

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html