Login  Register

Embedded measure command not measuring Delaunay Voronai plugin lines

Posted by Nuno Mira on Jul 22, 2015; 5:40pm
URL: http://imagej.273.s1.nabble.com/Embedded-measure-command-not-measuring-Delaunay-Voronai-plugin-lines-tp5013697.html

I'm trying to make a macro that allows us to measure line lenghts and angles, based on the Delaunay Voronoi plugin.

Simply put, the idea is to have a results table with all the informations of every line.

The problem is that the Delaunai Voronoi plugin outputs lines that are not measurable using the embedded ImageJ measure command.

As a workaround, since this plugin generates a results table with all line coordinates, I have tried to parse every line and make new lines on the drawing with the drawLine command. But these lines are not measurable too. So the only line command that works is the makeLine, which limits the application to one line at a time.

Can someone shed me some light on this? How is it possible to obtain a results table with all line lenghts without having to save and open a new results csv file over and over again?

Cheers!!

MACRO:

run("Clear Results");
run("Close All");

open("C:\\Users\\User\\Desktop\\microperf2.tif");

//setTool("rectangle");
makeRectangle(0, 180, 640, 140);
run("Crop");

run("8-bit");

//run("Brightness/Contrast...");
run("Enhance Contrast", "saturated=0.35");
run("Apply LUT");

run("Set Scale...", "distance=412 known=5.00 pixel=1 unit=mm global");

run("Set Measurements...", "area mean standard modal min centroid center perimeter bounding fit shape feret's integrated median skewness kurtosis area_fraction stack display add redirect=None decimal=3");

run("Find Maxima...", "noise=95 output=[Single Points] exclude light");

run("Analyze Particles...", "size=1-Infinity pixel circularity=0.00-1.00 exclude clear");

run("Delaunay Voronoi", "mode=Delaunay make inferselectionfromparticles export");

for (i = 0; i < nResults; i++)
  {
      // You may need to change the "frame", etc strings to match your csv file.
      x1 = getResult("x1", i);
      y1 = getResult("y1", i);
      x2 = getResult("x2", i);
      y2 = getResult("y2", i);
      makeLine(x1, y1, x2, y2);
          run("Draw");
         
  }


IMAGE FILE:
microperf2.tif