|
Hi,
On Mon, 21 Aug 2006, Abhijit Bugde wrote:
> I have recorded z-stacks and I need to measure angles of the dividing
> cells wrt tubules which are near the cells going thorough the entire z-
> stack.
If you want to measure angles by selecting 3 points (where the middle
point is the vertex), try this tool (you need to install it with
Plugins/Macros/Install):
-- snip --
requires("1.34h");
var angle_coords = newArray(9);
var angle_index = 0;
macro '3D Angle Tool - C111L0fb4L0fffLafacL9b9aD89L0011L1102L0213L1304L4233L3344L5054' {
requires("1.37c");
getCursorLoc(x, y, z, flags);
angle_coords[angle_index++] = x;
angle_coords[angle_index++] = y;
angle_coords[angle_index++] = z;
if (angle_index == 3)
showStatus("selected first end point: " + x + ", " + y + ", " + z);
else if (angle_index == 6)
showStatus("selected vertex: " + x + ", " + y + ", " + z);
else {
angle_coords[3] -= angle_coords[0];
angle_coords[4] -= angle_coords[1];
angle_coords[5] -= angle_coords[2];
angle_coords[6] -= angle_coords[0];
angle_coords[7] -= angle_coords[1];
angle_coords[8] -= angle_coords[2];
// scalar product
product = angle_coords[3] * angle_coords[6]
+ angle_coords[4] * angle_coords[7]
+ angle_coords[5] * angle_coords[8];
length1 = sqrt(angle_coords[3] * angle_coords[3]
+ angle_coords[4] * angle_coords[4]
+ angle_coords[5] * angle_coords[5]);
length2 = sqrt(angle_coords[6] * angle_coords[6]
+ angle_coords[7] * angle_coords[7]
+ angle_coords[8] * angle_coords[8]);
degrees = acos(product / length1 / length2) * 45 / atan(1);
showStatus("3d angle is " + degrees + " degrees");
angle_index = 0;
}
}
-- snap --
Ciao,
Dscho
|