Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save All Layers - colormap IMC not found #22

Open
StefanosVoglis opened this issue Jan 21, 2022 · 1 comment
Open

Save All Layers - colormap IMC not found #22

StefanosVoglis opened this issue Jan 21, 2022 · 1 comment
Assignees

Comments

@StefanosVoglis
Copy link

When trying to save multiple layers which were adjusted using napari-imc, error "colormap name IMC not found" appears.

File ~\anaconda3\envs\napari-env\lib\site-packages\napari_svg\layer_to_xml.py:110, in image_to_xml(data=<class 'numpy.ndarray'> (1000, 1000) float32, meta={'attenuation': 0.05, 'blending': 'additive', 'colormap': 'IMC', 'contrast_limits': [0.0, 15.112740308718573], 'experimental_clipping_planes': [], 'experimental_slicing_plane': {'enabled': False, 'normal': (1.0, 0.0, 0.0), 'position': (0.0, 0.0, 0.0), 'thickness': 1.0}, 'gamma': 1.0, 'interpolation': 'gaussian', 'iso_threshold': 0.5, 'metadata': {'channel': 'Vimenti_655((3791))Pt196', 'imc_acquisition_layer': True, 'imc_file_acquisition': r'\[path]i\imc_raw\2022011...w\20220112_SV_MelanomaBM_ImmunePanel_Test.mcd A17'}, ...})
    105     image = image / color_range
    107 # get colormap
    108 # TODO: Currently we only support vispy colormaps, need to
    109 # add support for all napari colormaps, matters for Labels too.
--> 110 cmap = get_colormap(colormap_name)
        colormap_name = 'IMC'
    112 # apply colormap to data
    113 mapped_image = cmap[image.ravel()]

File ~\anaconda3\envs\napari-env\lib\site-packages\vispy\color\colormap.py:1148, in get_colormap(name='IMC', *args=(), **kwargs={})
   1146         raise KeyError('colormap name %s not found' % name)
   1147 else:
-> 1148     raise KeyError('colormap name %s not found' % name)
        name = 'IMC'
        'colormap name %s not found' % name = 'colormap name IMC not found'
   1149 return cmap

KeyError: 'colormap name IMC not found'
@jwindhager
Copy link
Contributor

Thanks for reporting this - indeed, napari-imc uses custom colormaps, which currently aren't fully supported by napari. Unfortunately, there is no easy way to fix this. With the refactoring of napari-imc (see here), this will probably be addressed in Q3/Q4 2022.

@jwindhager jwindhager self-assigned this Jan 22, 2022
@jwindhager jwindhager added the bug Something isn't working label Jan 22, 2022
@jwindhager jwindhager removed the bug Something isn't working label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants