# Distances between segments

Hi!

Is there any software or stl viewer I can use that gives measurements between segments? For example, if I segment the liver and the aorta, is there a way to click between to points (one in the liver and the other in the aorta), and know the distance between both of them?
It would be very useful.
Best

Hi,

Yes you can easily achieve that using a Line Markup (available in the Markups Module or the Markups toolbar). You can place the points in the 2D view or directly on the surface of the segments in the 3D view.

1 Like

Thank you! That was exactly what I was looking for!

Also, by any chance do you know if there is a way to get the surface of contact between two elements, for example between a tumor and the adjacent organ?

Thanks again!

Best wishes

1 Like

This could perhaps be achieved by obtaining the two adjacent segment arrays that need to be compared. Iterate through the points in one array that have a value of 1 and check if the voxel coordinates around them in the second array are also 1. If they are, then they are adjacent voxels. However, this method can be cumbersome, and there might be a better approach to implement it.

Thank you! But would this method return the value of the area (mm^2) in common between the two segments?

This method allows you to obtain a new segment, which represents the region adjacent to the previous two segments. You can then use other methods to obtain its surface area.

A manual method for obtaining the (approximate) area of a portion of a segment would be to use a closed curve markup. You could then obtain the area enclosed by the curve in the Measurements panel. However this will only work if the surface is almost flat.

Another method would be to extract the common surface using VTK. For this you can write a custom scripted module where you retrieve the meshes of the two segments, extract the common surface and measure the area using VTK filters.

Contrary to what I said above, there is a way to get the exact value of the area enclosed by a curve markups.

For this you can follow these steps :

• Export your segment to a model as described here
• Create your closed curve around the area of interest
• Go to the Dynamic Modeler Module and use the Curve cut tool, set your model and your curve as inputs. This will create an inside and an outside cutout models as output.
• Go to the Models Module, select your â€śinsideâ€ť model and read the surface area in the â€śinformationâ€ť panel.
1 Like

Thank you so much! That was really helpful!

1 Like