CellProfiler pipeline in Knime, issue to have output images

Hi @CellProfilerTeam, Hi@KnimeTeam,

I’m trying to set up a workflow in Knime that call a CellProfiler pipeline.
It works like a charm to get tables BUT I need to export output images and I could’t find a way to do it so far.
In the SaveImages module I tried to set the Output file location to Default Output Folder or to Same folder as image and I couldn’t get any output images.

I don’t necessary need the output image to be accessible/viewed within Knime, but at least I would like to have a look to the results of the segmentation.

Best,

Romain

Neat! Glad it’s mostly working. I suspect the CellProfiler team doesn’t have hints here so I hope KNIME enthusiasts can chime in!

Though I wonder if using DisplayDataonImages module could be a workaround?

The CellProfiler integration in KNIME only gets the output table back into KNIME, I guess you noticed this already, which is why you tried to work around this limitation by saving the images within your pipeline, right?

The knime-cellprofiler integration communicates with CellProfiler using knime-bridge, handing over the images as ImgPlus objects. The relevant code can be found in these two repositories:

I am not sure if there’s any path information associated with the input images in this case…

@stelfrich might be able to help here.

Hi @romainGuiet,

To quote CellProfiler/knime-bridge's README:

In general, you should not use modules that perform I/O such as SaveImages, ExportToSpreadsheet and ExportToDatabase.

As far as I can tell, we are not even executing SaveImages modules, even if they are contained in the CellProfiler pipeline.

Best,
Stefan

Just to add some more substance to my gut feeling:

We are calling IKnimeBridge.cleanPipeline() before the execution of any pipeline (here) to strip out any output module:

1 Like

Thank you @imagejan, Thank you @stelfrich for your answers,

but that’s quite unfortunate that there is no way (yet) to output an image so the user can “visually inspect” the results of the segmentation.

I think this would be a great benefit for KNIME. Indeed, we generally prototype pipelines on some images and then run it on the whole dataset. Being able to check that the segmentation behaved relatively well for the entire project is something we recommend to our users.

Regarding the comments in the code :

What is the problem with an output to disk? KNIME can output to disk, right? CellProfiler should also be able to do so ?

It would be nice if one could specify a folder either in the CP pipeline, choosing default folder for example, or even better within the KNIME module.

I think that KNIME would be a great tool for this use case:

  • I have lif files (cellProfiler can’t read images in it), so it saves me the use of FIJI to export from the lif,
  • Cellprofiler with its modules Identify Primary and Secondary objects does a wonderful job, to detect and measure cells
    But you have to merge the different tables (using the common ImageNumber tag) to make sense of your results (either with R, Excel, Knime …).

So here, Knime would allow to merge everything in one interface, reading the images, sending them to CP, getting the results and even plot them! if only I could also visually inspect my segmentation.

Thank you again for your answers,

Romain

1 Like