Question

I have a 3D binary image. Say the resolution is dx,dy,dz mm. How can Euclidean distances on the image be converted to distances in mm.

Furhter, If I computed an iso-surface using the marching cubes algorithm. A surface mesh is generated. The Euclidean distance between two mesh vertices - how can this be converted to mm?

Was it helpful?

Solution

If I'm reading your question correctly, you have some voxel size in millimetres and this is not necessarily isotropic (i.e. the voxels are not regular cubes).

So if each voxel has dimensions dx * dy * dz and you have two voxels at positions (x1, y1, z1) and (x2, y2, z2), the you want to find the Euclidean (straight line) distance between these two points in millimetres.

So, first convert each point to get a spatial position (call these s1 and s2)

s1(x,y,z) = (x1 * dx, y1 * dy, z1 * dz), and
s2(x,y,z) = (x2 * dx, y2 * dy, z2 * dz)

Then the distance, d, between these points in millimetres is then length of the vector, v, from s1 to s2

v(x,y,z) = (s2.x - s1.x, s2.y - s1.y, s2.z - s1.z)

Distance d = sqrt(v.x^2 + v.y^2 + v.z^2) millimetres.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top