Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
144845c
fix: remove unused attribute
Alorcus Dec 13, 2023
8f3744d
feat: add annotationTask, annotation and annotationData
Alorcus Dec 13, 2023
39337de
add: DVReviewTask and Strategy (boilerplate)
Alorcus Dec 18, 2023
e8b5973
chg: file structure
Alorcus Dec 18, 2023
3931466
add: DVBackend (boilerplate)
Alorcus Dec 18, 2023
0673144
Merge branch 'develop-annotation-service' into 566-integration-of-vis…
Alorcus Jan 17, 2024
a3475cf
add: remainder of dv schema
Alorcus Jan 17, 2024
db51c09
UNDO THIS COMMIT BEFORE PR! add: example files
Alorcus Jan 17, 2024
21bc212
add: remaining attributes for schema export
Alorcus Jan 17, 2024
73bb97b
chg: DvAnnotationGroup to DvAnnotationLayer, extended DV file structure
Alorcus Jan 21, 2024
64822e8
add: zip ending recognition
Alorcus Jan 22, 2024
ee2fffe
add DV Strategy to root store
Alorcus Jan 29, 2024
27f8b99
chg: extend file-types by DvMetadata
Alorcus Feb 5, 2024
fcd5e6d
add: loadTaskPostProcessing
Alorcus Feb 5, 2024
704c5ac
Merge branch 'develop-annotation-service' into 566-integration-of-vis…
Alorcus Feb 5, 2024
b3b83d1
add: layerRoisEntry
Alorcus Feb 5, 2024
579edee
add: drawROIS to post processing
Alorcus Feb 5, 2024
1812a61
add: fillROI to post processing
Alorcus Feb 5, 2024
9c0fb5f
chg: use specified color, remove default group
Alorcus Feb 5, 2024
8878f94
add: import example
Alorcus Feb 5, 2024
85db549
add: document parameter to function save Task
Alorcus Feb 6, 2024
11ac43d
chg: generalization of the constructors
Alorcus Feb 6, 2024
e330497
add: export of DvTask
Alorcus Feb 6, 2024
774cb1d
add: 'generate' annotation ids for new layers
Alorcus Feb 6, 2024
b5b7fbd
chg: export rois from all slices
Alorcus Feb 8, 2024
7647230
add: export of layer color
Alorcus Feb 8, 2024
0f8b8cd
chg: cleanup
Alorcus Feb 8, 2024
8cfd6bf
Merge branch 'develop-annotation-service' into 566-integration-of-vis…
Alorcus Feb 8, 2024
d30a731
chg: clean up no. 2
Alorcus Feb 8, 2024
aa3fee0
fix: linting issues
Alorcus Feb 12, 2024
87cd0b1
fix: linting issues
Alorcus Feb 14, 2024
ff3d38e
fix: linting issues
Alorcus Feb 14, 2024
ab56144
chg: ReviewTask to generic ReviewTask in ReviewStrategy
Alorcus Feb 14, 2024
c437417
chg: rename dvTask to dvAnnotationTask
Alorcus Feb 14, 2024
22fa3b8
Update libs/utils/src/lib/backend/dv/types/annotationLayer.ts
Alorcus Feb 14, 2024
4b36b01
Merge branch '566-integration-of-visian-into-dv' of https://github.co…
Alorcus Feb 14, 2024
dfacfbd
chg: constructer of dv objects
Alorcus Feb 14, 2024
c50a269
fix: import of Rois class
Alorcus Feb 14, 2024
fa3df48
chg: make method not abstract
Alorcus Feb 14, 2024
244dc20
chg: rename and small adjustments
Alorcus Feb 14, 2024
f1bec14
chg: method order
Alorcus Feb 14, 2024
f4b3d51
fix: linting issue
Alorcus Feb 14, 2024
1e6f908
fix: text overflow from page title, grid and list view items
Alorcus Nov 8, 2023
08b491b
refactor: move CSS to general text, renamed components
Alorcus Nov 15, 2023
ddf8736
fix: overflow of confirmation popup
Alorcus Jan 15, 2024
698b4de
build: add opencv.js dependency
TimRiedel Jan 25, 2024
9ff649d
feat: fill contours of annotation slices (incl. donut shape)
TimRiedel Jan 25, 2024
10c33d0
fix: fill roi contours without a child contour
TimRiedel Jan 27, 2024
f675ab7
feat: find contours in annotation slice and return them as points
TimRiedel Jan 27, 2024
0f38e03
feat: draw contours from an array of coordinates
TimRiedel Jan 27, 2024
fa71c29
build: fix webpack 5 incompatibility for crypto and stream after addi…
TimRiedel Feb 4, 2024
9ae3820
docs: add donut shape edge case to roi converter method description
TimRiedel Feb 4, 2024
dcf65dd
add: layerRoisEntry
Alorcus Feb 5, 2024
7b8a451
add: drawROIS to post processing
Alorcus Feb 5, 2024
344747c
add: fillROI to post processing
Alorcus Feb 5, 2024
1f94891
chg: use specified color, remove default group
Alorcus Feb 5, 2024
4e88ad5
add: import example
Alorcus Feb 5, 2024
3848f55
add: document parameter to function save Task
Alorcus Feb 6, 2024
7ff9661
chg: generalization of the constructors
Alorcus Feb 6, 2024
ca52344
add: export of DvTask
Alorcus Feb 6, 2024
1c4aea0
add: 'generate' annotation ids for new layers
Alorcus Feb 6, 2024
6521914
chg: export rois from all slices
Alorcus Feb 8, 2024
b571d94
add: export of layer color
Alorcus Feb 8, 2024
fb683b7
chg: cleanup
Alorcus Feb 8, 2024
9d309aa
fix: add missing maxLength to project and dataset inputs
richartkeil Feb 5, 2024
fe9d4f9
chg: clean up no. 2
Alorcus Feb 8, 2024
2618609
fix: linting issues
Alorcus Feb 12, 2024
0aab42f
fix: linting issues
Alorcus Feb 14, 2024
d23cf33
fix: linting issues
Alorcus Feb 14, 2024
65249b8
chg: ReviewTask to generic ReviewTask in ReviewStrategy
Alorcus Feb 14, 2024
e9343c5
chg: rename dvTask to dvAnnotationTask
Alorcus Feb 14, 2024
a6907b8
Update libs/utils/src/lib/backend/dv/types/annotationLayer.ts
Alorcus Feb 14, 2024
5d59873
chg: constructer of dv objects
Alorcus Feb 14, 2024
2be2a09
fix: import of Rois class
Alorcus Feb 14, 2024
cbd5f81
chg: make method not abstract
Alorcus Feb 14, 2024
e68de9c
chg: rename and small adjustments
Alorcus Feb 14, 2024
df8914a
chg: method order
Alorcus Feb 14, 2024
26f59bf
fix: linting issue
Alorcus Feb 14, 2024
95b77fc
Merge branch '566-integration-of-visian-into-dv' of https://github.co…
Alorcus Feb 19, 2024
d39d335
refactor: rename and document DV classes
TimRiedel Feb 19, 2024
6e5e4a3
refactor: rename variables and functions in DV review task
TimRiedel Feb 19, 2024
772f00e
refactor: mirror dv rois for import and export
TimRiedel Feb 19, 2024
6e219fd
refactor: make contours of slice private
TimRiedel Feb 20, 2024
1df633e
docs: add documentation for review strategy and review task
TimRiedel Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/editor/src/app/root-store.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { i18n, LocalForageBackend } from "@visian/ui-shared";
import { isFromWHO, readFileFromURL } from "@visian/utils";
import { isFromDV, isFromWHO, readFileFromURL } from "@visian/utils";
import React from "react";

