#include "stdafx.h" #include "PoroMediaDialogShare.h" ////////////////////////////////////////////////////////////////////////////////////////////////// // // First BIND the inputs, then call INIT to set default values for controls // ////////////////////////////////////////////////////////////////////////////////////////////////// //initializes common input fields to their default values void PoroMediaDialogShare::InitCommonInputFields() { //*********************** //initial values for controls //*********************** //progress txt/bar if ( is_control_enabled(PROGRESS_CONTROLS) ) { pbar_simulation_progress.SetStep(1); pbar_simulation_progress.SetRange(0,100); txt_field_progress.SetWindowText("Enter desired parameters and push \"OK\""); //color of progress bar pbar_simulation_progress.SetBkColor(RGB(100, 100, 100)); } //memory info if ( is_control_enabled(MEMORY_CONTROLS) ) { txt_field_req_mem.SetWindowText("Estimated RAM: NA"); } //binarization if ( is_control_enabled(BINARIZE_CONTROLS) ) { txt_field_threshold_val.SetWindowText("threshold (0-254)"); txt_field_threshold_sensitive.SetWindowText("sensitivity"); pbar_threshold_sensitivity.SetRange(0, 254); //init combo box for thresholding type combo_threshold_method.AddString("Manual"); combo_threshold_method.AddString("Minimum Error"); combo_threshold_method.AddString("Composite Average"); combo_threshold_method.AddString("Average"); combo_threshold_method.SetCurSel(3); } //file saving options if ( is_control_enabled(FILESAVE_CONTROLS) ) { check_save_raw_stack.SetCheck(BST_UNCHECKED); check_save_cbin_stack.SetCheck(BST_UNCHECKED); check_auto_calc_params.SetCheck(BST_CHECKED); } } // binds common inputs to their controls void PoroMediaDialogShare::BindCommonInputFields(CDataExchange* pDX) { //Input, output and directory specification stuff DDX_Control(pDX, IDC_BUTTON_INPUT_DIRECTORY, button_directory_input); DDX_Control(pDX, IDC_EDIT_INPUT_DIRECTORY, field_directory_and_file_input_cntrl); DDX_Text(pDX, IDC_EDIT_INPUT_DIRECTORY, field_directory_and_file_input_str); DDV_MaxChars(pDX, field_directory_and_file_input_str, 512); DDX_Control(pDX, IDC_BUTTON_WORK_DIRECTORY, button_directory_output); DDX_Control(pDX, IDC_EDIT_WORK_DIRECTORY, field_directory_work_cntrl); DDX_Text(pDX, IDC_EDIT_WORK_DIRECTORY, field_directory_work_str); DDV_MaxChars(pDX, field_directory_work_str, 512); DDX_Control(pDX, IDC_EDIT_OUTPUT_NAME_PREFIX, field_name_output_cntrl); DDX_Text(pDX, IDC_EDIT_OUTPUT_NAME_PREFIX, field_name_output_str); DDV_MaxChars(pDX, field_name_output_str, 512); //start point variables and controls DDX_Control(pDX, IDC_EDIT_START_SLICE, field_start_slice_cntrl); DDX_Text(pDX, IDC_EDIT_START_SLICE, field_start_slice_int); DDV_MinMaxInt(pDX, field_start_slice_int, 0, MAX_NUM_LIMIT-1); DDX_Control(pDX, IDC_EDIT_STARTX, field_start_X_cntrl); DDX_Text(pDX, IDC_EDIT_STARTX, field_start_X_int); DDV_MinMaxInt(pDX, field_start_X_int, 1, MAX_NUM_LIMIT-1); DDX_Control(pDX, IDC_EDIT_STARTY, field_start_Y_cntrl); DDX_Text(pDX, IDC_EDIT_STARTY, field_start_Y_int); DDV_MinMaxInt(pDX, field_start_Y_int, 1, MAX_NUM_LIMIT-1); //width variables and controls DDX_Control(pDX, IDC_EDIT_WIDTH_SLICES, field_width_slices_cntrl); DDX_Text(pDX, IDC_EDIT_WIDTH_SLICES, field_width_slices_int); DDV_MinMaxInt(pDX, field_width_slices_int, 1, MAX_NUM_LIMIT-1); DDX_Control(pDX, IDC_EDIT_WIDTHX, field_width_X_cntrl); DDX_Text(pDX, IDC_EDIT_WIDTHX, field_width_X_int); DDV_MinMaxInt(pDX, field_width_X_int, 1, MAX_NUM_LIMIT); DDX_Control(pDX, IDC_EDIT_WIDTHY, field_width_Y_cntrl); DDX_Text(pDX, IDC_EDIT_WIDTHY, field_width_Y_int); DDV_MinMaxInt(pDX, field_width_Y_int, 1, MAX_NUM_LIMIT); //end point variables and controls DDX_Control(pDX, IDC_EDIT_END_SLICE, field_end_slice_cntrl); DDX_Text(pDX, IDC_EDIT_END_SLICE, field_end_slice_int); DDV_MinMaxInt(pDX, field_end_slice_int, 0, MAX_NUM_LIMIT-1); DDX_Control(pDX, IDC_EDIT_ENDX, field_end_X_cntrl); DDX_Text(pDX, IDC_EDIT_ENDX, field_end_X_int); DDV_MinMaxInt(pDX, field_end_X_int, 2, MAX_NUM_LIMIT); DDX_Control(pDX, IDC_EDIT_ENDY, field_end_Y_cntrl); DDX_Text(pDX, IDC_EDIT_ENDY, field_end_Y_int); DDV_MinMaxInt(pDX, field_end_Y_int, 2, MAX_NUM_LIMIT); //auto calc, pixel size DDX_Control(pDX, IDC_CHECK_AUTO_PARAM, check_auto_calc_params); DDX_Control(pDX, IDC_EDIT_PIXEL_SIZE, field_pixel_size_cntrl); DDX_Text(pDX, IDC_EDIT_PIXEL_SIZE, field_pixel_size_float); //ok, cancel, stop buttons DDX_Control(pDX, IDOK, button_OK); DDX_Control(pDX, IDCANCEL, button_CANCEL); DDX_Control(pDX, IDSTOP, button_STOP); //binarization controls if ( is_control_enabled(BINARIZE_CONTROLS) ) { DDX_Control(pDX, IDC_CHECK_IMG_INVERT, check_image_is_inverted); DDX_Control(pDX, IDC_COMBO_THRESHOLDING_METHOD, combo_threshold_method); DDX_Control(pDX, IDC_EDIT_MANUAL_THRESHOLD, field_manual_threshold); DDX_Text(pDX, IDC_EDIT_MANUAL_THRESHOLD, field_manual_threshold_int); DDV_MinMaxInt(pDX, field_manual_threshold_int, 0, 254); DDX_Control(pDX, IDC_EDIT_MANUAL_THRESHOLD_TXT, txt_field_threshold_val); DDX_Control(pDX, IDC_EDIT_SENSITIVITY_TXT, txt_field_threshold_sensitive); DDX_Control(pDX, IDC_PBAR_THRES_SENSITIVITY, pbar_threshold_sensitivity); } //filters if ( is_control_enabled(FILTER_CONTROLS) ) { DDX_Control(pDX, IDC_CHECK_CONTRAST_ENABLE, check_filter_contrast_enable); DDX_Control(pDX, IDC_CHECK_CONVOLVE_ENABLE, check_filter_convolve_enable); DDX_Control(pDX, IDC_CHECK_ANISO_ENABLE, check_filter_aniso_enable); DDX_Control(pDX, IDC_CHECK_VOXREM_ENABLE, check_filter_voxrem_enable); DDX_Control(pDX, IDC_CHECK_CLOSE_ENABLE, check_filter_close_enable); } //save options if ( is_control_enabled(FILESAVE_CONTROLS) ) { DDX_Control(pDX, IDC_CHECK_SAVE_RAW_STACK, check_save_raw_stack); DDX_Control(pDX, IDC_CHECK_SAVE_CBIN_STACK, check_save_cbin_stack); } //progress if ( is_control_enabled(PROGRESS_CONTROLS) ) { DDX_Control(pDX, IDC_EDIT_RUN_PROGRESS_TEXT, txt_field_progress); DDX_Control(pDX, IDC_PBAR_RUN_PROGRESS, pbar_simulation_progress); } //memory req if ( is_control_enabled(MEMORY_CONTROLS) ) { DDX_Control(pDX, IDC_EDIT_REQ_MEM, txt_field_req_mem); } }