Login  Register

Re: array in macro functions

Posted by Krs5 on Feb 16, 2018; 8:53am
URL: http://imagej.273.s1.nabble.com/array-in-macro-functions-tp5020111p5020112.html

Dear Csaba,

You need something like:

coord = newArray(20,48,59,13,101,40,75,77,38,70);
makePolygon(coord[0],coord[1],coord[2],coord[3],coord[4],coord[5],coord[6],coord[7],coord[8],coord[9]);

I guess it depends a little how many sides your polygons will have how to implement this.

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
www.le.ac.uk/advanced-imaging-facility



-----Original Message-----
From: Csaba DÁVID [mailto:[hidden email]]
Sent: 15 February 2018 20:28
To: [hidden email]
Subject: array in macro functions

Hi,i have coordinates of hundreds of irregularly shaped polygons that i want to draw on a single image. I do not have the polygons as ROIs, unfortunately. I want to usea list of coordinates from another software. I managed to import them in an array, but when i wanted to use makePolygon(coord); where coord is an array of all the coordinates of a polygon, i got the failure message: Numer or numeric function is required. When i wrote a list of coordinates one by one in the makePolygon function it worked well, but I do not have the time to write all the many thousand coordinates of many hundred polygons that way.
How can I use list of coordinates for making polygons?
Many thank in advance!Csaba

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

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