Skip to content

Image analysis (KNIME)

Friedrich Preusser edited this page Aug 25, 2022 · 18 revisions

Setting up KNIME

KNIME (pronounced naɪm), is open source, available for free and can be downloaded here. It is a modular data analysis tool that allows users to build software workflows through a graphical user interface and is therefore useful for image analysis projects that involve a lot of images (i.e. comparable to CellProfiler).

Please note: While KNIME offers licenses for running their software on servers and the cloud, all software components used in this paper are free and can be used without the need for a KNIME license.

After installing KNIME, you'll have to change your .ini file to increase RAM space, which we need for tracking.
Here you can find instructions how to do this.

We set the allocated RAM space to 50GB for tracking 8min long videos.

Install FFMPEG

For video downsampling inside KNIME you'll need to install ffmpeg.

Download the KNIME workflow

The workflow can be downloaded here.

We also provide an additional workflow that you can use for training machine learning models to classify segmented bitmasks (e.g. omega turns).

Open the WormObserver workflow in KNIME

You'll also need to install KNIME extensions for the workflow to run correctly.
If you open the workflow for the first time, KNIME will automatically ask you to install the missing extensions.
You'll need to install the following: "Image processing", "Vernalis KNIME nodes", "KNIME external tool support"

You'll also need to activate the ImageJ macro and the FMI toolbox.

Within KNIME, please go to:
File > Preferences > Install/Update > Available Software Sites and tick the box for "KNIME Community Extensions (Experimental)".
To activate the FMI KNIME toolbox click on Add and enter https://community.knime.org/download/ch.fmi.knime.plugins.update under location. Then click on Apply and Close.
Then go back to Help > Install New Software... under Work with select KNIME Community Extensions (Experimental) and check the box for KNIME Community Extensions - Image Processing and Analysis``. Click on Next>``` at the bottom of the window and proceed with the installation. You'll need to restart KNIME.

Next, go again to Help > Install New Software... under Work with and select the FMI site and check the box for Uncategorized and proceed with the installation as before. Now you'll have all necessary components ready and the workflow shouldn't throw any errors.

Configure the workflow

KNIME overview Generally, the workflow can be used either while the acquisition of a timelapse is still ongoing or after all movies have been acquired.
These two modes each require a slightly different workflow set-up:

If you want to run the workflow in parallel to the acquisition, chose the grey start and end workflows and connect those to the middle part (by connecting the nodes marked in purple to the nodes marked in blue).
If your acquisition is done or you want to re-analyze a dataset, connect the light blue workflows to the middle part.

Some nodes will require configuration prior to running the workflow on your computer.
These nodes are marked in red and you have to double click on them for configuration.

4 nodes will require your input (from left to right):

  • Java Edit Variable (1): Here you'll have to define the framerate (fps) of your incoming videos and also define the fps rate you want to downsample to.
  • Table Creator: The IDs of the timelapses you want to analyze (usually named YYYY-MM-DD_HH_MM_SS as created by the WormObserver GUI)
  • Java Edit Variable (2): The path to the timelapse data.
  • External tool: Under Input Data File & Output Data File you can just give the location of an empty text file that you create, this is just a placeholder. Under External Tool please provide the location of the ffmpeg software on your computer (e.g. /usr/bin/ffmpeg).
  • Global thresholder: Select a threshold value for segmenting worms. May depend on your microscopy light source etc. you can check the segmentation results at different steps within the workflow by right clicking on the yellow marked nodes and select "View".
  • Model Reader: Please select the location of the pre-trained model for detecting omega turns. We provide one that you can download here.

You start the workflow by right click on the last node within the workflow and select "Excecute".
Within each timelapse folder (as created by the WormObserver GUI), the KNIME workflow will create a new folder called "analysis" where it will store the zipped csv result files of all analyzed videos in separate folders.

Clone this wiki locally