Macro not inverting coordinates

I need to draw a horizontal line at a particular point on the y-axis calculated from a line tracing made on the image with an inverted y-axis BUT the macro will only draw the line as if the y axis isn’t inverted

Super simple Macro:
z=y - 0.25*y
makeLine(1, z, x, z);
setForegroundColor(255, 44, 255);

This draws the line at ‘z’ from the top, not the bottom (even though the invert y-axis box is ticked). Can I invert the axis in the macro? I feel that should be easy but can’t seem to make it work. Am I missing something?

I’ve searched through the archives and this thread seems relevant:

but can’t find the ImageJ daily build (1.51d1) referred to (in fact, a Google search pulls up that thread as the ONLY hit in the web existence!!)


Good day Murray,

why bother with coordinate inversion, just compute the desired position…

h = getHeight();
z = h - yourY;

Please check for missing semicolons in your macro code!

Concerning the version of ImageJ, you should always use the latest which presently is 1.51k.