Commit da1fe6f1 authored by Martin Schorb's avatar Martin Schorb
Browse files

Merge branch 'dev' into main

parents efdaf0b9 02df7525
Pipeline #34815 passed with stage
in 22 seconds
......@@ -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'),
......
......@@ -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(compute_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.isfile(in_dir):
elif os.path.isdir(in_dir):
# print(in_dir)
if any([stack_sel == 'newstack', proj_dd_sel == 'newproj']):
if not (run_state['status'] == 'running'):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment