Skip to content

Editable Mappings aka Supervoxel Proofreading #6195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 148 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
e7f4438
[WIP] editable mappings
fm3 May 9, 2022
44234b8
query agglomerate skeleton
fm3 May 9, 2022
d9f1d18
first update actions
fm3 May 9, 2022
fbf1731
column families
fm3 May 9, 2022
a6b5c92
pipe update actions to fossildb
fm3 May 9, 2022
673eca2
logic for applying updates on load
fm3 May 9, 2022
13a9cee
some logic for gathering relevant ampping
fm3 May 10, 2022
8b85df7
some logic for generating skeleton
fm3 May 10, 2022
6bf30ba
logic for applying update actions in order
fm3 May 10, 2022
905ac1f
resolve segment position to segment id
fm3 May 10, 2022
ac30485
mapData
fm3 May 10, 2022
08861f3
fetch unmapped data from datastore
fm3 May 11, 2022
fff5f2a
bytes conversion
fm3 May 11, 2022
e13e474
fix unsigned int to long
fm3 May 11, 2022
2657d2b
apply merge update action
fm3 May 11, 2022
0a18d3e
split update action
fm3 May 11, 2022
5b4497e
enable bounding box tool in skeleton-only annotations
daniel-wer May 11, 2022
1728bea
avoid loading agglomerate skeletons twice
daniel-wer May 11, 2022
d02e74a
add proofread tool, add merge and split agglomerate update actions, c…
daniel-wer May 11, 2022
669c56c
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 11, 2022
043c6de
fix json serialization, create stubs for querying agglomerate graph +…
fm3 May 12, 2022
6bb4dcc
fix some naming, enable proofread saga
daniel-wer May 12, 2022
5fa65f4
Merge branch 'master' of github.com:scalableminds/webknossos into edi…
daniel-wer May 12, 2022
6c08821
in update actions, use positions and mag
fm3 May 16, 2022
744b2ef
fetch agglomerate ids for segment ids
fm3 May 16, 2022
f7c58f0
generate AgglomerateGraph from hdf file
fm3 May 16, 2022
1679d91
also send mag and agglomerate ids in editable mapping update actions
daniel-wer May 16, 2022
0fd6a24
include agglomerate id in skeleton uri, directly set editable mapping…
fm3 May 16, 2022
0ca7039
persist mappingName in volume annotation and restore mapping on load
daniel-wer May 16, 2022
aab8605
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 16, 2022
c78490f
make mapping editable, lazily (before first proofreading action)
daniel-wer May 16, 2022
1460852
add new save queue for mappings and improve save queue typing
daniel-wer May 16, 2022
cc06911
restructure routes for compatibility
fm3 May 17, 2022
fc33f9b
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 May 17, 2022
c719277
implement separate save queues for editable mappings, initialize and …
daniel-wer May 17, 2022
100b122
fix route, token and missing-buckets header parsing
fm3 May 17, 2022
2a4d6b7
fix editable mapping initialization
daniel-wer May 17, 2022
3c4ce1f
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 17, 2022
2e54995
updateEditableMapping takes list of groups
fm3 May 17, 2022
5e76f45
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 May 17, 2022
b87c73d
affinities are float
fm3 May 17, 2022
8cc7b78
load editable agglomerate skeleton from tracingstore
daniel-wer May 17, 2022
3b70b58
fix that source and target were in different trees
daniel-wer May 17, 2022
89c85c4
some backend fixes
fm3 May 17, 2022
1ff6716
Add logging, fix update action order, store as lists in fossildb
fm3 May 18, 2022
5a36465
agglomerate skeleton node ids start at one
fm3 May 18, 2022
c04e9bf
remap tree and node ids if there ids below the minimum
daniel-wer May 18, 2022
b5bc609
Merge branch 'master' of github.com:scalableminds/webknossos into edi…
daniel-wer May 18, 2022
1233b60
localize node ids in agglomerate skeleton
fm3 May 18, 2022
9ff2ec9
correctly set new mapping name after creating an editable mapping
daniel-wer May 18, 2022
3941a95
fix tests
daniel-wer May 18, 2022
b8e664b
allow to select nodes when proofread tool is active
daniel-wer May 18, 2022
4d1faac
cache materialized editable mappings
fm3 May 19, 2022
7d5fbee
speed up ci
fm3 May 19, 2022
370b6ad
[WIP] enable ad-hoc meshes for editable mapping annotations
fm3 May 19, 2022
387869b
depend only on the cache key
fm3 May 19, 2022
d2def9c
agglomerate graph resilience for agglomerate id 0
fm3 May 19, 2022
dc045a2
fix highest lowest resolution confusion
daniel-wer May 19, 2022
13c30fc
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 19, 2022
b07fff8
delete the edge even if one graph gets all nodes
fm3 May 19, 2022
1cb6c56
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 May 19, 2022
586b13d
Merge branch 'master' into editable-mappings
daniel-wer May 19, 2022
fdf1b35
Merge branch 'editable-mappings' into editable-mapping-meshes
fm3 May 23, 2022
0496ae4
editable mapping meshes
fm3 May 23, 2022
9133312
make isosurface service not strictly depend on agglomerate service
fm3 May 23, 2022
7567a13
guard for agglomerate service being null
fm3 May 23, 2022
182641e
use tracingstore for ad-hoc meshes
daniel-wer May 23, 2022
a123f41
fix mesh positions
fm3 May 23, 2022
3c9520f
fix editable mapping page reload
daniel-wer May 23, 2022
1818bb7
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 23, 2022
52a104a
caching for unmapped data, skip buckets outside of bbox
fm3 May 23, 2022
2fcd038
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 May 23, 2022
9d461a2
load meshes when proofreading
daniel-wer May 23, 2022
14cc95f
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer May 23, 2022
1cd4551
perf optimization for ad-hoc meshing
fm3 May 24, 2022
b53bc3e
fix window configuration variables and allow to disable proofreading …
daniel-wer May 24, 2022
89facdd
make coarse agglomerate more transparent, exclude it from ray tracing…
daniel-wer May 24, 2022
78332c4
use data store to request ad-hoc meshes if mapping is not yet editable
daniel-wer May 24, 2022
c6fe804
reload meshes after proofreading action
daniel-wer May 24, 2022
547c15d
enable context menu in 3d view
daniel-wer May 24, 2022
d5c5577
fix loading of segments on first click, properly reload agglomerate s…
daniel-wer May 24, 2022
38f8390
fix bucket position access
fm3 May 25, 2022
f361662
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 May 25, 2022
fb2c634
parallelize buckets again for larger cuboids
fm3 May 25, 2022
bfb9239
reuse binary data service code for loading editably-mapped data
fm3 May 25, 2022
c7a8f61
reduce isosurface cube size according to mag, make cube size window c…
daniel-wer May 25, 2022
97c689d
fix linting
daniel-wer May 25, 2022
0751558
merge master, use cached datastore uri
fm3 Jun 3, 2022
6b3f6f1
cleanup
fm3 Jun 3, 2022
e397f05
measure time for json conversions of editable mapping
fm3 Jun 3, 2022
d5def3e
add proto definition for AgglomerateGraph, EditableMapping
fm3 Jun 3, 2022
0536bd9
add proto conversion methods, measure speed
fm3 Jun 3, 2022
ed8ef2c
cleanup, method naming
fm3 Jun 3, 2022
12bc4e4
fully change AgglomerateGraph to proto, clean up backend code
fm3 Jun 7, 2022
458c8a0
extract AlfuFoxCache, add cache for largest agglomerate id query
fm3 Jun 7, 2022
eb55f2e
minor backend code cleanup
fm3 Jun 7, 2022
9e698ea
re-enable CI checks
fm3 Jun 7, 2022
04a325b
remove unused code
fm3 Jun 7, 2022
91e471b
migration guide
fm3 Jun 7, 2022
74ee6e0
[WIP] prevent making editable mapping after volume brushing
fm3 Jun 7, 2022
26c33ba
increase agglomerate skeleton max edge limit by one order of magnitud…
daniel-wer Jun 7, 2022
8241356
make proofreading click in 3d view work, adapt proofreading defaults,…
daniel-wer Jun 7, 2022
c3716d2
improve version typing, show warning when trying to restore older edi…
daniel-wer Jun 7, 2022
8cb2bda
disable proofreading tool for non-hybrid annotations
daniel-wer Jun 7, 2022
0433cfd
disallow to change mapping after editable mapping was activated
daniel-wer Jun 7, 2022
e4cf321
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer Jun 7, 2022
81c2133
hide volume modification tools after editable mapping was activated
daniel-wer Jun 7, 2022
efe5ce7
fix linting, only remove meshes that are not immediately loaded again
daniel-wer Jun 7, 2022
ccd0370
show empty placeholder instead of misleading info rows in td view con…
daniel-wer Jun 8, 2022
b71fa79
add created timestamp to editable mappings
fm3 Jun 8, 2022
d7a86f8
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
fm3 Jun 8, 2022
dd817bc
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer Jun 8, 2022
077884d
first round of refactoring, commenting, tweaking
daniel-wer Jun 8, 2022
6eb866d
fix null reference in isosurface service
fm3 Jun 9, 2022
ba3a7f3
assert volume buckets empty
fm3 Jun 9, 2022
34d97c3
backend pr feedback (part 1)
fm3 Jun 9, 2022
54cc20e
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer Jun 9, 2022
d9009f6
add some comments to proofreading saga
daniel-wer Jun 9, 2022
e4c1261
pr feedback (part 2)
fm3 Jun 10, 2022
bd7a560
PR feedback part 1/x
daniel-wer Jun 13, 2022
5944b59
PR feedback 2/x
daniel-wer Jun 14, 2022
ac0770f
disable loading of fine over segmentation meshes in proximity by default
daniel-wer Jun 14, 2022
d6d29f6
avoid requesting mapping when loading brushed volume data
fm3 Jun 14, 2022
06392dc
PR feedback 3/x, ensure agglomerate mapping is active when proofreadi…
daniel-wer Jun 14, 2022
a6b94de
Merge branch 'editable-mappings' of github.com:scalableminds/webknoss…
daniel-wer Jun 14, 2022
f11cb7f
fix tests for real git co l4-spine-heads elf
daniel-wer Jun 14, 2022
937f22f
fix linting
daniel-wer Jun 14, 2022
37fdc43
fix tool cycling and move proofread tool to the right
daniel-wer Jun 14, 2022
69cda10
fix tooltips for navbar buttons, disable merge mode if editable mappi…
daniel-wer Jun 14, 2022
c850a35
undo last action if editable mapping creation fails, add more explana…
daniel-wer Jun 14, 2022
9682f8e
instead of reloading agglomerate skeletons after proofreading action,…
daniel-wer Jun 14, 2022
208b04a
fix ad-hoc mesh loading for editable mappings
daniel-wer Jun 14, 2022
5ce4c66
increase ad-hoc batch limit 8-fold since cube size edge length per di…
daniel-wer Jun 15, 2022
5f39dcf
hide and disable proofreading tool if no agglomerate views are available
daniel-wer Jun 15, 2022
f9b402a
Merge branch 'master' of github.com:scalableminds/webknossos into edi…
daniel-wer Jun 15, 2022
18d74b9
fix merge
daniel-wer Jun 15, 2022
d5ead75
fix agglomerate too large error message for editable mappings
daniel-wer Jun 15, 2022
0f037b5
Apply suggestions from code review
daniel-wer Jun 16, 2022
5483875
Merge branch 'master' of github.com:scalableminds/webknossos into edi…
daniel-wer Jun 16, 2022
03d132a
update changelog and pretty
daniel-wer Jun 16, 2022
5e8bf84
fix typing
daniel-wer Jun 16, 2022
ff5f39f
fix proofreading when selecting far away node in 3d view
daniel-wer Jun 20, 2022
1bbcb0e
try one-sided mesh rendering to avoid transparency artifacts
daniel-wer Jun 20, 2022
8d8da90
disable undo/redo during proofreading and show warning toast
daniel-wer Jun 20, 2022
9c6f9a1
Merge branch 'master' of github.com:scalableminds/webknossos into edi…
daniel-wer Jun 20, 2022
d664624
warn if it looks like the user wanted to proofread but the proofread …
daniel-wer Jun 20, 2022
27bd979
Merge branch 'master' into editable-mappings
daniel-wer Jun 21, 2022
5f7553f
Merge branch 'master' into editable-mappings
daniel-wer Jun 22, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Added a warning for when the resolution in the XY viewport on z=1-downsampled datasets becomes too low, explaining the problem and how to mitigate it. [#6255](https://github.com/scalableminds/webknossos/pull/6255)
- Provide a UI to download/export a dataset in view-mode. The UI explains how to access the data with the python library. [#6283](https://github.com/scalableminds/webknossos/pull/6283)
- Added the possibility to view and download older versions of read-only annotations. [#6274](https://github.com/scalableminds/webknossos/pull/6274)
- Added a proofreading tool which can be used to edit agglomerate mappings. After activating an agglomerate mapping the proofreading tool can be selected. While the tool is active, agglomerates can be clicked to load their agglomerate skeletons. Use the context menu to delete or create edges for those agglomerate skeletons to split or merge agglomerates. The changes will immediately reflect in the segmentation and meshes. [#6195](https://github.com/scalableminds/webknossos/pull/6195)

### Changed

Expand Down
2 changes: 2 additions & 0 deletions MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
## Unreleased
[Commits](https://github.com/scalableminds/webknossos/compare/22.06.1...HEAD)

- FossilDB now has to be started with two new additional column families: editableMappings,editableMappingUpdates. Note that this upgrade can not be trivially rolled back, since new rocksDB column families are added and it is not easy to remove them again from an existing database. In case webKnossos needs to be rolled back, it is recommended to still keep the new column families in FossilDB. [#6195](https://github.com/scalableminds/webknossos/pull/6195)

### Postgres Evolutions:
4 changes: 2 additions & 2 deletions app/controllers/AnnotationIOController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ Expects:

def exportMimeTypeForAnnotation(annotation: Annotation): String =
if (annotation.tracingType == TracingType.skeleton)
"application/xml"
xmlMimeType
else
"application/zip"
zipMimeType

for {
annotation <- provider.provideAnnotation(typ, annotationId, issuingUser) ~> NOT_FOUND
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/DataSetController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class DataSetController @Inject()(userService: UserService,
dataLayerName) ~> NOT_FOUND
image <- imageFromCacheIfPossible(dataSet)
} yield {
addRemoteOriginHeaders(Ok(image)).as("image/jpeg").withHeaders(CACHE_CONTROL -> "public, max-age=86400")
addRemoteOriginHeaders(Ok(image)).as(jpegMimeType).withHeaders(CACHE_CONTROL -> "public, max-age=86400")
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/SitemapController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class SitemapController @Inject()(sitemapWriter: SitemapWriter, sil: Silhouette[
val downloadStream = sitemapWriter.toSitemapStream(prefix)

Ok.chunked(Source.fromPublisher(IterateeStreams.enumeratorToPublisher(downloadStream)))
.as("application/xml")
.as(xmlMimeType)
.withHeaders(CONTENT_DISPOSITION ->
"""sitemap.xml""")
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/annotation/AnnotationService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ class AnnotationService @Inject()(
}

//for Explorative Annotations list
def compactWrites(annotation: Annotation)(implicit ctx: DBAccessContext): Fox[JsObject] =
def compactWrites(annotation: Annotation): Fox[JsObject] =
for {
dataSet <- dataSetDAO.findOne(annotation._dataSet)(GlobalAccessContext) ?~> "dataSet.notFoundForAnnotation"
organization <- organizationDAO.findOne(dataSet._organization)(GlobalAccessContext) ?~> "organization.notFound"
Expand Down
2 changes: 1 addition & 1 deletion conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ datastore {
address = "localhost"
port = 6379
}
agglomerateSkeleton.maxEdges = 10000
agglomerateSkeleton.maxEdges = 100000
}

# Proxy some routes to prefix + route (only if features.isDemoInstance, route "/" only if logged out)
Expand Down
2 changes: 2 additions & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ annotation.reopen.failed=Failed to reopen the annotation.
annotation.sandbox.skeletonOnly=Sandbox annotations are currently available as skeleton only.
annotation.multiLayers.skeleton.notImplemented=This feature is not implemented for annotations with more than one skeleton layer
annotation.multiLayers.volume.notImplemented=This feature is not implemented for annotations with more than one volume layer
annotation.noMappingSet=No mapping is pinned for this annotation, cannot generate agglomerate skeleton.
annotation.volumeBucketsNotEmpty=Cannot make mapping editable in an annotation with mutated volume data

mesh.notFound=Mesh couldn’t be found
mesh.write.failed=Failed to convert mesh info to json
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ services:
command:
- fossildb
- -c
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates,editableMappings,editableMappingUpdates
user: ${USER_UID:-fossildb}:${USER_GID:-fossildb}

fossildb-persisted:
Expand Down
2 changes: 1 addition & 1 deletion fossildb/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ if [ ! -f "$JAR" ] || [ ! "$CURRENT_VERSION" == "$VERSION" ]; then
wget -q --show-progress -O "$JAR" "$URL"
fi

COLLECTIONS="skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates"
COLLECTIONS="skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates,editableMappings,editableMappingUpdates"

exec java -jar "$JAR" -c "$COLLECTIONS" -d "$FOSSILDB_HOME/data" -b "$FOSSILDB_HOME/backup"
52 changes: 49 additions & 3 deletions frontend/javascripts/admin/admin_rest_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import type {
ServerTracing,
TracingType,
WkConnectDatasetConfig,
ServerEditableMapping,
APICompoundType,
} from "types/api_flow_types";
import { APIAnnotationTypeEnum } from "types/api_flow_types";
Expand Down Expand Up @@ -81,6 +82,7 @@ import Toast from "libs/toast";
import * as Utils from "libs/utils";
import messages from "messages";
import window, { location } from "libs/window";
import { SaveQueueType } from "oxalis/model/actions/save_actions";

const MAX_SERVER_ITEMS_PER_RESPONSE = 1000;

Expand Down Expand Up @@ -854,11 +856,11 @@ export async function getTracingForAnnotationType(
export function getUpdateActionLog(
tracingStoreUrl: string,
tracingId: string,
tracingType: "skeleton" | "volume",
versionedObjectType: SaveQueueType,
): Promise<Array<APIUpdateActionBatch>> {
return doWithToken((token) =>
Request.receiveJSON(
`${tracingStoreUrl}/tracings/${tracingType}/${tracingId}/updateActionLog?token=${token}`,
`${tracingStoreUrl}/tracings/${versionedObjectType}/${tracingId}/updateActionLog?token=${token}`,
),
);
}
Expand Down Expand Up @@ -1584,6 +1586,29 @@ export function fetchMapping(
);
}

export function makeMappingEditable(
tracingStoreUrl: string,
tracingId: string,
): Promise<ServerEditableMapping> {
return doWithToken((token) =>
Request.receiveJSON(
`${tracingStoreUrl}/tracings/volume/${tracingId}/makeMappingEditable?token=${token}`,
{
method: "POST",
},
),
);
}

export function getEditableMapping(
tracingStoreUrl: string,
tracingId: string,
): Promise<ServerEditableMapping> {
return doWithToken((token) =>
Request.receiveJSON(`${tracingStoreUrl}/tracings/mapping/${tracingId}?token=${token}`),
);
}

export async function getAgglomeratesForDatasetLayer(
datastoreUrl: string,
datasetId: APIDatasetId,
Expand Down Expand Up @@ -1871,10 +1896,12 @@ export function getMeshData(id: string): Promise<ArrayBuffer> {
// These parameters are bundled into an object to avoid that the computeIsosurface function
// receives too many parameters, since this doesn't play well with the saga typings.
type IsosurfaceRequest = {
// The position is in voxels in mag 1
position: Vector3;
mag: Vector3;
segmentId: number;
subsamplingStrides: Vector3;
// The cubeSize is in voxels in mag <mag>
cubeSize: Vector3;
scale: Vector3;
mappingName: string | null | undefined;
Expand Down Expand Up @@ -1938,7 +1965,26 @@ export function getAgglomerateSkeleton(
return doWithToken((token) =>
Request.receiveArraybuffer(
`${dataStoreUrl}/data/datasets/${datasetId.owningOrganization}/${datasetId.name}/layers/${layerName}/agglomerates/${mappingId}/skeleton/${agglomerateId}?token=${token}`, // The webworker code cannot do proper error handling and always expects an array buffer from the server.
// In this case, the server sends an error json instead of an array buffer sometimes. Therefore, don't use the webworker code.
// The webworker code cannot do proper error handling and always expects an array buffer from the server.
// However, the server might send an error json instead of an array buffer. Therefore, don't use the webworker code.
{
useWebworkerForArrayBuffer: false,
showErrorToast: false,
},
),
);
}

export function getEditableAgglomerateSkeleton(
tracingStoreUrl: string,
tracingId: string,
agglomerateId: number,
): Promise<ArrayBuffer> {
return doWithToken((token) =>
Request.receiveArraybuffer(
`${tracingStoreUrl}/tracings/volume/${tracingId}/agglomerateSkeleton/${agglomerateId}?token=${token}`,
// The webworker code cannot do proper error handling and always expects an array buffer from the server.
// However, the server might send an error json instead of an array buffer. Therefore, don't use the webworker code.
{
useWebworkerForArrayBuffer: false,
showErrorToast: false,
Expand Down
3 changes: 3 additions & 0 deletions frontend/javascripts/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ In order to restore the current window, a reload is necessary.`,
"undo.no_undo":
"There is no action that could be undone. However, if you want to restore an earlier version of this annotation, use the 'Restore Older Version' functionality in the dropdown next to the 'Save' button.",
"undo.no_redo": "There is no action that could be redone.",
"undo.no_undo_during_proofread":
"Undo is not supported during proofreading yet. Please manually revert the last action you took.",
"undo.no_redo_during_proofread": "Redo is not supported during proofreading yet.",
"undo.import_volume_tracing":
"Importing a volume annotation cannot be undone. However, if you want to restore an earlier version of this annotation, use the 'Restore Older Version' functionality in the dropdown next to the 'Save' button.",
"download.wait": "Please wait...",
Expand Down
6 changes: 5 additions & 1 deletion frontend/javascripts/oxalis/api/api_latest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,11 @@ class DataApi {
});
}

getRawDataCuboid(layerName: string, topLeft: Vector3, bottomRight: Vector3): Promise<void> {
getRawDataCuboid(
layerName: string,
topLeft: Vector3,
bottomRight: Vector3,
): Promise<ArrayBuffer> {
return doWithToken((token) => {
const downloadUrl = this._getDownloadUrlForRawDataCuboid(
layerName,
Expand Down
5 changes: 4 additions & 1 deletion frontend/javascripts/oxalis/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export enum AnnotationToolEnum {
FILL_CELL = "FILL_CELL",
PICK_CELL = "PICK_CELL",
BOUNDING_BOX = "BOUNDING_BOX",
PROOFREAD = "PROOFREAD",
}
export const VolumeTools: Array<keyof typeof AnnotationToolEnum> = [
AnnotationToolEnum.BRUSH,
Expand Down Expand Up @@ -257,7 +258,7 @@ export type ShowContextMenuFunction = (
arg1: number,
arg2: number | null | undefined,
arg3: number | null | undefined,
arg4: Vector3,
arg4: Vector3 | null | undefined,
arg5: OrthoView,
) => void;
const Constants = {
Expand Down Expand Up @@ -294,6 +295,8 @@ const Constants = {
DEFAULT_NODE_RADIUS: 1.0,
RESIZE_THROTTLE_TIME: 50,
MIN_TREE_ID: 1,
// TreeIds > 1024^2 break webKnossos, see https://github.com/scalableminds/webknossos/issues/5009
MAX_TREE_ID: 1048576,
MIN_NODE_ID: 1,
// Maximum of how many buckets will be held in RAM (per layer)
MAXIMUM_BUCKET_COUNT_PER_LAYER: 5000,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { calculateGlobalPos } from "oxalis/model/accessors/view_mode_accessor";
import {
calculateGlobalPos,
calculateMaybeGlobalPos,
} from "oxalis/model/accessors/view_mode_accessor";
import _ from "lodash";
import type { OrthoView, Point2, Vector3, BoundingBoxType } from "oxalis/constants";
import Store from "oxalis/store";
Expand Down Expand Up @@ -140,7 +143,10 @@ export function getClosestHoveredBoundingBox(
plane: OrthoView,
): [SelectedEdge, SelectedEdge | null | undefined] | null {
const state = Store.getState();
const globalPosition = calculateGlobalPos(state, pos, plane);
const globalPosition = calculateMaybeGlobalPos(state, pos, plane);

if (globalPosition == null) return null;

const { userBoundingBoxes } = getSomeTracing(state.tracing);
const indices = Dimension.getIndices(plane);
const planeRatio = getBaseVoxelFactors(state.dataset.dataSource.scale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
getSegmentIdForPositionAsync,
} from "oxalis/controller/combinations/volume_handlers";
import { setActiveConnectomeAgglomerateIdsAction } from "oxalis/model/actions/connectome_actions";
import { getTreeNameForAgglomerateSkeleton } from "oxalis/model/accessors/skeletontracing_accessor";
export function hasAgglomerateMapping(state: OxalisState) {
const segmentation = Model.getVisibleSegmentationLayer();

Expand Down Expand Up @@ -81,22 +82,22 @@ export async function handleAgglomerateSkeletonAtClick(clickPosition: Point2) {
const globalPosition = calculateGlobalPos(state, clickPosition);
loadAgglomerateSkeletonAtPosition(globalPosition);
}
export async function loadAgglomerateSkeletonAtPosition(position: Vector3): Promise<void> {
export async function loadAgglomerateSkeletonAtPosition(position: Vector3): Promise<string | null> {
const segmentation = Model.getVisibleSegmentationLayer();

if (!segmentation) {
return;
return null;
}

const segmentId = await getSegmentIdForPositionAsync(position);
loadAgglomerateSkeletonForSegmentId(segmentId);
return loadAgglomerateSkeletonForSegmentId(segmentId);
}
export function loadAgglomerateSkeletonForSegmentId(segmentId: number): void {
export function loadAgglomerateSkeletonForSegmentId(segmentId: number): string | null {
const state = Store.getState();
const segmentation = Model.getVisibleSegmentationLayer();

if (!segmentation) {
return;
return null;
}

const { mappingName } = getMappingInfo(
Expand All @@ -107,9 +108,11 @@ export function loadAgglomerateSkeletonForSegmentId(segmentId: number): void {

if (mappingName && isAgglomerateMappingEnabled.value) {
Store.dispatch(loadAgglomerateSkeletonAction(segmentation.name, mappingName, segmentId));
return getTreeNameForAgglomerateSkeleton(segmentId, mappingName);
} else {
Toast.error(isAgglomerateMappingEnabled.reason);
}
return null;
}
export async function loadSynapsesOfAgglomerateAtPosition(position: Vector3) {
const state = Store.getState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ import {
getNodeAndTree,
getNodeAndTreeOrNull,
} from "oxalis/model/accessors/skeletontracing_accessor";
import { getInputCatcherRect, calculateGlobalPos } from "oxalis/model/accessors/view_mode_accessor";
import {
getInputCatcherRect,
calculateGlobalPos,
calculateMaybeGlobalPos,
} from "oxalis/model/accessors/view_mode_accessor";
import {
getPosition,
getRotationOrtho,
Expand Down Expand Up @@ -132,13 +136,11 @@ export function handleOpenContextMenu(
) {
const { activeViewport } = Store.getState().viewModeData.plane;

if (activeViewport === OrthoViews.TDView) {
return;
}

const nodeId = maybeGetNodeIdFromPosition(planeView, position, plane, isTouch);
const state = Store.getState();
const globalPosition = calculateGlobalPos(state, position);
// Use calculateMaybeGlobalPos instead of calculateGlobalPos, since calculateGlobalPos
// only works for the data viewports, but this function is also called for the 3d viewport.
const globalPosition = calculateMaybeGlobalPos(state, position);
const hoveredEdgesInfo = getClosestHoveredBoundingBox(position, plane);
const clickedBoundingBoxId = hoveredEdgesInfo != null ? hoveredEdgesInfo[0].boxId : null;
showNodeContextMenuAt(
Expand Down
Loading