Controlling Color Manager Palette with flow variables

I have a question regarding the color manager color palette and the possibility of setting a custom palette. In the attached workflow, which was adapted from the “performing a k-Means_Clustering” example I read in a CSV file that has 5 columns, the first three are Red, Green, Blue values and the 4th and 5th are X and Y coordinates. The entire list is 25,000 rows long and represents a 129 x 192 pixel image of a baby deer (fawn). The K- means clustering is set for 10 based on the RGB values and produces the following 10 sets of cluster centers:

cluster_0 (180,189,173)
cluster_1 (89,153,101)
cluster_2 (106,109,99)
cluster_3 (129,159,134)
cluster_4 (86,81,63)
cluster_5 (45,114,60)
cluster_6 (47,93,63)
cluster_7 (62,130,79)
cluster_8 (35,88,48)
cluster_9 (30,68,39)

I would like to us those center values in the color manager to assign colors to the clusters. I know I can do this manually by selecting “Custom” in the Color Settings of the Color Manager, under palettes, but I want to have the workflow do this automatically since I plan on playing with the number of clusters and each change would produce new clusters and assignments. I’ve tried exporting color models but can’t modify them. I’ve also tried to play with the color appender, but failed. I believe a solution might be possible through flow variables, but this seems to be more complicated then the simple parametrizations shown in the tutorials so I’m stuck. Also, if there is a better way of assigning an “average” color please let me know, I’m open to suggestions. Oh, I should mention that while I am a scientist (medicinal chemist) who uses knime for other things, this is strictly a hobby project that will be used to (hopefully) create paintings and quilts.

Thanks in advance,
Steve

Control_color_manager_palette.knwf (20.0 KB)
fawn.txt (232.0 KB)

1 Like

Hi @berthels

that is not available. You can only manually set the color on the panels.

Best, Iris

Thanks Iris, I won’t spend any more time banging my head on trying to figure this out.

Cheers, Steve

1 Like

Hi Iris,

I have a quick follow-up

Any way to use the color appender to do something like this, perhaps with a few intermediate steps? I saw one post that seems to indicate this might be possible, but there was not enough detail for me to follow:

Thanks

Steve

1 Like

Ha! One never stops learning (I mean myself)

If I use the Custom option I get one flow variable for each of my values in the column.
image

I I extract those as flow variables I can reuse them in another Color Manager to control these values. And this works.

So you would now need to generate this integers based on the colors you would like to have (This must be some RGB function, I can ask for more details) and than you would be able to define the value for a certain parameter per flow variable.

Is this helpful? I guess you would still miss the option to have changing domain values?

5 Likes

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