Skip to content

Commit e5d71d8

Browse files
Merge branch 'master' into supervoxel-naming
2 parents 0b05153 + e20ff67 commit e5d71d8

File tree

15 files changed

+113
-41
lines changed

15 files changed

+113
-41
lines changed

app/models/job/Job.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ case class Job(
7373
resultAnnotationLink
7474
}
7575
case JobCommand.infer_nuclei | JobCommand.infer_neurons | JobCommand.materialize_volume_annotation |
76-
JobCommand.infer_with_model | JobCommand.infer_mitochondria | JobCommand.align_sections =>
76+
JobCommand.infer_with_model | JobCommand.infer_mitochondria | JobCommand.align_sections |
77+
JobCommand.infer_instances =>
7778
// There exist jobs with dataset name as return value, some with directoryName, and newest with datasetId
7879
// Construct links that work in either case.
7980
returnValue.map { datasetIdentifier =>

docs/data/neuroglancer_precomputed.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ my_dataset.precomputed # One root folder per dataset
3535
└─ scale_n
3636
```
3737

38-
For details see the [Neuroglancer spec](https://github.com/google/neuroglancer/tree/master/src/neuroglancer/datasource/precomputed).
38+
For details see the [Neuroglancer spec](https://github.com/google/neuroglancer/blob/e13f1f4c62918f2ea07b12f2116bdcb6767b1499/src/datasource/precomputed/README.md).
3939

4040
## Performance Considerations
4141
To get the best streaming performance for Neuroglancer Precomputed datasets consider the following settings.
4242

4343
- Use chunk sizes of 32 - 128 voxels^3
44-
- Enable sharding
44+
- Enable sharding

frontend/javascripts/viewer/view/action_bar_view.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import TracingActionsView, {
3636
import ViewDatasetActionsView from "viewer/view/action-bar/view_dataset_actions_view";
3737
import ViewModesView from "viewer/view/action-bar/view_modes_view";
3838
import {
39+
LayoutEvents,
3940
addNewLayout,
4041
deleteLayout,
4142
getLayoutConfig,
@@ -273,7 +274,7 @@ class ActionBarView extends React.PureComponent<Props, State> {
273274

274275
handleResetLayout = () => {
275276
layoutEmitter.emit(
276-
"resetLayout",
277+
LayoutEvents.resetLayout,
277278
this.props.layoutProps.layoutKey,
278279
this.props.layoutProps.activeLayout,
279280
);

frontend/javascripts/viewer/view/context_menu.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ import {
150150
getVolumeRequestUrl,
151151
withMappingActivationConfirmation,
152152
} from "viewer/view/right-border-tabs/segments_tab/segments_view_helper";
153+
import { LayoutEvents, layoutEmitter } from "./layouting/layout_persistence";
153154
import { LoadMeshMenuItemLabel } from "./right-border-tabs/segments_tab/load_mesh_menu_item_label";
154155

155156
type ContextMenuContextValue = React.MutableRefObject<HTMLElement | null> | null;
@@ -694,16 +695,16 @@ function getNodeContextMenuOptions({
694695
onClick: () => Store.dispatch(setActiveNodeAction(clickedNodeId)),
695696
label: "Select this Node",
696697
},
697-
activeTreeId === clickedTree.treeId
698-
? {
699-
key: "focus-tree",
700-
onClick: () => {
701-
Store.dispatch(expandParentGroupsOfTreeAction(clickedTree));
702-
Store.dispatch(focusTreeAction(clickedTree));
703-
},
704-
label: "Focus Tree in Skeleton Tab",
705-
}
706-
: null,
698+
{
699+
key: "focus-tree",
700+
onClick: () => {
701+
Store.dispatch(setActiveNodeAction(clickedNodeId));
702+
Store.dispatch(expandParentGroupsOfTreeAction(clickedTree));
703+
Store.dispatch(focusTreeAction(clickedTree));
704+
layoutEmitter.emit(LayoutEvents.showSkeletonTab);
705+
},
706+
label: "Activate & Focus Tree in Skeleton Tab",
707+
},
707708
getMaybeMinCutItem(clickedTree, volumeTracing, userBoundingBoxes, isVolumeModificationAllowed),
708709
...(allowUpdate
709710
? [
@@ -1081,6 +1082,7 @@ function getNoNodeContextMenuOptions(props: NoNodeContextMenuProps): ItemType[]
10811082
Store.dispatch(
10821083
clickSegmentAction(clickedSegmentId, globalPosition, additionalCoordinates, layerName),
10831084
);
1085+
layoutEmitter.emit(LayoutEvents.showSegmentsTab);
10841086
};
10851087

10861088
const onlyShowSegment = () => {

frontend/javascripts/viewer/view/layouting/flex_layout_wrapper.tsx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import messages from "messages";
1111
import * as React from "react";
1212
import { connect } from "react-redux";
1313
import type { Dispatch } from "redux";
14-
import type { OrthoView } from "viewer/constants";
14+
import type { BorderTabType, OrthoView } from "viewer/constants";
1515
import { ArbitraryViews, BorderTabs, OrthoViews } from "viewer/constants";
1616
import { setBorderOpenStatusAction } from "viewer/model/actions/ui_actions";
1717
import { setViewportAction } from "viewer/model/actions/view_mode_actions";
@@ -43,7 +43,7 @@ import {
4343
getMaximizedItemId,
4444
getPositionStatusOf,
4545
} from "./flex_layout_helper";
46-
import { getLayoutConfig, layoutEmitter } from "./layout_persistence";
46+
import { LayoutEvents, getLayoutConfig, layoutEmitter } from "./layout_persistence";
4747

4848
const { Footer } = Layout;
4949

@@ -118,21 +118,31 @@ class FlexLayoutWrapper extends React.PureComponent<Props, State> {
118118

119119
addListeners() {
120120
this.unbindListeners.push(
121-
layoutEmitter.on("resetLayout", () => {
121+
layoutEmitter.on(LayoutEvents.resetLayout, () => {
122122
resetDefaultLayouts();
123123
this.rebuildLayout();
124124
}),
125125
);
126126
this.unbindListeners.push(
127-
layoutEmitter.on("toggleBorder", (side) => {
127+
layoutEmitter.on(LayoutEvents.toggleBorder, (side) => {
128128
this.toggleBorder(side);
129129
}),
130130
);
131131
this.unbindListeners.push(
132-
layoutEmitter.on("toggleMaximize", () => {
132+
layoutEmitter.on(LayoutEvents.toggleMaximize, () => {
133133
this.toggleMaximize();
134134
}),
135135
);
136+
this.unbindListeners.push(
137+
layoutEmitter.on(LayoutEvents.showSkeletonTab, () => {
138+
this.openRightBorderTabById(BorderTabs.SkeletonTabView);
139+
}),
140+
);
141+
this.unbindListeners.push(
142+
layoutEmitter.on(LayoutEvents.showSegmentsTab, () => {
143+
this.openRightBorderTabById(BorderTabs.SegmentsView);
144+
}),
145+
);
136146
this.unbindListeners.push(this.attachKeyboardShortcuts());
137147
}
138148

@@ -147,6 +157,19 @@ class FlexLayoutWrapper extends React.PureComponent<Props, State> {
147157
return model;
148158
}
149159

160+
openRightBorderTabById(tabType: BorderTabType) {
161+
const rightBorderId = "right-border-tab-container";
162+
const node = this.state.model.getNodeById(rightBorderId);
163+
if (!node || node.getType() !== "tab") return;
164+
165+
const isRightOpen = getBorderOpenStatus(this.state.model).right;
166+
if (!isRightOpen) this.toggleBorder("right");
167+
168+
const rightBorderModel = (node as TabNode).getExtraData().model;
169+
if (rightBorderModel == null) return;
170+
rightBorderModel.doAction(FlexLayout.Actions.selectTab(tabType.id));
171+
}
172+
150173
adaptModelToConditionalTabs(model: Model) {
151174
/*
152175
* Currently, this method only adapts the visibility/existence of the

frontend/javascripts/viewer/view/layouting/floating_mobile_controls.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as MoveHandlers from "viewer/controller/combinations/move_handlers";
77
import { getMoveOffset, getMoveOffset3d } from "viewer/model/accessors/flycam_accessor";
88
import { moveFlycamAction } from "viewer/model/actions/flycam_actions";
99
import { Store } from "viewer/singletons";
10-
import { layoutEmitter } from "viewer/view/layouting/layout_persistence";
10+
import { LayoutEvents, layoutEmitter } from "viewer/view/layouting/layout_persistence";
1111
import ButtonComponent from "../components/button_component";
1212

1313
const moveForward = (timeFactor: number, isFirst: boolean) =>
@@ -49,7 +49,7 @@ export function FloatingMobileControls() {
4949
type="primary"
5050
shape="circle"
5151
style={BUTTON_STYLE}
52-
onClick={() => layoutEmitter.emit("toggleBorder", "left")}
52+
onClick={() => layoutEmitter.emit(LayoutEvents.toggleBorder, "left")}
5353
icon={
5454
<img
5555
alt="Toggle left sidebar"
@@ -63,7 +63,7 @@ export function FloatingMobileControls() {
6363
type="primary"
6464
shape="circle"
6565
style={BUTTON_STYLE}
66-
onClick={() => layoutEmitter.emit("toggleBorder", "right")}
66+
onClick={() => layoutEmitter.emit(LayoutEvents.toggleBorder, "right")}
6767
icon={
6868
<img
6969
alt="Toggle right sidebar"
@@ -95,7 +95,7 @@ export function FloatingMobileControls() {
9595
type="primary"
9696
shape="circle"
9797
style={BUTTON_STYLE}
98-
onClick={() => layoutEmitter.emit("toggleMaximize")}
98+
onClick={() => layoutEmitter.emit(LayoutEvents.toggleMaximize)}
9999
icon={<ExpandAltOutlined style={{ transform: ICON_TRANSFORM_VALUE }} />}
100100
/>
101101
{viewMode === "orthogonal" && (

frontend/javascripts/viewer/view/layouting/layout_persistence.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ import getDefaultLayouts, {
1313
mapLayoutKeysToLanguage,
1414
} from "./default_layout_configs";
1515
export const layoutEmitter = createNanoEvents();
16+
export enum LayoutEvents {
17+
resetLayout = "RESET_LAYOUT",
18+
toggleBorder = "TOGGLE_BORDER",
19+
toggleMaximize = "TOGGLE_MAXIMIZE",
20+
showSkeletonTab = "SHOW_SKELETON_TAB",
21+
showSegmentsTab = "SHOW_SEGMENTS_TAB",
22+
}
1623
// For debugging purposes:
1724
const disableLayoutPersistance = false;
1825
const localStorageKeys = {
@@ -92,7 +99,7 @@ function persistLayoutConfigs() {
9299
);
93100
}
94101

95-
layoutEmitter.on("resetLayout", (layoutKey: LayoutKeys, activeLayout: string) => {
102+
layoutEmitter.on(LayoutEvents.resetLayout, (layoutKey: LayoutKeys, activeLayout: string) => {
96103
storeLayoutConfig(getDefaultLayouts()[layoutKey], layoutKey, activeLayout);
97104
});
98105

@@ -185,8 +192,9 @@ export function setActiveLayout(layoutKey: LayoutKeys, activeLayout: string) {
185192
Store.dispatch(setStoredLayoutsAction(newLayouts));
186193
persistLayoutConfigsDebounced();
187194
} else {
188-
throw new Error(`Active layout could not be set. The given layout ${layoutKey} with name ${activeLayout}
189-
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
190-
was not found in layouts for ${mapLayoutKeysToLanguage[layoutKey]}.`);
195+
throw new Error(
196+
`Active layout could not be set. The given layout ${layoutKey} with name
197+
${activeLayout} was not found in layouts for ${mapLayoutKeysToLanguage[layoutKey]}.`,
198+
);
191199
}
192200
}

frontend/javascripts/viewer/view/layouting/tracing_layout_view.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
recalculateInputCatcherSizes,
3737
} from "viewer/view/input_catcher";
3838
import {
39+
LayoutEvents,
3940
getLastActiveLayout,
4041
getLayoutConfig,
4142
layoutEmitter,
@@ -186,10 +187,10 @@ class TracingLayoutView extends React.PureComponent<PropsWithRouter, State> {
186187
// Simply assume mobile.
187188
const { left, right } = Store.getState().uiInformation.borderOpenStatus;
188189
if (left) {
189-
layoutEmitter.emit("toggleBorder", "left");
190+
layoutEmitter.emit(LayoutEvents.toggleBorder, "left");
190191
}
191192
if (right) {
192-
layoutEmitter.emit("toggleBorder", "right");
193+
layoutEmitter.emit(LayoutEvents.toggleBorder, "right");
193194
}
194195
// Immediately show mobile buttons
195196
this.handleTouch();

unreleased_changes/8897.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Fixed
2+
- Fixed a bug where exploring remote datasets served by WEBKNOSSOS would yield invalid paths.

unreleased_changes/8917.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Changed
2+
- Clicking `Focus Tree in Skeleton Tab` or `Focus in Segment List` will not only focus the clicked tree/segment, but also open the right tab if it was not open already.

0 commit comments

Comments
 (0)