Open SM-93 opened 3 years ago
That errror means that the return value of the callback for slicer2-overlay.data
(slicer2, not slicer1!) does not have the correct number of values. I think you should either remove the [ ]
around the Output
, or use return [slicer1.create_overlay_data(mask, colormap_gt)]
. That way the outputs should match.
Hi almarklein, I really appreciate you answering me, I tried as you said and it works! Quick question, when the callback is made, is there a way to actually assign certain label one particular color from the colormap ? My variable colormap_gt is a list of 9 hex colors.
Great!
is there a way to actually assign certain label one particular color from the colormap ?
Well, if you know that the pixels that have e.g. value 5 in the mask, you must make colormap[5]
the color you want. Is this what you meant?
Yeah definitely, I just thought that I had to do something else in the callback that is specific to the Dash for example. Thank you for taking the time to answer me.
Hi almarklein! I have one more question regarding colormaps. I don't understand why the colors change when displayed in the app, since I have different colors in my colormap. For example, one label is colored orange but I don't have even similar color to orange.
I would appreciate the help.
The colors of the mask should match the color in the colormap. However, the mask is semi-transparent, so the colors might appear slightly differently, especially if the underlying image has colors.
Ok, so it should remain the same. Well some colors displayed in the app are similar to mine ( i.e. more transparent). The underlying image is just grayscale, nothing more. Anyways, thank you for the help, I appreciate it.
Hi, I am trying to apply a colormap to already segmented images, i.e. I want to be able to color the labels when I change the slice index but I dont know how to incorporate input argument "value" in my function or do I even need that since I based my code on the example threshold_overlay.py but I don't need the contrast limit. This is the code snippet:
I have three Slicer objects and I want on the two of those three to color the labels. The thing is my mask is already defined, i.e. my segmented images with 8 possible values (from 1 through 8).
I would really appreciate if someone could help me with this.
When I run the app in the browser, it displays the error:
But my mask is already the same shape as the volume.