import { storePersistInterval } from "../constants";
import { RootStore } from "../models";
import { WHOReviewStrategy } from "../models/review-strategy";
import { DVReviewStrategy } from "../models/review-strategy/dv-review-strategy";

export const storageBackend = new LocalForageBackend(
storePersistInterval,
Expand Down Expand Up @@ -59,6 +60,11 @@ export const setupRootStore = async () => {
store.setReviewStrategy(new WHOReviewStrategy({ store }));
store.reviewStrategy?.loadTask();
}

if (isFromDV()) {
store.setReviewStrategy(new DVReviewStrategy({ store }));
store.reviewStrategy?.loadTask();
}
})();

window.addEventListener("beforeunload", (event) => {
Expand Down
14 changes: 8 additions & 6 deletions apps/editor/src/components/editor/review-bar/review-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,14 @@ export const MiaReviewBar = observer(
onPointerDown={previousTask}
/>
)}
<ActionButtons
icon="arrowForward"
tooltipTx="next-task-tooltip"
tooltipPosition="top"
onPointerDown={nextTask}
/>
{store?.reviewStrategy?.supportsNextTask && (
<ActionButtons
icon="arrowForward"
tooltipTx="next-task-tooltip"
tooltipPosition="top"
onPointerDown={nextTask}
/>
)}
</ReviewToolsContainer>
</ReviewContainer>
</ReviewBarSheet>
Expand Down
5 changes: 5 additions & 0 deletions apps/editor/src/models/editor/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ export class Document
}
};

