Distance from fixed object to threshold particle in a stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Distance from fixed object to threshold particle in a stack

burt46
Hi,

I am trying to calculate the distance from a fixed object to particles in a stack sequence that have a certain threshold once processed. The nearest i have seen, based on other forum posts, was one entitled "plot profile in a stack" (http://imagej.1557.x6.nabble.com/plot-profile-in-a-stack-td3695085.html) whereby a line can generate slices then export to a text file. This is what im looking for, but it only limits the analysis based on particles on top of the line. Think of this scenario, on a football pitch, if i draw a line through the goal line on one side, then have a stack of aerial images of the entire pitch, i want to calculate the distance a particular player is from the goal line as he runs around the pitch (i.e. each stack image).

Any ideas how this can be done, or at least determine the distance of the closest particle to the fixed position?

Many thanks

 
Reply | Threaded
Open this post in threaded view
|

Re: Distance from fixed object to threshold particle in a stack

Jeremy Adler
I am  not completely clear about what you are after but

The shortest distance of every pixel from a base binary object are generated using

Distance Map
from Process/Binary
for distance less than 255 pixels

or from Plugins/Process
Exact Signed Euclidean Distance Transform (3D)

then from your stack you need to find the location (x,y) of each object using  Analyze/Analze Particles and use this position to read its distance to the object
 which can be done using
getPixel(x,y)
from the Distance mapped image
if the base object is a single pixel the forget the distance map and just use the formula for a right angled triangle to find the straightline distance

for the location of the object use the centre of mass option in Analyze/Set Measurements

There are at least two possible complications to consider
1) if you have more than one particle in each image of your stack

2) if there are obstructions in the route to the base object,  like lakes that you cannot cross.


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of burt46
Sent: den 3 januari 2016 00:42
To: [hidden email]
Subject: Distance from fixed object to threshold particle in a stack

Hi,

I am trying to calculate the distance from a fixed object to particles in a stack sequence that have a certain threshold once processed. The nearest i have seen, based on other forum posts, was one entitled "plot profile in a stack" ( http://imagej.1557.x6.nabble.com/plot-profile-in-a-stack-td3695085.html
<http://imagej.1557.x6.nabble.com/plot-profile-in-a-stack-td3695085.html>  ) whereby a line can generate slices then export to a text file. This is what im looking for, but it only limits the analysis based on particles on top of the line. Think of this scenario, on a football pitch, if i draw a line through the goal line on one side, then have a stack of aerial images of the entire pitch, i want to calculate the distance a particular player is from the goal line as he runs around the pitch (i.e. each stack image).

Any ideas how this can be done, or at least determine the distance of the closest particle to the fixed position?

Many thanks

 



--
View this message in context: http://imagej.1557.x6.nabble.com/Distance-from-fixed-object-to-threshold-particle-in-a-stack-tp5015307.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
Reply | Threaded
Open this post in threaded view
|

Re: Distance from fixed object to threshold particle in a stack

burt46
Thanks Jeremy

I tried the Distance Map approach but have distances over 255 pixels. I did the analyse particles for the pixel positions too but could not get the shortest distance between the two ROIs. Both my ROIs are perimeter analysis and not centroid.

The nearest I came to a solution was the graph plugin demo>

http://rsb.info.nih.gov/ij/plugins/graph/index.html

However, this wont work in stacks.

The following also worked well for stacks, but is centroid to perimeter and not perimeter to perimeter:

http://microscopynotes.com/imagej/shortest_distance_to_line/index.html
Reply | Threaded
Open this post in threaded view
|

Re: Distance from fixed object to threshold particle in a stack

Michael Schmid
On Jan 4, 2016, at 13:23, burt46 wrote:

> I tried the Distance Map approach but have distances over 255 pixels...

Hi Burt,

you can set the output of the Euclidian distance map (EDM) to 16 bit-integers or 32 bit floating point numbers in Process>Binary Options>EDM Output. Then you get the Euclidian distance map also for distances larger than 255 pixels.

Michael

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