Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Schorb
VolumeAlign
Commits
ffbc7b9b
Commit
ffbc7b9b
authored
Nov 23, 2021
by
Martin Schorb
Browse files
slice selector dissapear when n=1
parent
1770ef1b
Pipeline
#27311
passed with stage
in 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dash/callbacks/tile_view.py
View file @
ffbc7b9b
...
...
@@ -31,6 +31,7 @@ for idx in range(params.max_tileviews):
@
app
.
callback
([
Output
({
'component'
:
imtype
+
'_section_in'
+
idx_str
,
'module'
:
MATCH
},
'value'
),
Output
({
'component'
:
imtype
+
'_section_in'
+
idx_str
,
'module'
:
MATCH
},
'min'
),
Output
({
'component'
:
imtype
+
'_section_in'
+
idx_str
,
'module'
:
MATCH
},
'max'
),
Output
({
'component'
:
imtype
+
'section_in'
+
idx_str
,
'module'
:
MATCH
},
'style'
),
Output
({
'component'
:
imtype
+
'_contrastslider'
+
idx_str
,
'module'
:
MATCH
},
'max'
),
Output
({
'component'
:
imtype
+
'_contrastslider'
+
idx_str
,
'module'
:
MATCH
},
'value'
)],
Input
({
'component'
:
'stack_dd'
,
'module'
:
MATCH
},
'value'
),
...
...
@@ -39,6 +40,7 @@ for idx in range(params.max_tileviews):
State
({
'component'
:
'project_dd'
,
'module'
:
MATCH
},
'value'
)])
def
stacktoslice
(
stack_sel
,
allstacks
,
owner
,
project
):
stacklist
=
[]
slicestyle
=
{}
if
(
not
stack_sel
==
'-'
)
and
(
not
allstacks
is
None
):
stacklist
=
[
stack
for
stack
in
allstacks
if
stack
[
'stackId'
][
'stack'
]
==
stack_sel
]
...
...
@@ -55,6 +57,8 @@ for idx in range(params.max_tileviews):
o_min
=
stackparams
[
'stats'
][
'stackBounds'
][
'minZ'
]
o_max
=
stackparams
[
'stats'
][
'stackBounds'
][
'maxZ'
]
if
o_min
==
o_max
:
slicestyle
=
{
'display'
:
'none'
}
o_val
=
int
((
o_max
-
o_min
)
/
2
)
+
o_min
...
...
@@ -71,7 +75,7 @@ for idx in range(params.max_tileviews):
max_int
=
tilespec
[
'tileSpecs'
][
0
][
'maxIntensity'
]
return
o_val
,
o_min
,
o_max
,
max_int
,[
0
,
max_int
]
return
o_val
,
o_min
,
o_max
,
slicestyle
,
max_int
,[
0
,
max_int
]
else
:
return
dash
.
no_update
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment