Login  Register

Re: Specify Multiple ROI W/ xy coordinates

Posted by dparrell on Sep 18, 2015; 10:05pm
URL: http://imagej.273.s1.nabble.com/Specify-Multiple-ROI-W-xy-coordinates-tp5014356p5014368.html

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



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");
   }