feat: Automate tracking prompts for a less disruptive annotation workflow (#4822)
Co-authored-by: Devu Jayalekshmi <devu.jayalekshmi@trenser.com>
This commit is contained in:
1 parent
c0391cea1b
commit
54fded554e
42 files changed
+948
-70
No files matched your search
@@ -64,6 +64,7 @@ const MEASUREMENT_SCHEMA_KEYS = [
|
||||
'isSelected',
|
||||
'textBox',
|
||||
'referencedImageId',
|
||||
'isDirty',
|
||||
];
|
||||
|
||||
const EVENTS = {
|
||||
@@ -92,6 +93,11 @@ const VALUE_TYPES = {
|
||||
ROI_THRESHOLD_MANUAL: 'value_type::roiThresholdManual',
|
||||
};
|
||||
|
||||
enum MeasurementChangeType {
|
||||
HandlesUpdated = 'HandlesUpdated',
|
||||
LabelChange = 'LabelChange',
|
||||
}
|
||||
|
||||
export type MeasurementFilter = (measurement) => boolean;
|
||||
|
||||
/**
|
||||
@@ -121,6 +127,7 @@ class MeasurementService extends PubSubService {
|
||||
|
||||
private measurements = new Map();
|
||||
private unmappedMeasurements = new Map();
|
||||
private isMeasurementDeletedIndividually: boolean;
|
||||
|
||||
private sources = {};
|
||||
private mappings = {};
|
||||
@@ -543,6 +550,11 @@ class MeasurementService extends PubSubService {
|
||||
uid: internalUID,
|
||||
};
|
||||
|
||||
newMeasurement.isDirty =
|
||||
sourceAnnotationDetail.changeType === MeasurementChangeType.HandlesUpdated ||
|
||||
sourceAnnotationDetail.changeType === MeasurementChangeType.LabelChange ||
|
||||
oldMeasurement?.isDirty;
|
||||
|
||||
if (oldMeasurement) {
|
||||
// TODO: Ultimately, each annotation should have a selected flag right from the source.
|
||||
// For now, it is just added in OHIF here and in setMeasurementSelected.
|
||||
@@ -586,6 +598,7 @@ class MeasurementService extends PubSubService {
|
||||
|
||||
this.unmappedMeasurements.delete(measurementUID);
|
||||
this.measurements.delete(measurementUID);
|
||||
this.isMeasurementDeletedIndividually = true;
|
||||
this._broadcastEvent(this.EVENTS.MEASUREMENT_REMOVED, {
|
||||
source,
|
||||
measurement: measurementUID,
|
||||
@@ -839,6 +852,14 @@ class MeasurementService extends PubSubService {
|
||||
notYetUpdatedAtSource: true,
|
||||
});
|
||||
}
|
||||
|
||||
public setIsMeasurementDeletedIndividually = isDeletedIndividually => {
|
||||
this.isMeasurementDeletedIndividually = isDeletedIndividually;
|
||||
};
|
||||
|
||||
public getIsMeasurementDeletedIndividually = () => {
|
||||
return this.isMeasurementDeletedIndividually;
|
||||
};
|
||||
}
|
||||
|
||||
export default MeasurementService;
|
||||
|
||||
@@ -7,6 +7,7 @@ class ViewportGridService extends PubSubService {
|
||||
GRID_STATE_CHANGED: 'event::gridStateChanged',
|
||||
GRID_SIZE_CHANGED: 'event::gridSizeChanged',
|
||||
VIEWPORTS_READY: 'event::viewportsReady',
|
||||
VIEWPORT_ONDROP_HANDLED: 'event::viewportOnDropHandled',
|
||||
};
|
||||
|
||||
public static REGISTRATION = {
|
||||
@@ -141,6 +142,10 @@ class ViewportGridService extends PubSubService {
|
||||
this._broadcastEvent(this.EVENTS.VIEWPORTS_READY, {});
|
||||
}
|
||||
|
||||
public publishViewportOnDropHandled(eventData) {
|
||||
this._broadcastEvent(this.EVENTS.VIEWPORT_ONDROP_HANDLED, { eventData });
|
||||
}
|
||||
|
||||
public setActiveViewportId(id: string) {
|
||||
if (id === this.getActiveViewportId()) {
|
||||
return;
|
||||
|
||||
@@ -114,6 +114,7 @@ declare global {
|
||||
days?: number;
|
||||
};
|
||||
groupEnabledModesFirst?: boolean;
|
||||
measurementTrackingMode?: 'standard' | 'simplified' | 'none';
|
||||
disableConfirmationPrompts?: boolean;
|
||||
showPatientInfo?: 'visible' | 'visibleCollapsed' | 'disabled' | 'visibleReadOnly';
|
||||
requestTransferSyntaxUID?: string;
|
||||
|
||||
Reference in new issue
Block a user