#include "stdafx.h" #include "PoroMediaDialogShare.h" //constructor (CHANGE these to change default shared dialog values) PoroMediaDialogShare::PoroMediaDialogShare() { // // COMMON AMONG ALL POROMEDIA DIALOGS // //input and output files field_directory_and_file_input_str = ""; field_directory_work_str = ""; field_name_output_str = ""; //input parameters field_start_slice_int = 0; field_start_X_int = 0; field_start_Y_int = 0; field_width_slices_int = 0; field_width_X_int = 0; field_width_Y_int = 0; field_end_slice_int = 0; field_end_X_int = 0; field_end_Y_int = 0; field_pixel_size_float = 0.7f; //threshold field_manual_threshold_int = 0; //stop request flag stop_request = false; //optional flag_add_options = false; //memory estimate byte multiplier (adjust in specific dialog to make alg specific) req_mem_byte_multiplier = 0.125f; // // THE FOLLOWING ARE ADDITIONAL OPTIONS MODIFIED ONLY THROUGH THE PREPROCESSING FILTERS DIALOG // skip_binarization = false; //contrast filter_contrast_percentage = 20; //convolve filter_convolve_type = 2;// 0 = Median; Median+Aver; Uniform; Linear; Exponential; Square; debug; filter_convolve_savebounds = false; //keep the boundaries or not filter_convolve_radius = 1.9f; //aniso defaults filter_aniso_fast = false; filter_aniso_savebounds = false; filter_aniso_conboost = false; filter_aniso_K = 14; filter_aniso_TAU = 1.0f; filter_aniso_TAU_defVon = 1.0f; filter_aniso_TAU_defVoff = 1.0f; filter_aniso_K_defVon = 14; filter_aniso_K_defVoff = 30; filter_aniso_K_var = true; filter_aniso_iterations = 100; filter_aniso_midpoint = 127; filter_aniso_diff_coef = 2; // 0 = 1/[1+]^2, 1 = exp^2, 2 = exp^4, 3 = exp^n filter_aniso_radius = 1.9f; //vox rem filter_voxrem_removal_run_4_pore = true; filter_voxrem_removal_run_4_fiber = true; filter_voxrem_pore_um_vol = 512; filter_voxrem_fiber_um_vol = 512; //close filt filter_close_iterations = 3; //was 5, need larger value for skeletonization (smoother surface) filter_close_neighs_ext = 14; filter_close_neighs_non = 4; filter_close_extended = true; if (filter_close_extended) filter_close_neighs = filter_close_neighs_ext; else filter_close_neighs = filter_close_neighs_non; //additional save options save_intermediate_results = true; check_save_raw_files_bool = false; // // USED ONLY BY POROMEDIADIALOGSHARE // left_bracket_indx = 0; max_dig_cnt = MAX_DIG_LIMIT; cur_dig_cnt = 4; first_slice_indx = -1; first_X_indx = -1; first_Y_indx = -1; max_XY_depth = 0; max_XZ_depth = 0; max_YZ_depth = 0; max_X_size = MAX_NUM_LIMIT; max_Y_size = MAX_NUM_LIMIT; //everything enabled by default dialog_inactive_flags = 0; program_generated = false; } PoroMediaDialogShare::~PoroMediaDialogShare() { } void PoroMediaDialogShare::StopRequest() { //ask user for confirmation if (AfxMessageBox("Are you sure you want to permanently end the simulation?", MB_YESNO, 0) == IDYES) { stop_request = true; //grey out stop button button_STOP.EnableWindow(FALSE); txt_field_progress.SetWindowText("Please WAIT, simulation is being aborted..."); // currently running function should: // 1) stop it's current execution (going back to "input" code) // 2) re-enable all dialog inputs // 3) finally call StopConfirm() } } void PoroMediaDialogShare::StopConfirm() { stop_request = false; txt_field_progress.SetWindowText("Simulation successfully stopped."); }