pauldmccarthy / fsleyes

This is a mirror. Feel free to use the issue tracker. PRs welcome.
https://git.fmrib.ox.ac.uk/fsl/fsleyes/fsleyes/
Other
22 stars 11 forks source link

KeyError: 'fsleyes_pink' #120

Closed nmossazg12 closed 4 months ago

nmossazg12 commented 1 year ago

HI,

We installed fsleyes by installing the fsl in both mac and windows. When we try to open fsleyes, we receive the following error. Furthermore, even if fsleyes opens, the interface misses a lot of the features such as brightness, contrast (screenshot included below). I was wondering if you could help me figure out the issue.

Thank you OS = Windows 10 Installed the FSL using Windows Linux Subsystem (Ubuntu 20.04) `

ValueError: 'fsleyes_pink' is not in list During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/callqueue.py", line 222, in call call.func(*call.args, **call.kwargs) File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes/controls/overlaydisplaytoolbar.py", line 240, in selectedOverlayChanged self.showTools(overlay) File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes/controls/overlaydisplaytoolbar.py", line 181, in showTools optsTools, optsNav = makeFunc(opts) ^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes/controls/overlaydisplaytoolbar.py", line 351, in __makeVolumeOptsTools cmapWidget = props.buildGUI(cmapPanel, opts, cmapSpec) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/build.py", line 1018, in buildGUI mainPanel = _create(parentObj, view, hasProps, propGui) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/build.py", line 780, in _create guiObject = createFunc(parent, viewItem, hasProps, propGui) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/build.py", line 474, in _createWidget widget = widgets.makeWidget( parent, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/widgets.py", line 782, in makeWidget return makeFunc(parent, hasProps, propObj, propVal, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/widgets.py", line 664, in _ColourMap cmapsChanged() File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes_props/widgets.py", line 636, in cmapsChanged name = labels(cmap.name) ^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes/colourmaps.py", line 745, in getColourMapLabel return _caseInsensitiveLookup(_cmaps, key).name ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/nmossazg/fsl/lib/python3.11/site-packages/fsleyes/colourmaps.py", line 1265, in _caseInsensitiveLookup else: raise KeyError(k) ^^^^^^^^^^^^^^^^^^ KeyError: 'fsleyes_pink'

` fdd

pauldmccarthy commented 1 year ago

Hi @nmossazg12, you should be able to resolve this by downgrading your version of matplotlib with a command such as:

$FSLDIR/bin/mamba install -n base matplotlib-base="3.7"

The matplotlib colormaps API has changed in the last two minor versions (3.7 and 3.8), and has broken FSLeyes on both occasions. I have updated the FSLeyes code base so that this will hopefully not happen again, but have not yet had time to release a new version of FSLeyes - I'll hopefully have time next week.

nmossazg12 commented 1 year ago

Hi @pauldmccarthy, Downgrading to matplotlib 3.7 did the trick.

Thanks