Posted by
Straub, Volko A. (Dr.) on
Oct 15, 2015; 5:47am
URL: http://imagej.273.s1.nabble.com/Measuring-distance-between-points-for-tree-ring-widths-tp5014639p5014640.html
Dear lindbeem,
Once you have created a selection, you need to add it to the ROI
manager. You can do this by pressing 't' on your keyboard (if it doesn't
show on your image, tick the 'Show All' box in the ROI manager).
However, using the multipoint selection tool adds all the points as a
single selection. I think it is probably better to use the point
selection tool and add each point you want to measure as an individual
ROI to the ROI manager. Once that is done, the macro code below will
measure the distance between the first and all other points in the ROI
manager. The results are printed to the log window. So, as long as the
core (pith) is the first point in the ROI manager, the macro should
provide a list of the straight line distance between that point and all
other points.
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));
print(i,d);
}
On 15/10/2015 04:30, lindbeem wrote:
> I have multiple tree core .tiff files that I want to analyze and calculate
> the distance from the pith to each respected ring. I have used the multiple
> point tool and have marked the edge of each ring starting from the most
> recent year's growth all the way to marking the middle of the pith. I'm
> planning to label them by calendar year and use the distances to do further
> calculations. I am new to using ImageJ and macros, but essentially, I would
> like to be able to have a script calculate the distance between the tree
> ring to the pith for each measurement using the x and y coordinates. Images
> were scanned using 3200 DPI resolution which is already set. (I.E. If the
> tree is 82 years old, there will be 83 points. Point #83 will be at the
> center of the core (pith), and every other point will mark the end of a tree
> ring. So I want to measure the distance from point 1 to 83, 2 to 83, 3 to
> 83, 4 to 83, etc.)
>
> Is there a tool that allows you to enter in the coordinates and specify how
> you would like them measured? Also, I have marked the points on the tree
> core, but I am unable to see them in the ROI manager. Is there an extra
> step that I need to do in order to get those points to show up?
>
> Any help will be appreciated. Thank you in advance.
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Measuring-distance-between-points-for-tree-ring-widths-tp5014639.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