Help: distance between hole and particle's surface

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

Help: distance between hole and particle's surface

Josep M. Lanau
Hi everyone,

I am dealing with particles with a single hole. I am trying to measure the
shortest distance between the hole surface and the particle surface, but I
don’t manage to calculate it.

I have tried by programming a macro  loop where the hole is selected,
enlarged a pixel, and measured again, until the hole touches the particle
surface and the particle becomes solid. The number of iterations should
have been the shortest distance. But pixels are squared, so the growing
hole tends to become a square shape, and therefore the procedure is not
valid.

I have no idea about how to measure that distance. Any tool or idea you may
have will be kindly welcome.
Thank you in advance.

Josep M.
Reply | Threaded
Open this post in threaded view
|

Re: Help: distance between hole and particle's surface

Michael Doube
Hi Josep

I've done something like this by selecting the hole's perimeter and
keeping those co-ordinates in an array, then selecting the outer
perimeter and keeping its coordinates in an array. Then for each point
in the hole array I calculate the distance to each point in the outer
perimeter array and keep the shortest distance. This is probably not
very computationally efficient, but it works ;-).

Mike

Josep M. wrote:

> Hi everyone,
>
> I am dealing with particles with a single hole. I am trying to measure the
> shortest distance between the hole surface and the particle surface, but I
> don’t manage to calculate it.
>
> I have tried by programming a macro  loop where the hole is selected,
> enlarged a pixel, and measured again, until the hole touches the particle
> surface and the particle becomes solid. The number of iterations should
> have been the shortest distance. But pixels are squared, so the growing
> hole tends to become a square shape, and therefore the procedure is not
> valid.
>
> I have no idea about how to measure that distance. Any tool or idea you may
> have will be kindly welcome.
> Thank you in advance.
>
> Josep M.
>  
Reply | Threaded
Open this post in threaded view
|

Re: Help: distance between hole and particle's surface

karo03
In reply to this post by Josep M. Lanau
One way is to calculate the distance transform on the (filled)  
particles (Binary->Distance Map) and take the minimum of the distance  
transform of each hole (Measure with Set Measurement Min&Max  
Grayvalue, Redirect to Distance Map). Be careful with scaling,  
distance map gives number of pixels to the nearest background!

Regards
Karsten

Am 27.06.2008 um 10:20 schrieb Josep M.:

> Hi everyone,
>
> I am dealing with particles with a single hole. I am trying to  
> measure the
> shortest distance between the hole surface and the particle surface,  
> but I
> don’t manage to calculate it.
>
> I have tried by programming a macro  loop where the hole is selected,
> enlarged a pixel, and measured again, until the hole touches the  
> particle
> surface and the particle becomes solid. The number of iterations  
> should
> have been the shortest distance. But pixels are squared, so the  
> growing
> hole tends to become a square shape, and therefore the procedure is  
> not
> valid.
>
> I have no idea about how to measure that distance. Any tool or idea  
> you may
> have will be kindly welcome.
> Thank you in advance.
>
> Josep M.