public removeAnnotationGroup = (group: AnnotationGroup): void => {
const index = this.layerIds.indexOf(group.id);
this.layerIds.splice(index, 1);
};

public getFirstUnusedColor = (
defaultColor = defaultAnnotationColor,
): string => {
Expand Down
85 changes: 85 additions & 0 deletions apps/editor/src/models/review-strategy/dv-review-strategy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { getDvAnnotationTask, getTaskIdFromUrl } from "@visian/utils";

import { RootStore } from "../root";
import { DVReviewTask } from "./dv-review-task";
import { ReviewStrategy } from "./review-strategy";
import { ReviewStrategySnapshot } from "./review-strategy-snapshot";

export class DVReviewStrategy extends ReviewStrategy<DVReviewTask> {
public static fromSnapshot(
store: RootStore,
snapshot?: ReviewStrategySnapshot,
) {
if (!snapshot) return undefined;
if (snapshot.backend === "dv") {
return new DVReviewStrategy({
store,
currentReviewTask: snapshot.currentReviewTask
? DVReviewTask.fromSnapshot(snapshot.currentReviewTask)
: undefined,
});
}
return undefined;
}

constructor({
store,
currentReviewTask,
}: {
store: RootStore;
currentReviewTask?: DVReviewTask;
}) {
super({ store });
if (currentReviewTask) this.setCurrentTask(currentReviewTask);
}

public supportsPreviousTask(): boolean {
return false;
}

public supportsNextTask(): boolean {
return false;
}

public async nextTask(): Promise<void> {
throw new Error("Next task is not implemented in the DV strategy!");
}

public async previousTask() {
throw new Error("Previous task is not implemented in the DV strategy!");
}

public async saveTask(): Promise<void> {
this.currentTask?.save(this.getDocument());
}

protected async buildTask() {
const taskId = getTaskIdFromUrl();
if (!taskId) throw new Error("No DV task specified in URL.");

const dvAnnotationTask = await getDvAnnotationTask(taskId);

if (!dvAnnotationTask) throw new Error("DV Task not found.");
this.setCurrentTask(new DVReviewTask(dvAnnotationTask));
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
protected async importAnnotations(): Promise<void> {}

public postProcessLoadedTask(): void {
const document = this.getDocument();
if (this.currentTask) {
this.currentTask.addGroupsAndLayers(document);
}
document.requestSave();
}

public toJSON(): ReviewStrategySnapshot {
return {
backend: "dv",
currentReviewTask: this.currentTask
? this.currentTask.toJSON()
: undefined,
};
}
}
Loading