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

[Bug] Colormap.name or Colormap.Name ? #1766

Open
salimkanoun opened this issue Jan 18, 2025 · 1 comment
Open

[Bug] Colormap.name or Colormap.Name ? #1766

salimkanoun opened this issue Jan 18, 2025 · 1 comment
Assignees
Labels
bug verified Something isn't working, verified by maintainers

Comments

@salimkanoun
Copy link
Contributor

Describe the Bug

It seems there are messy proprieties in colomap definitions,

When registering a colomap the typing of colomap is :
function registerColormap(colormap: ColormapRegistration): void;

interface ColormapRegistration { ColorSpace: string; Name: string; RGBPoints: RGB[] | number[]; }

In ohif colormap defined both name and Name proprieties as well as NanColor and Description which are not in ColormapRegistration typing :
{
ColorSpace: 'RGB',
Name: 'Grayscale',
name: 'Grayscale',
NanColor: [1, 0, 0],
RGBPoints: [0, 0, 0, 0, 1, 1, 1, 1],
description: 'Grayscale',
},

https://github.com/OHIF/Viewers/blob/27c040fdda060bc18e38bd8f27150bd089bd0836/extensions/cornerstone/src/utils/colormaps.js#L2-L3

In the current version, when registering a colormap following the ColormapRegistration type, there is an error while trying to set a colormap to stack viewport

TypeError: Cannot read properties of undefined (reading 'ColorSpace')
at e.applyColorMap (ColorTransferFunction.js:1112:18)
at ye.setColormapGPU (StackViewport.js:1845:33)
at ye.setProperties (StackViewport.js:607:18)
at setViewportColormap (commandsModule.ts:407:18)

this call of vtk seems to send a undefined colormap : rgbTransferFunction.applyColorMap(colormapObj);

I didn't found exactly what happens but there is sometring strange that OHIF colormap registration is not follwoing PublicColormap typing with duplicate Name and name proprieties

Steps to Reproduce

Code constancy issue

The current behavior

Code constancy issue

The expected behavior

Code constancy issue

OS

Linux

Node version

20

Browser

chrome latest

Copy link
Member

sedghi commented Jan 22, 2025

Seems like this is similar to hanging Protocols that have name and id 🙁

@sedghi sedghi added the bug verified Something isn't working, verified by maintainers label Jan 22, 2025 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug verified Something isn't working, verified by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants