Login  Register

Re: Measuring distance between points for tree ring widths

Posted by Straub, Volko A. (Dr.) on Oct 16, 2015; 2:38pm
URL: http://imagej.273.s1.nabble.com/Measuring-distance-between-points-for-tree-ring-widths-tp5014639p5014665.html

Hi,

The output of the measurements were in pixels as the coordinates reported by the ROI.getCoordinates (x,y) are in pixels. Below is a slightly modified version of the macro that reports the distance in pixels plus the calibrated distance and units (depending on values set in 'Analysis -> Set Scale').

Hope this helps,
Volko

roiManager("select",0);
Roi.getCoordinates(x0,y0);
for(i=1;i<roiManager("count");i++) {
     roiManager("select",i);
     Roi.getCoordinates(x,y);
     d=sqrt(pow(x[0]-x0[0],2)+pow(y[0]-y0[0],2));
     getPixelSize(unit,pixelWidth,pixelHeight);
     scaled=d*pixelWidth;
     print(i,d,scaled,unit);
}



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of lindbeem
Sent: 16 October 2015 15:16
To: [hidden email]
Subject: Re: Measuring distance between points for tree ring widths

Hi Volko,

I ran your macro, and everything looked great at first, but I am getting strange units as a measurement.  At first I thought it was giving an output in pixels, so I tried converting the number into inches based on the dpi, but the number I obtained was much larger than it should be.  Based on the macro that you wrote, what would be the units of the output given?  



--
View this message in context: http://imagej.1557.x6.nabble.com/Measuring-distance-between-points-for-tree-ring-widths-tp5014639p5014664.html
Sent from the ImageJ mailing list archive at Nabble.com.

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

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