|
|
@ -18,6 +18,7 @@ from .dataproc import ( |
|
|
|
smooth_savgol_filter, |
|
|
|
smooth_savgol_filter, |
|
|
|
find_extremas, |
|
|
|
find_extremas, |
|
|
|
save_data, |
|
|
|
save_data, |
|
|
|
|
|
|
|
create_report, |
|
|
|
) |
|
|
|
) |
|
|
|
from .postproc import ( |
|
|
|
from .postproc import ( |
|
|
|
stem_file_list, |
|
|
|
stem_file_list, |
|
|
@ -28,7 +29,7 @@ from .postproc import ( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prescan_workflow(folder, top, right, bottom, left, **kargs): |
|
|
|
def prescan_workflow(folder, top, right, bottom, left, **kargs): |
|
|
|
print("1/4: scanning tifs for common autocontrast values") |
|
|
|
print("1/5: scanning tifs for common autocontrast values") |
|
|
|
|
|
|
|
|
|
|
|
parameters = Parameters(folder, top, right, bottom, left) |
|
|
|
parameters = Parameters(folder, top, right, bottom, left) |
|
|
|
parameters = scan_tifs(parameters) |
|
|
|
parameters = scan_tifs(parameters) |
|
|
@ -43,7 +44,7 @@ def prescan_workflow(folder, top, right, bottom, left, **kargs): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def image_workflow(parameters): |
|
|
|
def image_workflow(parameters): |
|
|
|
print("2/4: Image analysis and conversion") |
|
|
|
print("2/5: Image analysis and conversion") |
|
|
|
func = functools.partial(process_one_tif, parameters=parameters) |
|
|
|
func = functools.partial(process_one_tif, parameters=parameters) |
|
|
|
tif_list = parameters.tif_list |
|
|
|
tif_list = parameters.tif_list |
|
|
|
num_items = len(tif_list) |
|
|
|
num_items = len(tif_list) |
|
|
@ -56,7 +57,7 @@ def image_workflow(parameters): |
|
|
|
def data_workflow(stats_results, parameters): |
|
|
|
def data_workflow(stats_results, parameters): |
|
|
|
from .dataproc import save_temp |
|
|
|
from .dataproc import save_temp |
|
|
|
|
|
|
|
|
|
|
|
print("3/4: Data analysis") |
|
|
|
print("3/5: Data analysis") |
|
|
|
set_plotting_styles() |
|
|
|
set_plotting_styles() |
|
|
|
data_frame = construct_data_frame(stats_results, parameters) |
|
|
|
data_frame = construct_data_frame(stats_results, parameters) |
|
|
|
save_temp(data_frame, parameters) |
|
|
|
save_temp(data_frame, parameters) |
|
|
@ -72,22 +73,24 @@ def data_workflow(stats_results, parameters): |
|
|
|
extremas_df = find_extremas(selected_df, parameters) |
|
|
|
extremas_df = find_extremas(selected_df, parameters) |
|
|
|
|
|
|
|
|
|
|
|
save_data(data_frame, selected_df, extremas_df, parameters) |
|
|
|
save_data(data_frame, selected_df, extremas_df, parameters) |
|
|
|
|
|
|
|
create_report(data_frame, selected_df, extremas_df, parameters) |
|
|
|
|
|
|
|
|
|
|
|
return WorkflowResult(list(selected_df["file"]), parameters) |
|
|
|
return WorkflowResult(list(selected_df["file"]), parameters) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def postprocessing_workflow(selected_files, parameters): |
|
|
|
def postprocessing_workflow(selected_files, parameters): |
|
|
|
print("4/4: Post processing") |
|
|
|
print("4/5: Post processing, sorting cut images") |
|
|
|
file_stems = stem_file_list(selected_files) |
|
|
|
file_stems = stem_file_list(selected_files) |
|
|
|
annotate_color_coded_images(file_stems, parameters) |
|
|
|
|
|
|
|
sort_cut_images(file_stems, parameters) |
|
|
|
sort_cut_images(file_stems, parameters) |
|
|
|
remove_cuts_dir(parameters) |
|
|
|
remove_cuts_dir(parameters) |
|
|
|
|
|
|
|
print("5/5: Post processing, annotating color coded images") |
|
|
|
|
|
|
|
annotate_color_coded_images(file_stems, parameters) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cached_data_workflow(folder): |
|
|
|
def cached_data_workflow(folder): |
|
|
|
from .dataproc import load_temp |
|
|
|
from .dataproc import load_temp |
|
|
|
|
|
|
|
|
|
|
|
print("3/4: Data analysis") |
|
|
|
print("3/5: Data analysis") |
|
|
|
set_plotting_styles() |
|
|
|
set_plotting_styles() |
|
|
|
data_frame, parameters = load_temp(folder) |
|
|
|
data_frame, parameters = load_temp(folder) |
|
|
|
find_guard_threshold(data_frame, parameters) |
|
|
|
find_guard_threshold(data_frame, parameters) |
|
|
@ -101,5 +104,6 @@ def cached_data_workflow(folder): |
|
|
|
extremas_df = find_extremas(selected_df, parameters) |
|
|
|
extremas_df = find_extremas(selected_df, parameters) |
|
|
|
|
|
|
|
|
|
|
|
save_data(data_frame, selected_df, extremas_df, parameters) |
|
|
|
save_data(data_frame, selected_df, extremas_df, parameters) |
|
|
|
|
|
|
|
create_report(data_frame, selected_df, extremas_df, parameters) |
|
|
|
|
|
|
|
|
|
|
|
return WorkflowResult(list(selected_df["file"]), parameters) |
|
|
|
return WorkflowResult(list(selected_df["file"]), parameters) |
|
|
|