Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c4ba568
WIP: add logging for number of updated buckets
knollengewaechs Sep 29, 2025
f6074a1
include more logging
knollengewaechs Sep 29, 2025
98d45b2
update auto save time
knollengewaechs Sep 29, 2025
cfae01d
revert some changes
knollengewaechs Sep 29, 2025
425959b
add toast when more than 4k buckets are in pushqueeue
knollengewaechs Sep 30, 2025
5819d92
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Sep 30, 2025
683849c
fix typo
knollengewaechs Sep 30, 2025
fa10734
add docs for mag restrictions
knollengewaechs Sep 30, 2025
461fc7a
revert dev changes
knollengewaechs Oct 6, 2025
a5fbb91
move code to save_queue
knollengewaechs Oct 6, 2025
18fc591
undo rename
knollengewaechs Oct 6, 2025
977f391
remove console.log
knollengewaechs Oct 6, 2025
2012b1b
save intermediate result before moving stuff to data_cube
knollengewaechs Oct 7, 2025
63c6332
to be reverted: check total number of buckets
knollengewaechs Oct 7, 2025
c956a5b
move code from data_cube to save_queue_draining
knollengewaechs Oct 7, 2025
38df61b
dispatch actions in pushqueue and consume in save_saga
knollengewaechs Oct 7, 2025
63129bb
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Oct 8, 2025
9e916a2
WIP: start to implement modal
knollengewaechs Oct 8, 2025
fd7e73c
extract toast
knollengewaechs Oct 8, 2025
a9aa7ad
turn toast into modal and dispatch action to open it
knollengewaechs Oct 9, 2025
a9165c5
move warning value to application.conf
knollengewaechs Oct 9, 2025
c6af70d
make warning toast a react component, fix functionality within toast
knollengewaechs Oct 9, 2025
f8bf436
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Oct 9, 2025
613f58b
add styling to toast
knollengewaechs Oct 10, 2025
9f22533
refresh snapshot
knollengewaechs Oct 10, 2025
1696a6b
fix tests
knollengewaechs Oct 10, 2025
b68663f
change time interval for bucket check to 120s
knollengewaechs Oct 10, 2025
3a1463f
fix time intervals and remove some dev changes
knollengewaechs Oct 10, 2025
dc774c1
improve time intervals
knollengewaechs Oct 10, 2025
1edc7e8
remember closing modal in session
knollengewaechs Oct 10, 2025
64093d5
fix time interval
knollengewaechs Oct 10, 2025
b00c9c9
fix checkbox
knollengewaechs Oct 13, 2025
5a7d667
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Oct 13, 2025
401e815
re-add activeUser to e2e snapshots
fm3 Oct 14, 2025
87e68b5
update text
knollengewaechs Oct 14, 2025
3f61c1a
update button test
knollengewaechs Oct 14, 2025
658c788
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Oct 17, 2025
7411227
improve naming and remove magic numbers
knollengewaechs Oct 17, 2025
2fcf0b9
Merge branch 'master' into encourage-coarser-mags-for-large-volume-an…
knollengewaechs Oct 21, 2025
8425875
fix typo
knollengewaechs Oct 21, 2025
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
17 changes: 16 additions & 1 deletion docs/volume_annotation/import_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,19 @@ After finishing the annotation of a volume layer with a fallback layer, the comb
Icon to open the materialize volume annotation dialog
///

This button opens up a dialog that starts a long-running job which will materialize the volume annotation.
This button opens up a dialog that starts a long-running job which will materialize the volume annotation.

## Restricting magnifications

WEBKNOSSOS allows data annotation in different magnifications.
Restricting the available magnifications can greatly improve the performance when annotating large structures, such as nuclei, since the volume data does not need to be stored in all quality levels.
How to read: Mag 1 is the most detailed, 4-4-2 is downsampled by factor 4 in x and y, and by factor 2 in z.
When annotating large structures, consider restricting the available magnifications in this specific annotation or in this volume annotation layer.

### Restricting magnifications for a whole annotation

Go to the dataset dashboard. Click on the three dots next to `New Annotation` for the dataset you want to annotate. Use the slider to restrict the volume magnifications, e.g. by omitting the finest magnification, which is usually 1-1-1, or the two finest magnifications.

### Restricting magnifications for volume annotation layers

