-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Add dimension selector tool palette at bottom of screen #35
base: main
Are you sure you want to change the base?
Changes from all commits
da59a04
41b2f0b
4f63ede
887451d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from cryoet_data_portal_neuroglancer.state_generator import generate_image_layer, generate_segmentation_mask_layer | ||
from cryoet_data_portal_neuroglancer.state_generator import ( | ||
combine_json_layers, | ||
generate_image_layer, | ||
generate_segmentation_mask_layer, | ||
) | ||
|
||
|
||
def test__generate_image_layer_default_values(): | ||
|
@@ -14,3 +18,35 @@ def test__generate_segmentation_layer_default_values(): | |
|
||
assert "pick" in state | ||
assert state["pick"] is False | ||
|
||
|
||
def test__generate_configuration_default_values(): | ||
state = combine_json_layers(layers=[{"type": "image", "volumeRendering": "OK", "name": "myname"}], scale=1.0) | ||
|
||
assert "enableLayerColorWidget" in state | ||
assert state["enableLayerColorWidget"] is True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case I think we'll need to pull out the color widget related changes, because I don't think we can merge this PR until horizontal stacking and our scroll fix are available. Unlike some of the other changes which can sit in the state and wait until neuroglancer understands the state changes |
||
|
||
assert "toolPalettes" in state | ||
assert len(state["toolPalettes"]) == 1 | ||
|
||
palette = state["toolPalettes"]["Dimensions"] | ||
assert palette.get("side") == "bottom" | ||
assert palette.get("row") == 1 | ||
assert len(palette.get("tools", [])) == 3 | ||
|
||
tools = palette["tools"] | ||
assert "type" in tools[0] | ||
assert "type" in tools[1] | ||
assert "type" in tools[2] | ||
|
||
assert tools[0]["type"] == "dimension" | ||
assert tools[1]["type"] == "dimension" | ||
assert tools[2]["type"] == "dimension" | ||
|
||
assert "dimension" in tools[0] | ||
assert "dimension" in tools[1] | ||
assert "dimension" in tools[2] | ||
|
||
assert tools[0]["dimension"] == "x" | ||
assert tools[1]["dimension"] == "y" | ||
assert tools[2]["dimension"] == "z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few changes which would be helpful here! The first is to have it stack horizontally, which would be controlled by "verticalStacking". The second is to make this a query, because that way the user can't delete the controls.
Something like
The
size
would depend on whether it is vertically or horizontally stacked to be honest, but let's try this size for now.