ome / omero-iviewer

An OMERO.web app allowing to view images
https://www.openmicroscopy.org/omero/iviewer/
Other
18 stars 29 forks source link

ROI palette configs #411

Closed barrettMCW closed 2 years ago

barrettMCW commented 2 years ago

I added some configs to access the spectrum color picker options for palettes. Updated readme to reflect. Fits ~ 8 palette options but continues to grow if admin wants to push it a bit. We can ignore package-lock right? Lmk if there's any cleaning I can do or changes to make.

barrettMCW commented 2 years ago

I fixed the 4 reported flake complaints, that's all it's mad about right? Is there a way to see the other 12?

will-moore commented 2 years ago

Hi, when I try to start omero-web I get

File "/Users/wmoore/Desktop/WEB/omero-web/omeroweb/settings.py", line 1347, in process_custom_settings
    setattr(module, global_name, mapping(global_value))
TypeError: array() argument 1 must be a unicode character, not str

Instead of array in the settings.py, you need import json and json.loads which will convert the string into a list.

         ["COLOR_PALETTE",
          "[]",
-         array,
+         json.loads,
          ("Set of predefined color options for drawing rois"
           "Accepts most ways to define a color"

Then your config command should be a single list (in your example you had multiple []: e.g.

$ omero config set omero.web.iviewer.color_palette '["rgb(1,1,0)","#ff00ff"]'

However, when I make these changes, I'm not seeing any difference in the color-picker.

Can you describe what the expected change looks like? Are you running this locally in your omero-web install?

$ npm run prod    # builds js
$ cd plugin
$ pip install -e .
$ omero config append omero.web.apps '"omero_iviewer"'
... etc.
barrettMCW commented 2 years ago

Dang, sorry fellas. Should I take this pr down till I get around to fixing it properly? As for what it's supposed to do, https://bgrins.github.io/spectrum/#options-showPalette is more or less what I'm going for. You define rows and columns with the brackets. ( any ideas on a good data type for that? ) I've just been running npm debug and npm dev, so I'll be sure to test it on omero web next time.

will-moore commented 2 years ago

Ah, OK. So use json.loads and do

omero config set omero.web.iviewer.color_palette '[["black", "white", "blanchedalmond"], ["rgb(255, 128, 0);", "hsv 100 70 50", "lightyellow"]]'