fix(seg): Enhance segmentation tools and UI, refactor code, and update dependencies (#4915)
This commit is contained in:
1 parent
1dc00d3030
commit
8432d5f633
37 files changed
+1063
-1122
No files matched your search
@@ -602,10 +602,16 @@ class SegmentationService extends PubSubService {
|
||||
const segments: { [segmentIndex: string]: cstTypes.Segment } = {};
|
||||
let segmentsCachedStats = {};
|
||||
|
||||
// Create colorLUT array for RT structures
|
||||
const colorLUT = [[0, 0, 0, 0]]; // First entry is transparent for index 0
|
||||
|
||||
// Process each segment similarly to the SEG function
|
||||
for (const rtStructData of allRTStructData) {
|
||||
const { data, id, color, segmentIndex, geometryId } = rtStructData;
|
||||
|
||||
// Add the color to the colorLUT array
|
||||
colorLUT.push(color);
|
||||
|
||||
try {
|
||||
const geometry = await geometryLoader.createAndCacheGeometry(geometryId, {
|
||||
geometryData: {
|
||||
@@ -647,6 +653,11 @@ class SegmentationService extends PubSubService {
|
||||
}
|
||||
}
|
||||
|
||||
// Create and register the colorLUT
|
||||
const colorLUTIndex = getNextColorLUTIndex();
|
||||
addColorLUT(colorLUT, colorLUTIndex);
|
||||
this._segmentationIdToColorLUTIndexMap.set(segmentationId, colorLUTIndex);
|
||||
|
||||
// Assign processed segments to segmentation config
|
||||
segmentation.config.segments = segments;
|
||||
|
||||
|
||||
Reference in new issue
Block a user