Fix/duplicate redundant log measurement mapping (#5760)

* Remove all but one log message for mappings.

* fix: NPE when no segmentations list returned.
This commit is contained in:
Bill Wallace 2026-01-30 11:16:37 -05:00 committed by GitHub
parent a4c99e6926
commit 5807889f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -129,7 +129,7 @@ const CornerstoneViewportDownloadForm = ({
downloadViewport.setVolumes([{ volumeId: volumeIds[0] }]);
}
if (segmentationRepresentations.length > 0) {
if (segmentationRepresentations?.length) {
segmentationRepresentations.forEach(segRepresentation => {
const { segmentationId, colorLUTIndex, type } = segRepresentation;
if (type === Enums.SegmentationRepresentations.Labelmap) {

View File

@ -102,6 +102,8 @@ enum MeasurementChangeType {
export type MeasurementFilter = (measurement) => boolean;
const sourceMissing = new Set();
/**
* MeasurementService class that supports source management and measurement management.
* Sources can be any library that can provide "annotations" (e.g. cornerstone-tools, cornerstone, etc.)
@ -497,7 +499,10 @@ class MeasurementService extends PubSubService {
mapping => mapping.annotationType === annotationType
);
if (!sourceMapping) {
console.log('No source mapping', source.uid, annotationType, source);
if (!sourceMissing.has(source.uid) ) {
console.log('No source mapping', source.uid, annotationType, source);
sourceMissing.add(source.uid);
}
this.addUnmappedMeasurement(sourceAnnotationDetail, source);
return;
}