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
da1fe6f1
Commit
da1fe6f1
authored
Jun 23, 2022
by
Martin Schorb
Browse files
Merge branch 'dev' into main
parents
efdaf0b9
02df7525
Pipeline
#34815
passed with stage
in 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dashUI/convert.py
View file @
da1fe6f1
...
...
@@ -27,13 +27,13 @@ module = 'convert'
inputtypes
=
[
{
'label'
:
'SBEMImage'
,
'value'
:
'SBEM'
},
{
'label'
:
'SerialEM Montage'
,
'value'
:
'SerialEM'
},
#
{'label': 'Image stack - FIB/SEM', 'value': '
FIBSEM
'},
{
'label'
:
'Image stack - FIB/SEM'
,
'value'
:
'
tifstack
'
},
]
inputmodules
=
[
'inputtypes.sbem_conv'
,
'inputtypes.serialem_conv'
,
#
'inputtypes.tifstack_conv'
'inputtypes.tifstack_conv'
]
main
=
html
.
Div
(
children
=
[
html
.
H3
(
"Import volume EM datasets - Choose type:"
,
id
=
'conv_head'
),
...
...
dashUI/inputtypes/tifstack_conv.py
View file @
da1fe6f1
...
...
@@ -59,6 +59,27 @@ pathbrowse = pages.path_browse(label)
page1
=
[
directory_sel
,
pathbrowse
,
html
.
Div
(
store
)]
voxsz
=
html
.
Div
(
children
=
[
html
.
H4
(
"Resolution values"
),
"x/y (isotropic): "
,
dcc
.
Input
(
id
=
{
'component'
:
'xy_px_input'
,
'module'
:
label
},
type
=
"number"
,
debounce
=
True
,
value
=
10.0
,
persistence
=
True
),
" nm"
,
html
.
Br
(),
html
.
Br
(),
"z (milling step): "
,
dcc
.
Input
(
id
=
{
'component'
:
'z_px_input'
,
'module'
:
label
},
type
=
"number"
,
debounce
=
True
,
value
=
10.0
,
persistence
=
True
),
" nm"
,
]
)
page1
.
append
(
voxsz
)
# # ===============================================
# RENDER STACK SELECTOR
...
...
@@ -152,10 +173,12 @@ page2.append(collapse_stdout)
],
[
State
({
'component'
:
'project_dd'
,
'module'
:
label
},
'value'
),
State
(
label
+
'compute_sel'
,
'value'
),
State
({
'component'
:
'xy_px_input'
,
'module'
:
label
},
'value'
),
State
({
'component'
:
'z_px_input'
,
'module'
:
label
},
'value'
),
State
({
'component'
:
'store_run_status'
,
'module'
:
label
},
'data'
),
State
({
'component'
:
'store_render_launch'
,
'module'
:
label
},
'data'
)],
prevent_initial_call
=
True
)
def
tifstack_conv_gobutton
(
stack_sel
,
in_dir
,
click
,
proj_dd_sel
,
compute_sel
,
run_state
,
outstore
):
def
tifstack_conv_gobutton
(
stack_sel
,
in_dir
,
click
,
proj_dd_sel
,
compute_sel
,
pxs
,
zwidth
,
run_state
,
outstore
):
ctx
=
dash
.
callback_context
trigger
=
ctx
.
triggered
[
0
][
'prop_id'
].
split
(
'.'
)[
0
].
partition
(
label
)[
2
]
but_disabled
=
True
...
...
@@ -184,27 +207,33 @@ def tifstack_conv_gobutton(stack_sel, in_dir, click, proj_dd_sel, compute_sel, r
with
open
(
os
.
path
.
join
(
params
.
json_template_dir
,
'SBEMImage_importer.json'
),
'r'
)
as
f
:
run_params
.
update
(
json
.
load
(
f
))
run_params
[
'image_
file
'
]
=
in_dir
run_params
[
'image_
directory
'
]
=
in_dir
run_params
[
'stack'
]
=
stack_sel
vox_sz
=
[
pxs
/
1000
]
*
2
vox_sz
.
append
(
zwidth
/
1000
)
run_params
[
'pxs'
]
=
vox_sz
with
open
(
param_file
,
'w'
)
as
f
:
json
.
dump
(
run_params
,
f
,
indent
=
4
)
log_file
=
params
.
render_log_dir
+
'/'
+
'
serialem
_conv_'
+
run_prefix
log_file
=
params
.
render_log_dir
+
'/'
+
'
tifstack
_conv_'
+
run_prefix
err_file
=
log_file
+
'.err'
log_file
+=
'.log'
# launch
# -----------------------
sbem
_conv_p
=
launch_jobs
.
run
(
target
=
compute_sel
,
tif
_conv_p
=
launch_jobs
.
run
(
target
=
compute_sel
,
pyscript
=
params
.
rendermodules_dir
+
'/dataimport/generate_EM_tilespecs_from_
SerialEMmontage
.py'
,
'/dataimport/generate_EM_tilespecs_from_
TIFStack
.py'
,
jsonfile
=
param_file
,
run_args
=
None
,
logfile
=
log_file
,
errfile
=
err_file
)
run_state
[
'status'
]
=
'running'
run_state
[
'id'
]
=
sbem
_conv_p
run_state
[
'type'
]
=
launch_jobs
.
runtype
(
comp_sel
)
run_state
[
'id'
]
=
tif
_conv_p
run_state
[
'type'
]
=
launch_jobs
.
runtype
(
comp
ute
_sel
)
run_state
[
'logfile'
]
=
log_file
else
:
...
...
@@ -220,7 +249,7 @@ def tifstack_conv_gobutton(stack_sel, in_dir, click, proj_dd_sel, compute_sel, r
run_state
[
'status'
]
=
'wait'
popup
=
'Wrong characters in input directory path. Please fix!'
elif
os
.
path
.
is
file
(
in_dir
):
elif
os
.
path
.
is
dir
(
in_dir
):
# print(in_dir)
if
any
([
stack_sel
==
'newstack'
,
proj_dd_sel
==
'newproj'
]):
if
not
(
run_state
[
'status'
]
==
'running'
):
...
...
Write
Preview
Supports
Markdown
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