Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 0 additions & 10 deletions src/layer/segmentation/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,6 @@ describe("layer/segmentation spatial skeleton chunk stats", () => {
spatialSkeletonVisibleChunksNeeded: new WatchableValue(0),
spatialSkeletonVisibleChunksAvailable: new WatchableValue(0),
spatialSkeletonVisibleChunksLoaded: new WatchableValue(false),
displayState: {
spatialSkeletonGridChunkStats2d: new WatchableValue({
presentCount: 0,
totalCount: 0,
}),
spatialSkeletonGridChunkStats3d: new WatchableValue({
presentCount: 0,
totalCount: 0,
}),
},
updateSpatialSkeletonSourceState: vi.fn(),
},
);
Expand Down
386 changes: 28 additions & 358 deletions src/layer/segmentation/index.ts

Large diffs are not rendered by default.

20 changes: 5 additions & 15 deletions src/layer/segmentation/json_keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@ export const SELECTED_ALPHA_JSON_KEY = "selectedAlpha";
export const NOT_SELECTED_ALPHA_JSON_KEY = "notSelectedAlpha";
export const OBJECT_ALPHA_JSON_KEY = "objectAlpha";
export const HIDDEN_OPACITY_3D_JSON_KEY = "hiddenObjectAlpha";
export const SKELETON_LOD_JSON_KEY = "skeletonLod";
export const SPATIAL_SKELETON_GRID_LEVEL_2D_JSON_KEY =
"spatialSkeletonGridLevel2d";
export const SPATIAL_SKELETON_GRID_LEVEL_3D_JSON_KEY =
"spatialSkeletonGridLevel3d";
export const SPATIAL_SKELETON_GRID_RESOLUTION_TARGET_2D_JSON_KEY =
"spatialSkeletonGridResolutionTarget2d";
export const SPATIAL_SKELETON_GRID_RESOLUTION_TARGET_3D_JSON_KEY =
"spatialSkeletonGridResolutionTarget3d";
export const SPATIAL_SKELETON_GRID_RESOLUTION_RELATIVE_2D_JSON_KEY =
"spatialSkeletonGridResolutionRelative2d";
export const SPATIAL_SKELETON_GRID_RESOLUTION_RELATIVE_3D_JSON_KEY =
"spatialSkeletonGridResolutionRelative3d";
export const SKELETON_CROSS_SECTION_RENDER_SCALE_JSON_KEY =
"skeletonCrossSectionRenderScale";
export const SKELETON_PERSPECTIVE_RENDER_SCALE_JSON_KEY =
"skeletonPerspectiveRenderScale";
export const SATURATION_JSON_KEY = "saturation";
export const HOVER_HIGHLIGHT_JSON_KEY = "hoverHighlight";
export const HIDE_SEGMENT_ZERO_JSON_KEY = "hideSegmentZero";
Expand All @@ -32,8 +23,7 @@ export const SKELETON_RENDERING_JSON_KEY = "skeletonRendering";
export const SKELETON_SHADER_JSON_KEY = "skeletonShader";
export const SKELETON_CODE_VISIBLE_KEY = "codeVisible";
export const SEGMENT_QUERY_JSON_KEY = "segmentQuery";
export const SPATIAL_SKELETON_NODE_QUERY_JSON_KEY =
"spatialSkeletonNodeQuery";
export const SPATIAL_SKELETON_NODE_QUERY_JSON_KEY = "spatialSkeletonNodeQuery";
export const SPATIAL_SKELETON_NODE_FILTER_JSON_KEY =
"spatialSkeletonNodeFilter";
export const MESH_SILHOUETTE_RENDERING_JSON_KEY = "meshSilhouetteRendering";
Expand Down
24 changes: 7 additions & 17 deletions src/layer/segmentation/layer_controls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { enumLayerControl } from "#src/widget/layer_control_enum.js";
import { rangeLayerControl } from "#src/widget/layer_control_range.js";
import {
renderScaleLayerControl,
spatialSkeletonGridRenderScaleLayerControl,
SpatialSkeletonGridRenderScaleWidget,
} from "#src/widget/render_scale_widget.js";
import {
colorSeedLayerControl,
Expand Down Expand Up @@ -73,7 +73,7 @@ export const LAYER_CONTROLS: LayerControlDefinition<SegmentationUserLayer>[] = [
},
{
label: "Resolution (skeleton grid 2D)",
toolJson: json_keys.SPATIAL_SKELETON_GRID_RESOLUTION_TARGET_2D_JSON_KEY,
toolJson: json_keys.SKELETON_CROSS_SECTION_RENDER_SCALE_JSON_KEY,
isValid: (layer) =>
makeCachedDerivedWatchableValue(
(levels, hasSpatialSkeletons) =>
Expand All @@ -85,19 +85,14 @@ export const LAYER_CONTROLS: LayerControlDefinition<SegmentationUserLayer>[] = [
),
title:
"Select the grid size level for spatially indexed skeletons in 2D views",
...spatialSkeletonGridRenderScaleLayerControl((layer) => ({
...renderScaleLayerControl((layer) => ({
histogram: layer.displayState.spatialSkeletonGridRenderScaleHistogram2d,
target: layer.displayState.spatialSkeletonGridResolutionTarget2d,
relative: layer.displayState.spatialSkeletonGridResolutionRelative2d,
pixelSize: layer.displayState.spatialSkeletonGridPixelSize2d,
chunkStats: layer.displayState.spatialSkeletonGridChunkStats2d,
relativeTooltip:
"Interpret the 2D skeleton grid resolution target as relative to zoom",
})),
}), SpatialSkeletonGridRenderScaleWidget),
},
{
label: "Resolution (skeleton grid 3D)",
toolJson: json_keys.SPATIAL_SKELETON_GRID_RESOLUTION_TARGET_3D_JSON_KEY,
toolJson: json_keys.SKELETON_PERSPECTIVE_RENDER_SCALE_JSON_KEY,
isValid: (layer) =>
makeCachedDerivedWatchableValue(
(levels, hasSpatialSkeletons) =>
Expand All @@ -109,15 +104,10 @@ export const LAYER_CONTROLS: LayerControlDefinition<SegmentationUserLayer>[] = [
),
title:
"Select the grid size level for spatially indexed skeletons in 3D views",
...spatialSkeletonGridRenderScaleLayerControl((layer) => ({
...renderScaleLayerControl((layer) => ({
histogram: layer.displayState.spatialSkeletonGridRenderScaleHistogram3d,
target: layer.displayState.spatialSkeletonGridResolutionTarget3d,
relative: layer.displayState.spatialSkeletonGridResolutionRelative3d,
pixelSize: layer.displayState.spatialSkeletonGridPixelSize3d,
chunkStats: layer.displayState.spatialSkeletonGridChunkStats3d,
relativeTooltip:
"Interpret the 3D skeleton grid resolution target as relative to zoom",
})),
}), SpatialSkeletonGridRenderScaleWidget),
},
{
label: "Opacity (3d)",
Expand Down
136 changes: 0 additions & 136 deletions src/layer/segmentation/spatial_skeleton_serialization.spec.ts

This file was deleted.

110 changes: 0 additions & 110 deletions src/layer/segmentation/spatial_skeleton_serialization.ts

This file was deleted.

Loading
Loading