What is the "origin" of the polar transformation?

#1

Hi there,
I use the polar transform to “unwrap” a ring and then calculate its minimum thickness (on the unwrapped image), as explained in this discussion.

The result of the polar transform of the ring is showed on the right image below, while on the left is the initial image.

What I am trying to do now is to find what radius (on the initial image) was the one with the minimum thickness: thanks to the polar transform I know what is the angle with the minimum thickness, but what is the “origin” from which the polar transform measures the angles?
In other words, if - for example - I find out that the minimum thickness is at degree 45, the degree 45 (in the original image) is the one designed in the image below?

Any suggestion is appreciated.
Regards,
gio

#2

Gio,

we had that discussion already. In fact you have to set the origin in the plugin dialog.

The question remains: How to choose the origin and I’ve proposed two methods yet in a previous thread.

[…] if - for example - I find out that the minimum thickness is at degree 45, the degree 45 (in the original image) is the one designed in the image below?

It refers to the chosen center.

Regards

Herbie

#3

Hi @Herbie,
the center is the center of mass calculated as follows:

``````run("Set Measurements...", "center redirect=None decimal=3");
List.setMeasurements;
x = List.getValue("XM");
y = List.getValue("YM");
``````

But maybe I was not very clear with my question: I did not mean the origin of the axises, I meant where is the angle 0? I assume that the angle 0 is the same as the x axis and that the angles go anticlockwise, so if this is the case the angle 45 is the one I drew on the image.
I hope now the question is clearer.
Regards,
gio

#4

Gio,

it’s really easy to find out because you simply have to put a marker …

The angle starts with zero in the x-positive direction and proceeds clockwise, i.e. in the negative mathematical sense.

However, this question has nothing to do with the center of the transformation.

Regards

Herbie

#5

This depends on the plugin options. I suppose you’re using this plugin (?):
https://imagej.net/plugins/polar-transformer.html

As Herbie said, you can test it with any non-symmetrical image, e.g. by running these two lines of macro:

``````newImage("Untitled", "8-bit ramp", 100, 100, 1);
run("Polar Transformer", "method=Polar degrees=360 default_center for_polar_transforms,");
``````

… showing that the 0 degrees (or 360 degrees) angle is oriented horizontally to the right of your original image.

Whether the direction proceed clockwise or anti-clockwise is determined by the Clock-wise rotation option of the plugin.

To test its effect, you can modify the two lines above by adding a small rectangular marker:

``````newImage("Untitled", "8-bit ramp", 100, 100, 1);
setForegroundColor(255, 255, 255);
drawRect(70, 20, 10, 10);
run("Polar Transformer", "method=Polar degrees=360 default_center for_polar_transforms,");
``````

Original:

Transformed:

I have to say that I’d have expected the opposite (i.e. mirrored) result when not having selected the Clock-wise rotation option, but that’s how the plugin behaves…

#6

Good day Jan,

as you may have noticed, this thread actually refers to some earlier threads and in one of them I’ve posted a macro for a whole processing sequence.

My explanation above refers to the processing with this macro …

Best

Herbie

#7

Thanks for clarifying.

#8

Thank you all guys for the suggestions and explanations!