Login  Register

Re: x y coords of anchor points on segmented line

Posted by Volker Baecker on Apr 02, 2015; 12:07pm
URL: http://imagej.273.s1.nabble.com/x-y-coords-of-anchor-points-on-segmented-line-tp5012312p5012321.html

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Tobias
does the macro below do what you want?

Roi.getSplineAnchors(xx, yy);
height = getHeight();
print("\\Clear");
result = "";
for(i=0; i<xx.length; i++) {
        result += "" + xx[i] + " " + (height - yy[i]);
        if (i<xx.length - 1) result += ", ";
}
print(result);

Volker

Tobias Baskin:

> Volker, Thank you again. I downloaded the latest version and now
> the ROI.getSplineAnchors runs. Yay! (in the latest version, the
> ROI.getCoordinates returns points every pixel, not just the
> anchors). But it happens that the software that I feed the
> coordinates into needs the y-axis coordinate inverted, and the
> returned y-values are not inverted. I have the 'invert Y
> coordinate' checked in the set measurements options but I suppose
> that the ROI command is not a measure command and hence oblivious
> to that. Is there a command to add to the macro that will invert
> the y values? Also, is there syntax to have the data come out as x
> y, x y, x y, rather than x x x, y y y? That would be quite helpful.
> I totally appreciate your time here! Many thanks, Tobias
>
>

-----BEGIN PGP SIGNATURE-----

iQEcBAEBCgAGBQJVHTEeAAoJENcVU956o58NuvIH/1uwNMmyQymbGKczfbqmALM/
DPIhbQJY2Wb509OVCQ3+dO5PtqOGVx50X8pJDzN4S9dEo4NFXE7g5rvQx4dmXpCY
mcwHYYlM4bZ5b/a2xqUssUp2XKrBiLLZ5DcboxlJqmgiaYgzabZEloFX3SDBImxV
/5g6vHJBcu4qu9tPmocNOsEUzQNp2v9t1LDJAOY5WLL9/vpgq0FDHHxvEV59FIZE
S3XyWD3z5/MFuetFXfZi3enNwWEFyfeFNFaUqiC1d4p43V7zxty8wpzVOHyw++ea
UxLDjbUxekSunqpjbtyDk2YVu5FMmU3AVExSjn/syMqyRbHkGcT+Q/Ilr4QYL9U=
=FZsh
-----END PGP SIGNATURE-----

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