#include "stdafx.h" #include "PoroMediaDialogShare.h" //------------------------------------------------------------------------------------ // PoroMediaDialogShare::Write_Result_Header // Description - Call this function to create a .CSV formatted header containing all general dialog information // THEN reopen the file in append mode (ios::app) and fill in run specific information/results //------------------------------------------------------------------------------------ int PoroMediaDialogShare::Write_Result_Header(char* result_file) { fstream result_file_ptr; result_file_ptr.open( result_file, ios::out ); if( !result_file_ptr.is_open() ) { write_to_log("PoroMediaDialogShare::Write_Result_Header - Could not open output file %s.", result_file); return 2; } //run info (header of excel file) //input file info result_file_ptr << "Input file(s):,," << field_directory_and_file_input_str << endl; //file type result_file_ptr << "Input type:,," << ExtensionTypeToString(input_file_ext) << endl; //work directory result_file_ptr << "Work directory:,," << field_directory_work_str << endl; //output prefix result_file_ptr << "Output prefix:,," << field_name_output_str << endl; //run log file result_file_ptr << "Log file:,," << get_log_file_name() << endl; //seperation line result_file_ptr << "___________________________________________________" << endl; //sample size result_file_ptr << ",start,width,end" << endl; result_file_ptr << "Z:," << field_start_slice_int << "," << field_width_slices_int << "," <<field_end_slice_int << endl; result_file_ptr << "X:," << field_start_X_int << "," << field_width_X_int << "," << field_end_X_int << endl; result_file_ptr << "Y:," << field_start_Y_int << "," << field_width_Y_int << "," << field_end_Y_int << endl; //pixel size result_file_ptr << "Pixel size (um),," << field_pixel_size_float << endl; //seperation line result_file_ptr << "___________________________________________________" << endl; //threshold (auto/manual) if ( (input_file_ext != INPUT_IS_BIN) && (input_file_ext != INPUT_IS_BIN_STACK) && (input_file_ext != INPUT_IS_CBIN) && (input_file_ext != INPUT_IS_CBIN_STACK) ) { result_file_ptr << "Threshold:,," << GetIntValFromField(&field_manual_threshold); if (combo_threshold_method.GetCurSel() == 0) result_file_ptr << ",(manual)" << endl; else result_file_ptr << ",(auto)" << endl; //inverted or not if (check_image_is_inverted.GetCheck()) result_file_ptr << " Inverted?,,yes" << endl; else result_file_ptr << " Inverted?,,no" << endl; } else { result_file_ptr << "Input was prebinarized." << endl; } //seperation line result_file_ptr << "___________________________________________________" << endl << endl; result_file_ptr.close(); return 0; }