# Calculation of the length of a moving intestine in a movie

Dear all,

Recently, I am
searching for a script calculating the length (diameter in 2D) of a moving tube
(here a part of the bowel/intestine) over a movie (5000 pictures). Initially, I
calculated the diameter of the tube/intestine manual in every 10th
picture, but that was extremely time consuming. May be someone know a script
with is able to recognize the border between background and intestine, measure
the length always on the same position and this all over the 500 pictures. Last not
least I will show a diagram of the length vs. time. Thanks in advance.

Rene

Hi Rene,

Iām sure someone can help you. However, it would be much easier for someone to help if you could post some example images such that others can play with them and come up with nice solutions for you.

Best,

Christian

Perhaps this forum thread will help you. That example is measuring the length from end to end of a termite gut. Start by segmenting the structure, then skeletonize it, and analyze the skeleton.

If you record a macro to do this, you can automatically repeat the steps across all 5000 time points.

And as @dietzc says, if you post a sample image, we can give more specific suggestions.

Thanks for the suggestions, here I have first 1 picture of the whole video sequence (5000 pictures) where you can see our intestine, from that we have to measure the diameter/length every 0,5 cm over the whole sequence. I know the picture is really unfocussed, this we have to improve, but I hope the idea is clear, and if we are not able the manage the calculation of the diameter automatically it makes no sence to do better experiments, because the manually calculation is really time consuming. Finally we would like to present the changes over the time every postition as shown in the second picture for one position. May be thanks helps for the understanding and if someone know any procedure in ImageJ or did similar calculation, that would be great. Thanks.
Rene

Hi @Rene

I can provide you a KNIME Image Processing solution

How it works:
Load all images and select in the first the region of interest.

Then we apply thresholding to this area:

Finally we measure the length of each segment:

As you can see there are some holes in the thresholded image. This is due to the out of focus and also to the lines in the background. If you remove the lines in the background you will lose the 0.5cm grid but you could recover this from the pixel size. In the result table every 0.5cm x-position could be filtered.

Here is the workflow (99.3 KB).

3 Likes

Great, I will try it. Thanks a lot.
rene