Measuring object angles using ImageJ/Fiji

I had a question posed by a coworker who wanted to identify the rotational orientation of an object. The object was a nucleus, and the orientation was indicated by the position inside of the nucleus of the Golgi. The cell in this case was in one channel, and the golgi was in another. I’ve posted this here as I think it’s a nice example of employing trig for imaging.

Step 1: As an example, I used this file.

Step 2: Separate the channels into R,G and B channels using the Image -> Color -> Split Channels command.

Step3: close the red channel (mitochondrial signal).

Step 4: Threshold the other two channels. Green= Golgi and Blue = Nucleus.

Step 5: perform “particle Analysis” on both images.

Golgi Thresholded – In this example I had too many objects

Step 6. Sort the results via the Centroid X/Y values.

Step 7. Based on the XY coordinates, we can assume in this image that the nearest golgi XY location to a dapi XY location is from the same cell. In the case that this is not true we could employ skeletonizing from the nuclear signal, but that’s for another time. SO: we have these two numbers, how can we figure out orientation?

Basically we can create a right sided triangle, wherein the points of the triangle form the origins and intersection of the two objects (nucleus and golgi) and the third point is the intersection of the two points at 90 degrees.

Step 8: identify the three point positions of a right-side triangle.

– Golgi and nuclear XY points become A XY and B XY

– C X = Nuclear X, C Y = Golgi Y

In some cases we may need to invert numbers in order for this to work, but this can be handled in scripting within excel or fiji if needed.

Step 9: Calculate the length of A to C (adjacent) and C to B (Opposite)

So Adjacent = C(y) – A(y) = 300

Opposite = B(x) – C(x) = 300

Step 10: And now we can use these to find the hypotenuse( )

H = Sqrt((300*300)+(300*300))

H = 424.26

 

So, we finish this up with finding the angle of A (adjacent to hypotenuse angle):

Or arccos(300/424.26)

Or arccos(.707113)

Or .44999

Or basically 045 degrees.

We repeat these steps for every nucleus and golgi, then you have your overall relationship.

Things obviously need to be adjusted based on where the golgi is relative to the nucleus center, but this can be accounted for by performing arguments like

if(x(golgi) < x(nucleus)) {adjust calc accordingly}

Anyways this was fun to work on and I hope it helps your work!

– Austin

 

 

 

 


Posted

in

by

Tags: