# Individual tracking

**URL:** <https://forum.knime.com/t/individual-tracking/10323>\
**Category:** KNIME Extensions\
**Tags:** image-processing\
**Created:** [March 16, 2018, 12:54pm UTC](https://forum.knime.com/t/individual-tracking/10323 "2018-03-16T12:54:41Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 16, 2018, 12:54pm UTC](https://forum.knime.com/t/individual-tracking/10323/1 "2018-03-16T12:54:41Z")

</div>

Hey everyone,

I was wondering if it is possible in KNIME to track objects separately, but in such a way that one can clearly identify which values belong to which objects. An example:

 ![T8B2_0856](https://forum-cdn.knime.com/uploads/default/original/1X/15b697c7369088a9143a405981486886814724f8.jpg) ![T8B2_0861](https://forum-cdn.knime.com/uploads/default/original/1X/c92a11be7010f9f35c402cce3ab568a2d0ed91e4.jpg) ![T8B2_0866](https://forum-cdn.knime.com/uploads/default/original/1X/112f63fdd7a2badf36e371e32eaebfbbe55e3cdb.jpg)

I’d like to track the centroids of the objects separately(and other geometric characteristics like diameter, etc), but in the end I have to know which value belongs to which object.  
Furthermore, you see that two of the three objects are connected to each other. i have herad of watershed algorithm for separation or the cell-splitter, but at which point of my analysis do I have to implement this?  
My workflow would start (this is hypotheticaly, I haven’t started working on the actual workflow,) with image import, quantile filter for denoising, then background subtraction using max intensity image as background (at this point I have already the problem that the very small object is a little blurred, which makes further analysis in my opinion difficult), then inversion of image and thresholding.

Has anyone some suggestions, if this is possibe and if so, how I could possibly do this? I would be very happy for any advice! 🙂

---

<div class="post-metadata">

**Author:** ![gab1one](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gab1one/32/461_2.png) [@gab1one](https://forum.knime.com/u/gab1one)\
**Post date:** [March 16, 2018, 2:40pm UTC](https://forum.knime.com/t/individual-tracking/10323/2 "2018-03-16T14:40:56Z")

</div>

Hi @Bjoern,  
have a look at this example workflow we made for a very similar task in the past:

> **[Automatic diameter statistics for rising bubbles](https://forum.image.sc/t/automatic-diameter-statistics-for-rising-bubbles/3680)**
>
> Hey everyone, I’m new to ImageJ. I want to examine rising bubbles in a fluid. Therfor I need some date, e. g. bubble diameter etc. My plan is to use the feret diameter as a diameter characteristic, because most of the bubbles are not perfectly...

[04\_Diameter\_Statistics\_For\_Rising\_Bubbles.knwf](https://forum-cdn.knime.com/uploads/default/original/1X/be07ce4e8a5983bfe26c81481355956d08552698.knwf) (2.9 MB)  
Could it be that you guys know each other 🤔 ?

> [@Bjoern](#):
>
> I’d like to track the centroids of the objects separately(and other geometric characteristics like diameter, etc), but in the end I have to know which value belongs to which object.

If you use the Trackmate tracker, all objects on the same track (the same object at different time points) should get the same label. This should allow you to keep track of the value origins when you calculate the features on the segments.

> [@Bjoern](#):
>
> i have herad of watershed algorithm for separation or the cell-splitter, but at which point of my analysis do I have to implement this?

After you have done your preprocessing and cleaned up the data as much as possible, for seeded watershed you do not need to threshold your data, the Waehlby cellclumpsplitter requires a thresholded image.

best,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 16, 2018, 9:37pm UTC](https://forum.knime.com/t/individual-tracking/10323/3 "2018-03-16T21:37:55Z")

</div>

Hey Gabriel,

thanks for your reply. Yes, we know each ver well…actually, I was the one, who posted this in the ImageJ forum 😃 After your help, I decided to try and work with KNIME more frequently, but as you can see, I’m still not able to solve all of my problems on my own…

So I started to build the workflow very similar to the one you built. Now I tried to implement the seeded watershed and the trackmate node into the workflow, but I come across the problem that these nodes seem to need a special type of input, because I always get this message: " No column spec compatible to “LabelingValue” ". Furthermore, if you would be so kind a have a look at my workflow, you will see that the small object connected to the larger object is not detected precisely after the image processing, especially the image calculation. The threshold seems to fail to detect the objects precisely, too.  
I would be very happy, if you could take a look at my attached workflow and if you could try to help me to understand, how to improve the workflow and how to implement the splitting of the attached objects and how to track the objects separately using trackmate.  
Thanks in advance!

Best,  
Bjoern

[Test.knwf](https://forum-cdn.knime.com/uploads/default/original/1X/afac1f25c58285cae0a8c1ace4178cb90aee6690.knwf) (25.9 KB)

---

<div class="post-metadata">

**Author:** ![gab1one](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gab1one/32/461_2.png) [@gab1one](https://forum.knime.com/u/gab1one)\
**Post date:** [March 19, 2018, 9:25am UTC](https://forum.knime.com/t/individual-tracking/10323/4 "2018-03-19T09:25:22Z")

</div>

Hi @Bjoern,  
I took a look at the workflow and I think I found a pretty good solution for you:

 ![separated%20bubles](https://forum-cdn.knime.com/uploads/default/original/1X/92f0e5c9504df20474b5fe5143fbac62b9f81de6.png)

[Separate close bubles.knwf](https://forum-cdn.knime.com/uploads/default/original/1X/a82a70151d18acbe1feeaec017584c386321a5bb.knwf) (232.6 KB)

A few notes on your workflow:

- In most cases you want to use one of the automatic threshold methods instead of a manual treshold (e.g. Otsu), you usually get much more robust results.
- Be careful with the quantile filtering, it can introduce artifacts, I ended up with better results without it.

best,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 20, 2018, 9:47am UTC](https://forum.knime.com/t/individual-tracking/10323/5 "2018-03-20T09:47:11Z")

</div>

Hey @gab1one,

thank you very much for your time and effort. I tried your workflow on an example sequence (the complete sequence of the three example images I have posted above). It seems that the Otsu method is not applicable, although thisis one of the most commonly used methods. The resulting images always had a lot of noise, which caused problems in the further process:

 ![Otsu](https://forum-cdn.knime.com/uploads/default/original/1X/339e25f31516b5916fa1f2d5fc6711ff516fcea9.JPG)

Therefore, I changed the method to “Max Entropy”, which worked better.  
However, some issues arise in the processing:

1. In the beginning, only the large object consisting of the two attached particles is present. In the image, when the second object comes into the viewing area, it is not sufficiently detected by the threshold. In the labelling process, the object is then not determined by one single label but by several labels (causing furtherproblems later on).
2. I added a Feature Calculator after the Cell Clump Splitter to calculate the center of gravity and other geometric features. For an image, where only one single object is present, I get three different (values) for all geometric parameters.

 ![1](https://forum-cdn.knime.com/uploads/default/original/1X/e57877d0dfce245a510e2cb66bbb2338e0384202.JPG)

1. I think that I asked this question already before in this forum but got no satisfactory answer: the image processing is very disk space intensive, which causes my PC to become super slow…is there a way to minimize the required space further in KNIME? I already use the Garbage collector inbetween.

I would be happy, if you could help me with these problems. I could also provide a complete image sequence if this might be helpful.

Best regards,  
Bjoern

---

<div class="post-metadata">

**Author:** ![gab1one](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gab1one/32/461_2.png) [@gab1one](https://forum.knime.com/u/gab1one)\
**Post date:** [March 20, 2018, 3:53pm UTC](https://forum.knime.com/t/individual-tracking/10323/6 "2018-03-20T15:53:49Z")

</div>

### Image Filtering

Your image looks like it could use some background removal procedure (e.g. divide it by a version of the image filtered with a large sigma Gauss filter, or the max image procedure that was in your first workflow), as well as some noise removal (e.g slight blurring with a very small sigma Gauss filter)

### Labels:

> [@Bjoern](#):
>
> I added a Feature Calculator after the Cell Clump Splitter

Make sure you select either “X, Y, Channel” as you dimensions, otherwise the features will get calculated for each color channel separately. You might want to use the **Projector** node to condense your image channels to one, this will not only reduce the size of the images, it will also reduce the complexity of your operations and improve the runtime.

### A few performance tips

> [@Bjoern](#):
>
> think that I asked this question already before in this forum but got no satisfactory answer: the image processing is very disk space intensive, which causes my PC to become super slow…is there a way to minimize the required space further in KNIME? I already use the Garbage collector inbetween.

- You could use the **Don’t Save Start** / **Don’t Save End** nodes to define parts of your workflow that won’t have their results stored to disk.
- You could use the **Chunk Loop Start** / **Chunk Loop End** nodes to only process parts of your dataset at once.
- You could use streaming execution: [Streaming data in KNIME | KNIME](https://www.knime.com/blog/streaming-data-in-knime)

best,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 21, 2018, 8:37am UTC](https://forum.knime.com/t/individual-tracking/10323/7 "2018-03-21T08:37:40Z")

</div>

Hey @gab1one,

thank you for your suggestions. I worked a bit on the workflow and was able to isolate the wanted objects. However, I now have again a problem with the cell-clump splitter. I did two different approaches:

1. I subtracted a Gaussian Convolution image from the original one, applied the Otsu method as global thresholder and did the connected component analysis. With some labelling filtering afterwards, I was able to prodcue the following segments:

 ![Segment](https://forum-cdn.knime.com/uploads/default/original/1X/337bf7a4568ea2b0f05a76c44245c2afffb7358d.JPG)

The Waehlby Cell Clump Splitter, however, produces no images (only white images)…

1. I modified your uploaded version by changing the image calculator to division instead of subtraction. Additionally, I skipped the convolver and went directly to the global threshold followed by the operation “open” and the connected component analysis. The last one looks finde, but application of the Cell Clump Splitter leads to this:

![Cell-clump](https://forum-cdn.knime.com/uploads/default/original/1X/dd5578a70f03b73c244f414c22a9851d516c161d.JPG)

It looks like the operation is not able to detected the single objects as a complete object…

Do you have any idea how to solve this?

And thanks for the advices for improvement of performance. I will give them a try!

Best,  
Bjoern

---

<div class="post-metadata">

**Author:** ![imagejan](https://forum-cdn.knime.com/user_avatar/forum.knime.com/imagejan/32/47_2.png) [@imagejan](https://forum.knime.com/u/imagejan)\
**Post date:** [March 21, 2018, 8:41am UTC](https://forum.knime.com/t/individual-tracking/10323/8 "2018-03-21T08:41:07Z")

</div>

> [@Bjoern](#):
>
> It looks like the operation is not able to detected the single objects as a complete object…
> 
> Do you have any idea how to solve this?

How about filling holes before trying to split the objects? There’s the _Fill Holes_ node you could try…

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 21, 2018, 10:05am UTC](https://forum.knime.com/t/individual-tracking/10323/9 "2018-03-21T10:05:05Z")

</div>

Hey @imagejan,

I tried to wokr with the Fill Holes operation. Therefore, I first applied the Close operation with three iterations, so that the small particle outline is completed (otherwise, I could only fill the large object). The I applied the Fill Holes, which worked. After that, I used the connected component analysis, a labelling filter (to exclude the noise) and got this:

 ![Labelling](https://forum-cdn.knime.com/uploads/default/original/1X/48117530fbe1251b7f512efb8ab4f8fdf57bce63.JPG)

So it seems to have worked. However, I cannot apply the Cell Clump Splitter to the workflow. If I want to apply the Splitter to the Connected Component Analysis (as in Gabriel’s uploaded workflow) or the Labeling Filter, I only get the error message "No column spec compatible to “ImgPlusValue”.  
I have also integrated a Segement Features node after the Labeling Filter and I can apply the Cell Clump Splitter to this node. However, I always get just white images…

Best regards,  
Bjoern

---

<div class="post-metadata">

**Author:** ![gab1one](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gab1one/32/461_2.png) [@gab1one](https://forum.knime.com/u/gab1one)\
**Post date:** [March 21, 2018, 11:56am UTC](https://forum.knime.com/t/individual-tracking/10323/10 "2018-03-21T11:56:25Z")

</div>

> [@Bjoern](#):
>
> I only get the error message "No column spec compatible to “ImgPlusValue”.

Hi @Bjoern this is a confusing but easy to fix problem, the **Waehlby Cellclumpsplitter** node needs both the image and the labeling. The "No column spec compatible to “ImgPlusValue”. tries to tell you that, but it is not really helpful. You can either select the _Append_ option in the **Connected Component Analysis** node, or use a **Joiner** node to reunite the image and the labeling.  
best,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 21, 2018, 12:11pm UTC](https://forum.knime.com/t/individual-tracking/10323/11 "2018-03-21T12:11:33Z")

</div>

Hey @gab1one,

wow, now it’s working! 😃  
Thank you very much!

EDIT: One more question: If I want to implement the Trackmate Tracker into the workflow, I have to do this after the Cell Clump Splitter, if I want to track each object separately, don’t I? If I try to apply this, I get the error message: “Invalid column selection, automatically selecting all columns of the following type: DoubleValue” and “Execute failed: Since now only labels from one Labeling are allowed. Use KNIME Loops!”. Any idea, what the problem is in this case?

Best reagrds,  
Bjoern

---

<div class="post-metadata">

**Author:** ![gab1one](https://forum-cdn.knime.com/user_avatar/forum.knime.com/gab1one/32/461_2.png) [@gab1one](https://forum.knime.com/u/gab1one)\
**Post date:** [March 21, 2018, 12:34pm UTC](https://forum.knime.com/t/individual-tracking/10323/12 "2018-03-21T12:34:15Z")

</div>

Hi @Bjoern,  
before you can apply the **Trackmate Tracker** you need to calculate the segment features, have a look at this example workflow on how to do it: [https://www.knime.com/nodeguide/community/image-processing/applications/trackmate](https://www.knime.com/nodeguide/community/image-processing/applications/trackmate)  
best,  
Gabriel

---

<div class="post-metadata">

**Author:** ![Bjoern](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/46a35a/32.png) [@Bjoern](https://forum.knime.com/u/Bjoern)\
**Post date:** [March 21, 2018, 2:20pm UTC](https://forum.knime.com/t/individual-tracking/10323/13 "2018-03-21T14:20:41Z")

</div>

Thank you, I will try to figure it out.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 2, 2023, 9:14pm UTC](https://forum.knime.com/t/individual-tracking/10323/14 "2023-06-02T21:14:01Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