Within an existing annotation, go to the `Layers` tab on the left. Click `Add Volume Annotation Layer` at the bottom of the list of all layers in this annotation. Restrict the magnifications as explained above.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from "../volume/proofread_saga";
import { pushSaveQueueAsync } from "./save_queue_draining";
import { setupSavingForAnnotation, setupSavingForTracingType } from "./save_queue_filling";
import { BUCKET_COUNT_PER_SAVE_WARNING_THRESHOLD } from "./save_saga_constants";

export function* setupSavingToServer(): Saga<void> {
// This saga continuously drains the save queue by sending its content to the server.
Expand All @@ -31,6 +32,7 @@ export function* setupSavingToServer(): Saga<void> {
yield* takeEvery("INITIALIZE_ANNOTATION_WITH_TRACINGS", setupSavingForAnnotation);
yield* takeEveryWithBatchActionSupport("INITIALIZE_SKELETONTRACING", setupSavingForTracingType);
yield* takeEveryWithBatchActionSupport("INITIALIZE_VOLUMETRACING", setupSavingForTracingType);
yield* takeEvery("WK_READY", checkNumberOfBucketsInQueue);
}

const VERSION_POLL_INTERVAL_COLLAB = 10 * 1000;
Expand Down Expand Up @@ -137,23 +139,6 @@ function* watchForSaveConflicts(): Saga<void> {
return false;
}

function* getPollInterval(): Saga<number> {
const allowSave = yield* select((state) => state.annotation.restrictions.allowSave);
if (!allowSave) {
// The current user may not edit/save the annotation.
return VERSION_POLL_INTERVAL_READ_ONLY;
}

const othersMayEdit = yield* select((state) => state.annotation.othersMayEdit);
if (othersMayEdit) {
// Other users may edit the annotation.
return VERSION_POLL_INTERVAL_COLLAB;
}

// The current user is the only one who can edit the annotation.
return VERSION_POLL_INTERVAL_SINGLE_EDITOR;
}

yield* call(ensureWkReady);

while (true) {
Expand Down Expand Up @@ -184,6 +169,62 @@ function* watchForSaveConflicts(): Saga<void> {
}
}

function* getPollInterval(): Saga<number> {
const allowSave = yield* select((state) => state.annotation.restrictions.allowSave);
if (!allowSave) {
// The current user may not edit/save the annotation.
return VERSION_POLL_INTERVAL_READ_ONLY;
}

const othersMayEdit = yield* select((state) => state.annotation.othersMayEdit);
if (othersMayEdit) {
// Other users may edit the annotation.
return VERSION_POLL_INTERVAL_COLLAB;
}

// The current user is the only one who can edit the annotation.
return VERSION_POLL_INTERVAL_SINGLE_EDITOR;
}

function* checkNumberOfBucketsInQueue(): Saga<void> {
//yield* call(ensureWkReady);
while (true) {
console.log("Checking number of buckets in save queue...");
const interval = yield* call(getPollInterval);
yield* call(sleep, interval);
const saveQueue = yield* select((state) => state.save.queue); //TODO_C remove
const saveQueueLength = yield* select((state) => {
return state.save.queue.reduce(
(sum, queueEntry) =>
sum + queueEntry.actions.filter((action) => action.name === "updateBucket").length,
0,
);
});

if (saveQueueLength > BUCKET_COUNT_PER_SAVE_WARNING_THRESHOLD) {
const warningMessage =
"You are annotating a large area which puts a high load on the server. Consider creating an annotation or annotation layer with restricted volume magnifications.";
const linkToDocs =
"https://docs.webknossos.org/volume_annotation/import_export.html#restricting-magnifications";
Toast.warning(
<>
{warningMessage}
<br />
See the{" "}
<a href={linkToDocs} target="_blank" rel="noopener noreferrer">
docs
</a>
.
</>,
{ sticky: true },
);
console.warn(warningMessage + " For more info, visit: " + linkToDocs);
}

console.log(`Save queue length: ${saveQueueLength}`, saveQueue);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dev change

}
}

export function* tryToIncorporateActions(
newerActions: APIUpdateActionBatch[],
): Saga<{ success: boolean }> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ export const MAXIMUM_ACTION_COUNT_PER_BATCH = 1000;
// mapping: Number.POSITIVE_INFINITY, // The back-end does not accept transactions for mappings.
// } as const;
export const MAXIMUM_ACTION_COUNT_PER_SAVE = 3000;

export const BUCKET_COUNT_PER_SAVE_WARNING_THRESHOLD = 4000;