File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ import {
66 annotations ,
77 boundingBoxes ,
88 fixations ,
9+ selectedAlgorithm ,
910 selectedFixation
1011} from '../data' ;
12+ import type {
13+ AnnotationDto
14+ } from '@/types/dtos/AnnotationDto' ;
1115import type {
1216 AnnotationSessionDto
1317} from '@/types/dtos/AnnotationSessionDto' ;
@@ -84,6 +88,27 @@ export const loadEditorDataFromBackend = async ( renderer: Renderer ) => {
8488 // NOTE: To use other disagreement measures, compute here
8589 } ) ;
8690
91+ // Load additional algorithmic assignments
92+ const additionalAnnotationLoad = sessionData . value . inactiveMachineAnnotations ! ;
93+
94+ if ( additionalAnnotationLoad ) {
95+ selectedAlgorithm . value = 0 ;
96+ const algos = Object . keys ( additionalAnnotationLoad ) ;
97+
98+ algos . forEach ( algo => {
99+ const details = additionalAnnotationLoad [ algo ] ! as AnnotationDto ;
100+ const ann : EditorAnnotation = {
101+ 'fixationId' : getFixIdxFromId ( details . fixation ! . id ! ) ,
102+ 'boxId' : getBoxIdxFromId ( details . characterBoundingBox ! . id ! ) ,
103+ 'algorithm' : algo
104+ } ;
105+
106+ fixations . value [ ann . fixationId ] ! . assigned = details . annotationType === 'ANNOTATED' ? 'assigned' : 'machine' ;
107+
108+ annotations . value . push ( ann ) ;
109+ } ) ;
110+ }
111+
87112 selectedFixation . value = 0 ;
88113
89114 // If none found that is unassigned, annotation is soft complete
You can’t perform that action at this time.
0 commit comments