How to join box plot images into 1 image

Dear All

I posted this under the general KNIME Analytics platform category but thought the image processing community are mostly likely to have the specialist expertise on how this might be done.

Does anybody know a way to join 3 images of box plots from different experiments into 1 image prior to exporting that image file?

Currently I am producing box plots of a gene level vs it’s control with “Conditional Box plot (javascript)” then feeding these images to “Image To Table” in a loop, I’m also appending on 2 columns of string data (gene and experimental run) to the table to allow me to filter for the 3 matching plots I want to join and export. This gives me a column of SVG images and the 2 of string data. I had hoped to be able to join/concatenate the images after transposing them from column to row but “Transpose” and “GroupBy” always replace the actual image with a text description or address. I’ve also tried putting the table through “Renderer to Image” and converting the images to .png first but this has not helped.

The only other alternative I can think of to give the desired result is to totally rejig my pipeline to label the per experimental gene and control results so I can combine the 3 experimental results into 1 box plot image with 6 categories rather than 2 (this wouldn’t be ideal).

Many thanks in advance for your thoughts and ideas.

John

Hi @johnprime

I am not quite sure hat kind of join operation you want to perform on the images. Do you want stack the images on top of each other to create a composite image? Or do you want to place them next to each other?
Are you able to share an example workflow with us? That could be very helpful.

best,
Gabriel

Hi Gabriel

Thanks for the response.
I would like to place the images next to each other on this occasion, but staking might be an option I’d use for a different data set.
I’ll add an example workflow as soon as I can.

Best

John

Hi @johnprime
I managed to create this (I used scatter plots but it should work the same with box plots):

Using the following workflow:
plot placement.knwf (45.4 KB)
It is not as automated as I would like it to be and currently only works for exactly 3 plots, but it should be quite easy to adapt.

best,
Gabriel

3 Likes

Hi @gab1one

Fantastic! I’m trying this out at the moment and so far it works well with the box plots.
I’ll link your workflow to an example of my one, for single box plot generation, and then automate it to write labelled images of the triple plots to file. Once that’s done I’ll post it here as an example solution.

Many Thanks for all your hard work and support on this.

Best Wishes

John

2 Likes

OK

As promised here’s the example workflow generating single box plots from some toy data, linked to an automated version of @gab1one 's workflow for joining 3 plots together and exporting those final images to file with a matching gene label.
Any mistakes/errors are my doing, so let me know, plus I’m open to suggestions on how the loops and control variables could be better streamlined.

Here’s the workflow:-
Gene_to_joined_boxplot_example_solution.knwf (414.5 KB)

Thanks
John

3 Likes