-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(segmentation): make segmentation read 3x faster (#3577)
- Loading branch information
Showing
17 changed files
with
185 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
extensions/cornerstone-dicom-seg/src/utils/dicomlabToRGB.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.