Posted by Straub, Volko A. (Dr.) on Sep 19, 2015; 6:56am URL: http://imagej.273.s1.nabble.com/Specify-Multiple-ROI-W-xy-coordinates-tp5014356p5014370.html
It could be that the data you read from your cvs file is internally
represented as a string rather than a number.
Try using:
*parseInt(string) *(see ImageJ Macro commands)
Hope this helps,
Volko
On 18/09/2015 23:05, dparrell wrote:
> Hi again,
> I have found a thread that does essentially what I want to do at the link
> below. Is this something similar to what you would suggest?
> http://imagej.1557.x6.nabble.com/Add-ROIs-from-a-list-of-coordinates-in-a-CSV-file-td5009300.html >
> I run into a problem in the "run(specify..." line of the code referenced
> below. I get an error saying numerical value is expected. Here is a screen
> shot. Does this mean the x and Y variables are not being properly written
> from my cvs file? Thank you for your help!
> Dan
>
> <http://imagej.1557.x6.nabble.com/file/n5014368/Screen_Shot_2015-09-18_at_6.png>
>
> Here is the actual code as I have edited it:
>
> // Import it into a results table.
> run("Results... ", "open=/Users/Danny/Desktop/roi/test.csv");
>
> for (i = 0; i < nResults; i++)
> {
> // You may need to change the "frame", etc strings to match your csv
> file.
> slice = getResult("f", i);
> x = getResult("x", i);
> y = getResult("y", i);
>
> // Using square ROI of size 10x10 pixels centered around your
> coordinate.
> run("Specify...", "width=10 height=10 x=&x y=&y slice=&slice
> centered");
>
> // Add to the ROI manager.
> roiManager("Add");
> }
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Specify-Multiple-ROI-W-xy-coordinates-tp5014356p5014368.html > Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html