Individual tracking

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:

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! :slight_smile:

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

04_Diameter_Statistics_For_Rising_Bubbles.knwf (2.9 MB)
Could it be that you guys know each other :thinking: ?

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.

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

2 Likes

Hey Gabriel,

thanks for your reply. Yes, we know each ver well…actually, I was the one, who posted this in the ImageJ forum :smiley: 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 (25.9 KB)

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

Separate close bubles.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

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:

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. 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

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:

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

  • 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: https://www.knime.com/blog/streaming-data-in-knime

best,
Gabriel

1 Like

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:

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

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

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

1 Like

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:

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

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

Hey @gab1one,

wow, now it’s working! :smiley:
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

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
best,
Gabriel

Thank you, I will try to figure it out.