Skip to content
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

Lock mapping once the volume annotation was changed by the user #7549

Merged
merged 49 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5177f39
make segmentation output layer name for neuron detection configurable
MichaelBuessemeyer Dec 4, 2023
f142aaf
Merge branch 'master' of github.com:scalableminds/webknossos
MichaelBuessemeyer Jan 12, 2024
0df0c87
pin mapping once user did some volume annotation
MichaelBuessemeyer Jan 12, 2024
9cc5b45
some minor clean up
MichaelBuessemeyer Jan 12, 2024
8febc53
use and enforce pin mapping action in backend
fm3 Jan 15, 2024
7d42133
undo temporary changes
MichaelBuessemeyer Jan 17, 2024
b503c70
reload available agglomerate mappings names if not fetched yet
MichaelBuessemeyer Jan 17, 2024
73c7247
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Jan 17, 2024
da7ef21
add changelog entry
MichaelBuessemeyer Jan 17, 2024
b933ff1
fix tests
MichaelBuessemeyer Jan 17, 2024
c334ec6
add test for pin mapping functionality
MichaelBuessemeyer Jan 18, 2024
41e5eb8
clean up code
MichaelBuessemeyer Jan 18, 2024
16acac3
fix assertion
fm3 Jan 22, 2024
cc0a6db
Merge branch 'master' into pin-mapping
MichaelBuessemeyer Jan 22, 2024
d57ac5f
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Jan 23, 2024
57fac0c
disable proofreading tool in case a mapping is pinned and not editable
MichaelBuessemeyer Jan 23, 2024
0292f11
pin mapping upon interpolation & floodfill
MichaelBuessemeyer Jan 23, 2024
8692bf6
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Jan 23, 2024
d4ab683
update proofread tool disable message
MichaelBuessemeyer Jan 23, 2024
b8fccc6
fix tests
MichaelBuessemeyer Jan 23, 2024
378d0f8
Ask user for confirmation before pinning mapping
MichaelBuessemeyer Feb 12, 2024
0db891a
pin mapping / no mapping upon first volume annotation action
MichaelBuessemeyer Feb 12, 2024
617e391
disable merger mode once a mapping is pinned
MichaelBuessemeyer Feb 12, 2024
ee67207
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Feb 12, 2024
57c3ecf
don't do quick select if user aborts the pinning of the active mapping
MichaelBuessemeyer Feb 12, 2024
17182dd
fix tests
MichaelBuessemeyer Feb 12, 2024
ae4981c
improve user informing message
MichaelBuessemeyer Feb 13, 2024
75c396b
remove unused import
MichaelBuessemeyer Feb 13, 2024
92ae8dd
apply feedback
MichaelBuessemeyer Feb 13, 2024
9053a82
apply pr feedback
MichaelBuessemeyer Feb 13, 2024
cc396d4
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Feb 19, 2024
ccadeb2
properly catch user abort via modal
MichaelBuessemeyer Feb 19, 2024
06a8d63
Let server saved annotation take precedence over the URL configuratio…
MichaelBuessemeyer Feb 19, 2024
cf7dcbe
pin "no active mapping" in case a JSON mapping is active & fix linting
MichaelBuessemeyer Feb 19, 2024
e1ce3d8
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
MichaelBuessemeyer Feb 20, 2024
994cdce
disable volume annotations tools while json mapping is active and ren…
MichaelBuessemeyer Feb 20, 2024
625323b
small code clean up
MichaelBuessemeyer Feb 20, 2024
6325e1c
rename pinned to locked also in backend + proto
fm3 Feb 20, 2024
5ae9144
apply feedback & further replace word "pinned" with "locked"
MichaelBuessemeyer Feb 26, 2024
f6ce1be
Merge branch 'pin-mapping' of github.com:scalableminds/webknossos int…
MichaelBuessemeyer Feb 26, 2024
8180e04
further replace "pin" with "locked"
MichaelBuessemeyer Feb 26, 2024
f8485c5
fix bucket fill ignoring use decision whether to lock the mapping
MichaelBuessemeyer Feb 26, 2024
cada9ba
Merge branch 'master' into pin-mapping
MichaelBuessemeyer Feb 26, 2024
bd7daab
Merge branch 'master' into pin-mapping
MichaelBuessemeyer Feb 27, 2024
6c79877
Merge branch 'master' into pin-mapping
philippotto Mar 5, 2024
df310b5
format
philippotto Mar 5, 2024
7c71170
Merge branch 'master' of github.com:scalableminds/webknossos into pin…
philippotto Mar 11, 2024
ebed38c
Merge branch 'master' into pin-mapping
MichaelBuessemeyer Mar 11, 2024
0fad70e
Merge branch 'master' into pin-mapping
philippotto Mar 11, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ coverage-ts
.bsp
temp-webknossos-schema**
conf/application.conf-e
.env
daniel-wer marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Changed
- Datasets stored in WKW format are no longer loaded with memory mapping, reducing memory demands. [#7528](https://github.com/scalableminds/webknossos/pull/7528)
- Content Security Policy (CSP) settings are now relaxed by default. To keep stricter CSP rules, add them to your specific `application.conf`. [#7589](https://github.com/scalableminds/webknossos/pull/7589)
- HDF5 agglomerate mappings are now pinned to a volume annotation layer once the user performs a volume annotation action while a mapping is active. [#7549](https://github.com/scalableminds/webknossos/pull/7549)
- The state of whether a mapping is active and what exact mapping is now locked to the annotation upon the first volume annotation action to ensure future consistent results. Moreover, while a JSON mapping is active, no volume annotation can be done. [#7549](https://github.com/scalableminds/webknossos/pull/7549)
- WEBKNOSSOS now uses Java 21. [#7599](https://github.com/scalableminds/webknossos/pull/7599)
- Email verification is disabled by default. To enable it, set `webKnossos.user.emailVerification.activated` to `true` in your `application.conf`. [#7620](https://github.com/scalableminds/webknossos/pull/7620) [#7621](https://github.com/scalableminds/webknossos/pull/7621)
- Added more documentation for N5 and Neuroglancer precomputed web upload. [#7622](https://github.com/scalableminds/webknossos/pull/7622)
Expand Down
8 changes: 4 additions & 4 deletions frontend/javascripts/messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ instead. Only enable this option if you understand its effect. All layers will n
'All trees are currently hidden. You can disable this by toggling the "Skeleton" layer in the layer settings in the left sidebar.',
"tracing.invalid_json_url_hash":
"Cannot parse JSON URL hash. More information was printed to the browser's console.",
"tracing.pin_mapping_info":
"The active volume annotation layer has an active mapping. By mutating the layer, the mapping will be permanently enabled. This can only be undone by restoring an older version of this annotation. Are you sure you want to continue?",
"tracing.pin_mapping_confirmed": (mappingName: string) =>
`The mapping ${mappingName} is now permanently enabled for this annotation and can no longer be changed or disabled.`,
"tracing.locked_mapping_info":
"The active volume annotation layer has an active mapping. By mutating the layer, the mapping will be permanently locked (and can no longer be changed or disabled). This can only be undone by restoring an older version of this annotation. Are you sure you want to continue?",
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
"tracing.locked_mapping_confirmed": (mappingName: string) =>
`The mapping ${mappingName} is now locked for this annotation and can no longer be changed or disabled.`,
"layouting.missing_custom_layout_info":
"The annotation views are separated into four classes. Each of them has their own layouts. If you can't find your layout please open the annotation in the correct view mode or just add it here manually.",
"datastore.unknown_type": "Unknown datastore type:",
Expand Down
17 changes: 14 additions & 3 deletions frontend/javascripts/oxalis/model/accessors/tool_accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const getExplanationForDisabledVolume = (
isZoomInvalidForTracing: boolean,
isEditableMappingActive: boolean,
isSegmentationTracingTransformed: boolean,
isJSONMappingActive: boolean,
) => {
if (!isSegmentationTracingVisible) {
return "Volume annotation is disabled since no segmentation tracing layer is enabled. Enable it in the left settings sidebar.";
Expand All @@ -55,6 +56,9 @@ const getExplanationForDisabledVolume = (
if (isSegmentationTracingTransformed) {
return "Volume annotation is disabled because the visible segmentation layer is transformed. Use the left sidebar to render the segmentation layer without any transformations.";
}
if (isJSONMappingActive) {
return "Volume annotation is disabled because a JSON mapping is currently active for the the visible segmentation layer. Disable the JSON mapping to enable volume annotation.";
}

return "Volume annotation is currently disabled.";
};
Expand Down Expand Up @@ -122,7 +126,7 @@ function _getDisabledInfoForProofreadTool(
) {
// The explanations are prioritized according to effort the user has to put into
// activating proofreading.
// 1) If a non editable mapping is pinned to the annotation, proofreading actions are
// 1) If a non editable mapping is locked to the annotation, proofreading actions are
// not allowed for this annotation.
// 2) If no agglomerate mapping is available (or activated), the user should know
// about this requirement and be able to set it up (this can be the most difficult
Expand Down Expand Up @@ -150,7 +154,7 @@ function _getDisabledInfoForProofreadTool(
}
} else {
explanation =
"A mapping that does not support proofreading actions is pinned to this annotation. Most likely, the annotation layer was modified earlier (e.g. by brushing).";
"A mapping that does not support proofreading actions is locked to this annotation. Most likely, the annotation layer was modified earlier (e.g. by brushing).";
}
return {
isDisabled,
Expand Down Expand Up @@ -246,6 +250,7 @@ export function getDisabledInfoForTools(state: OxalisState): Record<
}
> {
const isInMergerMode = state.temporaryConfiguration.isMergerModeEnabled;
const { activeMappingByLayer } = state.temporaryConfiguration;
const isZoomInvalidForTracing = isMagRestrictionViolated(state);
const hasVolume = state.tracing.volumes.length > 0;
const hasSkeleton = state.tracing.skeleton != null;
Expand All @@ -269,16 +274,21 @@ export function getDisabledInfoForTools(state: OxalisState): Record<
visibleSegmentationLayer.name === segmentationTracingLayer.tracingId;
const isEditableMappingActive =
segmentationTracingLayer != null && !!segmentationTracingLayer.mappingIsEditable;
const isJSONMappingActive =
segmentationTracingLayer != null &&
activeMappingByLayer[segmentationTracingLayer.tracingId]?.mappingType === "JSON" &&
activeMappingByLayer[segmentationTracingLayer.tracingId]?.mappingStatus === "ENABLED";
const genericDisabledExplanation = getExplanationForDisabledVolume(
isSegmentationTracingVisible,
isInMergerMode,
isSegmentationTracingVisibleForMag,
isZoomInvalidForTracing,
isEditableMappingActive,
isSegmentationTracingTransformed,
isJSONMappingActive,
);
const isUneditableMappingPinned =
(segmentationTracingLayer?.mappingIsPinned && !segmentationTracingLayer?.mappingIsEditable) ??
(segmentationTracingLayer?.mappingIsLocked && !segmentationTracingLayer?.mappingIsEditable) ??
false;

const isVolumeDisabled =
Expand All @@ -288,6 +298,7 @@ export function getDisabledInfoForTools(state: OxalisState): Record<
// this condition doesn't need to be checked here
!isSegmentationTracingVisibleForMag ||
isInMergerMode ||
isJSONMappingActive ||
isSegmentationTracingTransformed;

if (isVolumeDisabled || isEditableMappingActive) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ export function isMappingPinned(

if (volumeTracing == null) return false;

return !!volumeTracing.mappingIsPinned;
return !!volumeTracing.mappingIsLocked;
}

export function isMappingActivationAllowed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export type RemoveSegmentAction = ReturnType<typeof removeSegmentAction>;
export type DeleteSegmentDataAction = ReturnType<typeof deleteSegmentDataAction>;
export type SetSegmentGroupsAction = ReturnType<typeof setSegmentGroupsAction>;
export type SetMappingIsEditableAction = ReturnType<typeof setMappingIsEditableAction>;
export type SetMappingIsPinnedAction = ReturnType<typeof setMappingIsPinnedAction>;
export type SetMappingIsLockedAction = ReturnType<typeof setMappingIsLockedAction>;

export type ComputeQuickSelectForRectAction = ReturnType<typeof computeQuickSelectForRectAction>;
export type MaybePrefetchEmbeddingAction = ReturnType<typeof maybePrefetchEmbeddingAction>;
Expand Down Expand Up @@ -90,7 +90,7 @@ export type VolumeTracingAction =
| SetLargestSegmentIdAction
| SetSelectedSegmentsOrGroupAction
| SetMappingIsEditableAction
| SetMappingIsPinnedAction
| SetMappingIsLockedAction
| InitializeEditableMappingAction
| ComputeQuickSelectForRectAction
| MaybePrefetchEmbeddingAction
Expand Down Expand Up @@ -360,7 +360,7 @@ export const setMappingIsEditableAction = () =>
type: "SET_MAPPING_IS_EDITABLE",
} as const);

export const setMappingIsPinnedAction = () =>
export const setMappingIsLockedAction = () =>
({
type: "SET_MAPPING_IS_PINNED",
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
} as const);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function serverVolumeToClientVolumeTracing(tracing: ServerVolumeTracing):
userBoundingBoxes,
mappingName: tracing.mappingName,
mappingIsEditable: tracing.mappingIsEditable,
mappingIsPinned: tracing.mappingIsPinned,
mappingIsLocked: tracing.mappingIsLocked,
hasSegmentIndex: tracing.hasSegmentIndex || false,
additionalAxes: convertServerAdditionalAxesToFrontEnd(tracing.additionalAxes),
};
Expand Down Expand Up @@ -392,27 +392,27 @@ function VolumeTracingReducer(

case "SET_MAPPING_NAME": {
// Editable mappings cannot be disabled or switched for now
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsPinned) return state;
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsLocked) return state;

const { mappingName, mappingType } = action;
return setMappingNameReducer(state, volumeTracing, mappingName, mappingType);
}

case "SET_MAPPING_IS_EDITABLE": {
// Editable mappings cannot be disabled or switched for now.
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsPinned) return state;
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsLocked) return state;

// An editable mapping is always pinned.
// An editable mapping is always locked.
return updateVolumeTracing(state, volumeTracing.tracingId, {
mappingIsEditable: true,
mappingIsPinned: true,
mappingIsLocked: true,
});
}
case "SET_MAPPING_IS_PINNED": {
if (volumeTracing.mappingIsPinned) return state;
if (volumeTracing.mappingIsLocked) return state;

return updateVolumeTracing(state, volumeTracing.tracingId, {
mappingIsPinned: true,
mappingIsLocked: true,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export function setMappingNameReducer(
mappingType: MappingType,
isMappingEnabled: boolean = true,
) {
// Editable mappings or pinned mappings cannot be disabled or switched for now
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsPinned) {
// Editable mappings or locked mappings cannot be disabled or switched for now
if (volumeTracing.mappingIsEditable || volumeTracing.mappingIsLocked) {
return state;
}
// Only HDF5 mappings are persisted in volume annotations for now
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/oxalis/model/sagas/quick_select_saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AnnotationToolEnum } from "oxalis/constants";
import getSceneController from "oxalis/controller/scene_controller_provider";
import { getActiveSegmentationTracing } from "../accessors/volumetracing_accessor";
import { VolumeTracing } from "oxalis/store";
import { ensureMaybeActiveMappingIsPinned } from "./saga_helpers";
import { ensureMaybeActiveMappingIsLocked } from "./saga_helpers";

function* shouldUseHeuristic() {
const useHeuristic = yield* select((state) => state.userConfiguration.quickSelect.useHeuristic);
Expand All @@ -32,13 +32,13 @@ export default function* listenToQuickSelect(): Saga<void> {
"COMPUTE_QUICK_SELECT_FOR_RECT",
function* guard(action: ComputeQuickSelectForRectAction) {
try {
// As changes to the volume layer will be applied, the potentially existing mapping should be pinned to ensure a consistent state.
const volumeTracing: VolumeTracing | null | undefined = yield* select(
getActiveSegmentationTracing,
);
if (volumeTracing) {
// As changes to the volume layer will be applied, the potentially existing mapping should be locked to ensure a consistent state.
const { isMappingPinnedIfNeeded } = yield* call(
MichaelBuessemeyer marked this conversation as resolved.
Show resolved Hide resolved
ensureMaybeActiveMappingIsPinned,
ensureMaybeActiveMappingIsLocked,
volumeTracing,
);
if (!isMappingPinnedIfNeeded) {
Expand Down
40 changes: 19 additions & 21 deletions frontend/javascripts/oxalis/model/sagas/saga_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Toast from "libs/toast";
import { Store } from "oxalis/singletons";
// @ts-expect-error ts-migrate(2614) FIXME: Module '"redux-saga"' has no exported member 'Patt... Remove this comment to see the full error message
import type { Pattern } from "redux-saga";
import { setMappingIsPinnedAction } from "../actions/volumetracing_actions";
import { setMappingIsLockedAction } from "../actions/volumetracing_actions";
import { MappingStatusEnum } from "oxalis/constants";

export function* takeEveryUnlessBusy(
Expand Down Expand Up @@ -46,24 +46,24 @@ export function* takeEveryUnlessBusy(
yield* takeEvery(actionDescriptor, sagaBusyWrapper);
}

type EnsureMappingIsPinnedReturnType = {
type EnsureMappingIsLockedReturnType = {
isMappingPinnedIfNeeded: boolean;
reason?: string;
};

export function askUserForPinningActiveMapping(
export function askUserForLockingActiveMapping(
volumeTracing: VolumeTracing,
activeMappingByLayer: Record<string, ActiveMappingInfo>,
): Promise<EnsureMappingIsPinnedReturnType> {
): Promise<EnsureMappingIsLockedReturnType> {
return new Promise((resolve, reject) => {
if (!volumeTracing.mappingIsPinned) {
if (!volumeTracing.mappingIsLocked) {
const pinMapping = async () => {
// A mapping that is active and is being annotated needs to be pinned to ensure a consistent state in the future.
// A mapping that is active and is being annotated needs to be locked to ensure a consistent state in the future.
// See https://github.com/scalableminds/webknossos/issues/5431 for more information.
const activeMapping = activeMappingByLayer[volumeTracing.tracingId];
if (activeMapping.mappingName) {
Store.dispatch(setMappingIsPinnedAction());
const message = messages["tracing.pin_mapping_confirmed"](activeMapping.mappingName);
Store.dispatch(setMappingIsLockedAction());
const message = messages["tracing.locked_mapping_confirmed"](activeMapping.mappingName);
Toast.info(message, { timeout: 10000 });
console.log(message);
resolve({ isMappingPinnedIfNeeded: true, reason: "User confirmed." });
Expand All @@ -73,9 +73,9 @@ export function askUserForPinningActiveMapping(
}
};
Modal.confirm({
title: "Should the active Mapping be pinned?",
content: messages["tracing.pin_mapping_info"],
okText: "Enable Mapping Permanently",
title: "Should the active Mapping be locked?",
content: messages["tracing.locked_mapping_info"],
okText: "Lock Mapping",
cancelText: "Abort Annotation Action",
width: 600,
onOk: pinMapping,
Expand All @@ -87,11 +87,11 @@ export function askUserForPinningActiveMapping(
});
}

export function* ensureMaybeActiveMappingIsPinned(
export function* ensureMaybeActiveMappingIsLocked(
volumeTracing: VolumeTracing,
): Saga<EnsureMappingIsPinnedReturnType> {
if (volumeTracing.mappingIsPinned) {
return { isMappingPinnedIfNeeded: true, reason: "Mapping is already pinned." };
): Saga<EnsureMappingIsLockedReturnType> {
if (volumeTracing.mappingIsLocked) {
return { isMappingPinnedIfNeeded: true, reason: "Mapping is already locked." };
}
const activeMappingByLayer = yield* select(
(state) => state.temporaryConfiguration.activeMappingByLayer,
Expand All @@ -104,15 +104,13 @@ export function* ensureMaybeActiveMappingIsPinned(
activeMappingByLayer[volumeTracing.tracingId].mappingType === "HDF5";
if (isSomeMappingActive && isHDF5Mapping) {
try {
return yield* call(askUserForPinningActiveMapping, volumeTracing, activeMappingByLayer);
return yield* call(askUserForLockingActiveMapping, volumeTracing, activeMappingByLayer);
} catch (error: any) {
return error as EnsureMappingIsPinnedReturnType;
return error as EnsureMappingIsLockedReturnType;
}
} else {
if (!isSomeMappingActive) {
yield* put(setMappingIsPinnedAction());
}
return { isMappingPinnedIfNeeded: true, reason: "Pinned that no mapping is active." };
yield* put(setMappingIsLockedAction());
return { isMappingPinnedIfNeeded: true, reason: "Locked that no mapping is active." };
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { Model, api } from "oxalis/singletons";
import { OxalisState } from "oxalis/store";
import { call, put } from "typed-redux-saga";
import { createVolumeLayer, getBoundingBoxForViewport, labelWithVoxelBuffer2D } from "./helpers";
import { ensureMaybeActiveMappingIsPinned } from "../saga_helpers";
import { ensureMaybeActiveMappingIsLocked } from "../saga_helpers";

/*
* This saga is capable of doing segment interpolation between two slices.
Expand Down Expand Up @@ -434,8 +434,8 @@ export default function* maybeInterpolateSegmentationLayer(): Saga<void> {
);
return;
}
// As the interpolation will be applied, the potentially existing mapping should be pinned to ensure a consistent state.
const { isMappingPinnedIfNeeded } = yield* call(ensureMaybeActiveMappingIsPinned, volumeTracing);
// As the interpolation will be applied, the potentially existing mapping should be locked to ensure a consistent state.
const { isMappingPinnedIfNeeded } = yield* call(ensureMaybeActiveMappingIsLocked, volumeTracing);
if (!isMappingPinnedIfNeeded) {
return;
}
Expand Down
16 changes: 8 additions & 8 deletions frontend/javascripts/oxalis/model/sagas/volumetracing_saga.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import { select, take } from "oxalis/model/sagas/effect-generators";
import listenToMinCut from "oxalis/model/sagas/min_cut_saga";
import listenToQuickSelect from "oxalis/model/sagas/quick_select_saga";
import {
ensureMaybeActiveMappingIsPinned,
ensureMaybeActiveMappingIsLocked,
takeEveryUnlessBusy,
} from "oxalis/model/sagas/saga_helpers";
import {
Expand Down Expand Up @@ -222,9 +222,9 @@ export function* editVolumeLayerAsync(): Saga<any> {
}

const activeCellId = yield* select((state) => enforceActiveVolumeTracing(state).activeCellId);
// As changes to the volume layer will be applied, the potentially existing mapping should be pinned to ensure a consistent state.
// As changes to the volume layer will be applied, the potentially existing mapping should be locked to ensure a consistent state.
const { isMappingPinnedIfNeeded } = yield* call(
ensureMaybeActiveMappingIsPinned,
ensureMaybeActiveMappingIsLocked,
volumeTracing,
);
if (!isMappingPinnedIfNeeded) {
Expand Down Expand Up @@ -447,8 +447,8 @@ export function* floodFill(): Saga<void> {
continue;
}
// As the flood fill will be applied to the volume layer,
// the potentially existing mapping should be pinned to ensure a consistent state.
yield* call(ensureMaybeActiveMappingIsPinned, volumeTracing);
// the potentially existing mapping should be locked to ensure a consistent state.
yield* call(ensureMaybeActiveMappingIsLocked, volumeTracing);
yield* put(setBusyBlockingInfoAction(true, "Floodfill is being computed."));
const boundingBoxForFloodFill = yield* call(getBoundingBoxForFloodFill, seedPosition, planeId);
const progressCallback = createProgressCallback({
Expand Down Expand Up @@ -708,14 +708,14 @@ export function* diffVolumeTracing(

if (
prevVolumeTracing.mappingName !== volumeTracing.mappingName ||
prevVolumeTracing.mappingIsPinned !== volumeTracing.mappingIsPinned
prevVolumeTracing.mappingIsLocked !== volumeTracing.mappingIsLocked
) {
// Once the first volume action is performed on a volume layer, the mapping state is pinned.
// Once the first volume action is performed on a volume layer, the mapping state is locked.
// In case no mapping is active, this is denoted by setting the mapping name to null.
const action = updateMappingName(
volumeTracing.mappingName || null,
volumeTracing.mappingIsEditable || null,
volumeTracing.mappingIsPinned,
volumeTracing.mappingIsLocked,
);
yield action;
}
Expand Down
Loading