Login  Register

Re: How to measure Directness or Straightness of processes of neurons?

Posted by Straub, Volko A. (Dr.) on Jul 28, 2019; 6:22am
URL: http://imagej.273.s1.nabble.com/How-to-measure-Directness-or-Straightness-of-processes-of-neurons-tp5021271p5022345.html

Dear Yuhong,

Sorry for the delay in responding to your query, but I have been away.
If you have a b/w image with white lines on a black background (e.g. by creating a skeleton of a thresholded image)  the easiest way to calculate the Euclidean distance between the endpoints of the lines as well as the total length of the line path is probably to use the 'Analyze Skeleton (2D/3D)' function in ImageJ (Analyze->Skeleton->Analyze Skeleton (2D/3D). If you tick the option to 'Show detailed information', it produces a table that shows the branch length, end point coordinates, Euclidean distance between end points of branches, etc.
Below is a short macro that creates two polylines that cross each other and then uses the 'Analyse Skeleton' function to show the information for each of the 5 non-crossing segments. It also shows a tagged image that colour codes the pixels of the skeleton to indicate end points, junctions and crossings.
In order to measure the length of a specific ROI selected in the ROI manager, I would probably copy the ROI to an empty image and then use the 'Analyse Skeleton' function.

I hope this helps to answer your question,
Volko

newImage("Test", "8-bit black", 200, 200, 1);
makeLine(34,92,60,70,91,81,115,35,159,96,130,120,168,121);
run("Draw", "slice");
makeLine(83,26,145,23,159,49,130,120);
run("Draw", "slice");
run("Analyze Skeleton (2D/3D)", "prune=none show display");


________________________________
From: Rainbow <[hidden email]>
Sent: 16 July 2019 21:29
To: [hidden email] <[hidden email]>
Subject: Re: How to measure Directness or Straightness of processes of neurons?

Hi Volko,

Thanks for sharing your idea! For the time being, I am working on the
calculation of Euclidean distance between two endpoints of a curved line.
This line is selected in ROIs Manager. Could you please explain more about
how to measure the distance between the endpoints?

Best wishes,

Yuhong



--
Sent from: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.1557.x6.nabble.com%2F&amp;data=02%7C01%7Cvs64%40leicester.ac.uk%7C08e665dc746d45e1e8d108d70a2df6ae%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C636989064860380068&amp;sdata=reHz8Q5jf6IAccMulrMPhV4dBVOTUcVrAsYvpq0P%2FPk%3D&amp;reserved=0

--
ImageJ mailing list: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fimagej.nih.gov%2Fij%2Flist.html&amp;data=02%7C01%7Cvs64%40leicester.ac.uk%7C08e665dc746d45e1e8d108d70a2df6ae%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C636989064860380068&amp;sdata=u%2BMLctvlDyQknWuGnu%2Bv4FIjEvxu9cCYoGtOc1xpfZg%3D&amp;reserved=0

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