java - Get x and y coordinates into variables in macro ImageJ -
i want able place point in image using point selection tool, read x , y coordinates variable in macro.
i've tried getselectioncoordinates isn't working. don't want display coordinates in log or results window.
any appreciated.
getselectioncoordinates
works fine me, e.g.:
s = selectiontype(); if( s == -1 ) { exit("there no selection."); } else if( s != 10 ) { exit("the selection wasn't point selection."); } else { getselectioncoordinates(xpoints,ypoints); x = xpoints[0]; y = ypoints[0]; showmessage("got coordinates ("+x+","+y+")"); }
(a common misunderstanding getselectioncoordinates
doesn't return value conventionally - have give names of variables it'll set.)
Comments
Post a Comment