All files / extensions/cornerstone-dicom-seg/src/utils dicomlabToRGB.ts

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                555x   185x        
import dcmjs from 'dcmjs';
 
/**
 * Converts a CIELAB color to an RGB color using the dcmjs library.
 * @param cielab - The CIELAB color to convert.
 * @returns The RGB color as an array of three integers between 0 and 255.
 */
function dicomlabToRGB(cielab: number[]): number[] {
  const rgb = dcmjs.data.Colors.dicomlab2RGB(cielab).map(x => Math.round(x * 255));
 
  return rgb;
}
 
export { dicomlabToRGB };