Finding total displacement of a track

Hi world.
I have an image with white of various intensities, thicknesses, lengths and shapes on it. I am interested in finding the total displacement from the beginning to the end of each track. I have manually drawn on each track using the line tool to create regions of interest.
Is it now possible to find the total displacement from the beginning of each track , not the total length of the track. It might have already been done before. Can someone please point me to any solutions.
(the image is attached)

image.tiff (649.5 KB) image.jpeg.tiff (649.5 KB)
One of the tracks I am interested in

Thanks
Bilal

Hi Bilal, you could use in a macro the command:

Roi.getCoordinates(xpoints, ypoints);

Then take the first and last elements of the arrays xpoints and ypoints to calculate the displacement.
Hope this helps,
best,
Rocco

HI Rocco
Thanks for response.
I am a novice to Macro writing. Can I just paste this into new Macro and run it.
Thanks
Bilal

â€śIs it now possible to find the total displacement from the beginning of each track , not the total length of the track.â€ť

Do you want the trajectory with its different positions (x, y)?
You donâ€™t want the length.

Is this the image you want to get?
Use the PlugIn â€śRidge Detectionâ€ť.
Greetings

HI Mathew,
Could write me the steps I need to follow.
Thanks
Bilal

Use the Pythagorean theorem on points
xpoints[0],ypoints[0] and xpoints[xpoints.length-1],ypoints[ypoints.length-1], which is the macro language notation of the first and last elements of the ROI as @RoccoDAntuono already pointed out.

1 Like

The following Error was obtained obtained:

Error: Unrecognized command: â€śEnhance Local Contrastâ€ť in line 3:
run ( â€śEnhance Local Contrastâ€ť , â€śblocksize=127 histogram=256 maximum=3â€ť <)> ;

Hi
@bilalrmalik
This is the filter: â€śenhance local contrastâ€ť.
I use ImageJ (version 1.52u) and not FIJI.
Greetings