NIREP
|
00001 #pragma once 00002 #ifndef _NIREP_DEFINITIONS_H_ 00003 #define _NIREP_DEFINITIONS_H_ 00004 00005 //Purpose: Have one file that is full of the definitions throughout NIREP. Most of the 00006 //definitions will be the commands that users will be using to create displays and load in 00007 //data. There are some definitions about the input and output of some of the commands and 00008 //other items deemed necessary. Most items in this file are of the type map. 00009 00010 00011 #include <vector> 00012 #include <string> 00013 #include <map> 00014 #include <algorithm> 00015 00016 // All widget commands are lower case for case insensitive string comparison 00017 // Only make changes to the values of this map since the indexes are fixed 00018 // in the rest of the program. That is to change the widget command in the 00019 // display description from "checkerboard" to "cb" you would change 00020 // m["checkerboard"] = "checkerboard"; to m["checkerboard"] = "cb"; 00021 // The case of the keys do not affect the lowercase comparison and need 00022 // to stay the same as they are here since they are hardcoded throughout 00023 // the program. 00024 typedef std::map<std::string, std::string> WidgetCmdList; 00025 static WidgetCmdList create_widget_cmd_map(){ 00026 WidgetCmdList m; 00027 m["view"] = "view"; // 2 inputs: image, title 00028 m["checkerboard"] = "checkerboard"; // 3 inputs: image1, image2, title 00029 m["wipe"] = "wipe"; // 3 inputs: image1, image2, title 00030 m["objectmap"] = "objectmap"; // 2 inputs: objmap, title 00031 m["overlayObjectMap"] = "overlayobjectmap"; // 3 inputs: image, objmap, title 00032 m["overlayImage"] = "overlayimage"; // 3 inputs: image1, image2, title 00033 m["relativeOverlap"] = "relativeoverlap"; // 3 inputs: objmap1, objmap2, title 00034 m["relativeOverlapTextWidget"] = "relativeoverlaptextwidget"; // 3 inputs: objmap1, objmap2, title 00035 //m["intensityVarianceTextWidget"] = "intensityvariancetextwidget"; // OBSOLETE 00036 m["inverseConsistencyTextWidget"] = "inverseconsistencytextwidget"; // 3 inputs: iceimg, objmap, title 00037 m["transitivityErrorTextWidget"] = "transitivityerrortextwidget"; // 3 inputs: teimg, objmap, title 00038 m["varianceTransformText"] = "variancetransformtext"; // 5 inputs: refimg, images, label, algo, title 00039 m["varianceImageText"] = "varianceimagetext"; // 3 inputs: images, label, title 00040 m["text"] = "text"; // 2 inputs: text_table, title 00041 m["blankWidget"] = "blankwidget"; 00042 m["vectorField"] = "vectorfield"; 00043 m["grid"] = "grid"; 00044 return m; 00045 } 00046 00047 static WidgetCmdList WidgetCmd = create_widget_cmd_map(); 00048 00049 typedef std::map<std::string, std::string> InputTypeList; 00050 static InputTypeList create_input_types_map(){ 00051 InputTypeList m; 00052 m["Cs_id"] = "cs_id"; 00053 m["Label"] = "label"; 00054 m["Algorithm"] = "algorithm"; 00055 m["Image"] = "image"; 00056 m["Images"] = "images"; 00057 m["Transformation"] = "transformation"; 00058 m["Interpolation"] = "interpolation"; 00059 m["Method"] = "method"; 00060 m["Title"] = "title"; 00061 m["Objectmap"] = "objectmap"; 00062 m["ICE"] = "inverse consistency error image"; 00063 m["TE"] = "transitivity error image"; 00064 m["TextTable"] = "text table"; 00065 00066 return m; 00067 } 00068 00069 static InputTypeList InputType = create_input_types_map(); 00070 00071 00072 00073 typedef std::multimap<std::string, std::string> WidgetInputList; 00074 static WidgetInputList create_widget_input_map(){ 00075 WidgetInputList m; 00076 //m["view"] = "(image, title)"; // 2 inputs: image, title 00077 m.insert(std::pair<std::string, std::string>(WidgetCmd["view"],InputType["Image"])); 00078 m.insert(std::pair<std::string, std::string>(WidgetCmd["view"],InputType["Title"])); 00079 00080 //m["checkerboard"] = "(image1,image2,title)"; // 3 inputs: image1, image2, title 00081 m.insert(std::pair<std::string, std::string>(WidgetCmd["checkerboard"],InputType["Image"])); 00082 m.insert(std::pair<std::string, std::string>(WidgetCmd["checkerboard"],InputType["Image"])); 00083 m.insert(std::pair<std::string, std::string>(WidgetCmd["checkerboard"],InputType["Title"])); 00084 00085 //m["wipe"] = "(image1,image2,title)"; // 3 inputs: image1, image2, title 00086 m.insert(std::pair<std::string, std::string>(WidgetCmd["wipe"],InputType["Image"])); 00087 m.insert(std::pair<std::string, std::string>(WidgetCmd["wipe"],InputType["Image"])); 00088 m.insert(std::pair<std::string, std::string>(WidgetCmd["wipe"],InputType["Title"])); 00089 00090 //m["objectmap"] = "(objectmap,title)"; // 2 inputs: objmap, title 00091 m.insert(std::pair<std::string, std::string>(WidgetCmd["objectmap"],InputType["Objectmap"])); 00092 m.insert(std::pair<std::string, std::string>(WidgetCmd["objectmap"],InputType["Title"])); 00093 00094 //m["overlayObjectMap"] = "(image,objectmap,title)"; // 3 inputs: image, objmap, title 00095 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayObjectMap"],InputType["Image"])); 00096 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayObjectMap"],InputType["Objectmap"])); 00097 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayObjectMap"],InputType["Title"])); 00098 00099 //m["overlayImage"] = "(image1,image2,title)"; // 3 inputs: image1, image2, title 00100 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayImage"],InputType["Image"])); 00101 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayImage"],InputType["Image"])); 00102 m.insert(std::pair<std::string, std::string>(WidgetCmd["overlayImage"],InputType["Title"])); 00103 00104 //m["relativeOverlap"] = "(objectmap1,objectmap2,title)"; // 3 inputs: objmap1, objmap2, title 00105 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlap"],InputType["Objectmap"])); 00106 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlap"],InputType["Objectmap"])); 00107 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlap"],InputType["Title"])); 00108 00109 //m["relativeOverlapTextWidget"] = "(objectmap1,objectmap2,title)"; // 3 inputs: objmap1, objmap2, title 00110 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlapTextWidget"],InputType["Objectmap"])); 00111 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlapTextWidget"],InputType["Objectmap"])); 00112 m.insert(std::pair<std::string, std::string>(WidgetCmd["relativeOverlapTextWidget"],InputType["Title"])); 00113 00114 //m["inverseConsistencyTextWidget"] = "(inverse consistency error image,objectmap,title)"; // 3 inputs: iceimg, objmap, title 00115 m.insert(std::pair<std::string, std::string>(WidgetCmd["inverseConsistencyTextWidget"],InputType["ICE"])); 00116 m.insert(std::pair<std::string, std::string>(WidgetCmd["inverseConsistencyTextWidget"],InputType["Objectmap"])); 00117 m.insert(std::pair<std::string, std::string>(WidgetCmd["inverseConsistencyTextWidget"],InputType["Title"])); 00118 00119 //m["transitivityErrorTextWidget"] = "(transitivity error image,objectmap image,title)"; // 3 inputs: teimg, objmap, title 00120 m.insert(std::pair<std::string, std::string>(WidgetCmd["transitivityErrorTextWidget"],InputType["TE"])); 00121 m.insert(std::pair<std::string, std::string>(WidgetCmd["transitivityErrorTextWidget"],InputType["Objectmap"])); 00122 m.insert(std::pair<std::string, std::string>(WidgetCmd["transitivityErrorTextWidget"],InputType["Title"])); 00123 00124 00125 //m["varianceTransformText"] = "(reference image, images, label, algorithm, title)"; // 5 inputs: refimg, images, label, algo, title 00126 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceTransformText"],InputType["Image"])); 00127 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceTransformText"],InputType["Images"])); 00128 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceTransformText"],InputType["Algorithm"])); 00129 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceTransformText"],InputType["Title"])); 00130 00131 00132 //m["varianceImageText"] = "(images, label, title)"; // 3 inputs: images, label, title 00133 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceImageText"],InputType["Images"])); 00134 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceImageText"],InputType["Label"])); 00135 m.insert(std::pair<std::string, std::string>(WidgetCmd["varianceImageText"],InputType["Title"])); 00136 00137 //m["text"] = "(text_table, title)"; // 2 inputs: text_table, title 00138 m.insert(std::pair<std::string, std::string>(WidgetCmd["text"],InputType["TextTable"])); 00139 m.insert(std::pair<std::string, std::string>(WidgetCmd["text"],InputType["Title"])); 00140 return m; 00141 } 00142 00143 static WidgetInputList WidgetInput = create_widget_input_map(); 00144 00147 //static struct DisplayAttributeCommands { 00148 // std::vector<std::string> commands; 00149 // 00150 // DisplayAttributeCommands() { 00151 // commands.push_back("rowSize"); 00152 // commands.push_back("columnSize"); 00153 // commands.push_back("Lock"); 00154 // commands.push_back("CursorLocation"); 00155 // commands.push_back("Slice"); 00156 // commands.push_back("Orientation"); 00157 // commands.push_back("LockAll"); 00158 // }; 00159 //}displayAttributeCommands; 00160 00161 //use global variables 00162 //Display commands 00163 //static struct DisplayAttributeCommands { 00164 // std::vector<std::string> commands; 00165 // 00166 // DisplayAttributeCommands() { 00167 // commands.push_back("rowsize"); 00168 // commands.push_back("columnsize"); 00169 // commands.push_back("lock"); 00170 // commands.push_back("cursorlocation"); 00171 // commands.push_back("slice"); 00172 // commands.push_back("orientation"); 00173 // commands.push_back("lockall"); 00174 // }; 00175 //}displayAttributeCommands; 00176 00177 typedef std::map<std::string, std::string> DisplayAttributeCmdList; 00178 static DisplayAttributeCmdList create_display_attribute_cmd_map(){ 00179 DisplayAttributeCmdList m; 00180 m["Rowsize"] = "rowsize"; 00181 m["Columnsize"] = "columnsize"; 00182 m["Lock"] = "lock"; 00183 m["Cursorlocation"] = "cursorlocation"; 00184 m["Slice"] = "slice"; 00185 m["Orientation"] = "orientation"; 00186 m["Lockall"] = "lockall"; 00187 return m; 00188 } 00189 00190 static DisplayAttributeCmdList DisplayAttributeCmd = create_display_attribute_cmd_map(); 00191 00192 00193 00194 // Gary E. Christensen 00195 // Date: 6/30/2010 00196 // Purpose: make a global list of evaluator commands 00197 // If an evaluator command needs to be modified, it can be modified 00198 // here without having to change hard coded evaluator commands throughout 00199 // code. Currently, the value and the tags are identical, but this 00200 // does not have to remain the case if someone wants to change the name 00201 // of a command such as to shorten it. 00202 // All values of list are lower case for string comparison to make case 00203 // insensitive 00204 00205 typedef std::map<std::string, std::string> EvaluatorCmdList; 00206 static EvaluatorCmdList create_eval_cmd_map(){ 00207 EvaluatorCmdList m; 00208 m["SpatialData"] = "spatialdata"; // 2 inputs: cs_id, label 00209 m["Transformation"] = "transformation"; // 3 inputs: cs1_id, cs2_id, algo 00210 m["Diff"] = "diff"; // 2 inputs: image1, image2 00211 m["Disp0"] = "xdisp"; // 1 input: trans 00212 m["Disp1"] = "ydisp"; // 1 input: trans 00213 m["Disp2"] = "zdisp"; // 1 input: trans 00214 m["Jacobian"] = "jacobian"; // 1 input: trans 00215 m["TransformImage"] = "transformimage"; // 3 inputs: image, trans, interp (NEED CHANGE) 00216 m["InvertTransformation"] = "inverttransformation"; // 1 input: trans 00217 m["InverseConsistencyErrorImage"] = "inverseconsistencyerrorimage"; // 3 inputs: fwd_trans, rev_trans, method 00218 m["TransitivityErrorImage"] = "transitivityerrorimage"; // 4 inputs: trans12, trans23, trans31, method 00219 m["IntensityVarianceTransform"] = "intensityvariancetransform"; // 4 inputs: refimg, images, label, algo 00220 m["IntensityVarianceImage"] = "intensityvarianceimage"; // 2 inputs: images, label 00221 m["TransformGrid"] = "transformgrid"; 00222 m["VectorField"] = "vectorfield"; 00223 return m; 00224 } 00225 00226 static EvaluatorCmdList EvalCmd = create_eval_cmd_map(); 00227 00228 00229 00230 typedef std::multimap<std::string, std::string > EvaluatorInputList; 00231 static EvaluatorInputList create_eval_input_map(){ 00232 EvaluatorInputList m; 00233 m.insert(std::pair<std::string, std::string>(EvalCmd["SpatialData"],InputType["Cs_id"])); 00234 m.insert(std::pair<std::string, std::string>(EvalCmd["SpatialData"],InputType["Label"])); 00235 00236 m.insert(std::pair<std::string, std::string>(EvalCmd["Transformation"],InputType["Cs_id"])); 00237 m.insert(std::pair<std::string, std::string>(EvalCmd["Transformation"],InputType["Cs_id"])); 00238 m.insert(std::pair<std::string, std::string>(EvalCmd["Transformation"],InputType["Algorithm"])); 00239 00240 m.insert(std::pair<std::string, std::string>(EvalCmd["Diff"],InputType["Image"])); 00241 m.insert(std::pair<std::string, std::string>(EvalCmd["Diff"],InputType["Image"])); 00242 00243 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp0"],InputType["Transformation"])); 00244 00245 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp1"],InputType["Transformation"])); 00246 00247 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp2"],InputType["Transformation"])); 00248 00249 m.insert(std::pair<std::string, std::string>(EvalCmd["Jacobian"],InputType["Transformation"])); 00250 00251 m.insert(std::pair<std::string, std::string>(EvalCmd["TransformImage"],InputType["Image"])); 00252 m.insert(std::pair<std::string, std::string>(EvalCmd["TransformImage"],InputType["Transformation"])); 00253 //m.insert(std::pair<std::string, std::string>(EvalCmd["TransformImage"],InputType["Interpolation"])); this is not implemented yet 00254 00255 m.insert(std::pair<std::string, std::string>(EvalCmd["InvertTransformation"],InputType["Transformation"])); 00256 00257 m.insert(std::pair<std::string, std::string>(EvalCmd["InverseConsistencyErrorImage"],InputType["Transformation"])); 00258 m.insert(std::pair<std::string, std::string>(EvalCmd["InverseConsistencyErrorImage"],InputType["Transformation"])); 00259 m.insert(std::pair<std::string, std::string>(EvalCmd["InverseConsistencyErrorImage"],InputType["Method"])); 00260 00261 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["Transformation"])); 00262 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["Transformation"])); 00263 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["Transformation"])); 00264 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["Method"])); 00265 00266 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceTransform"],InputType["Image"])); 00267 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceTransform"],InputType["Images"])); 00268 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceTransform"],InputType["Label"])); 00269 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceTransform"],InputType["Algorithm"])); 00270 00271 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceImage"],InputType["Images"])); 00272 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceImage"],InputType["Label"])); 00273 00274 return m; 00275 } 00276 00277 static EvaluatorInputList EvalInput = create_eval_input_map(); 00278 00279 // Jeffrey Hawley 00280 // Date: 7/21/2010 00281 // Purpose: make a global list of data types 00282 00283 typedef std::multimap<std::string, std::string> EvalOutputList; 00284 static EvalOutputList create_eval_output_map(){ 00285 EvalOutputList m; 00286 m.insert(std::pair<std::string, std::string>(EvalCmd["SpatialData"],InputType["Image"])); 00287 m.insert(std::pair<std::string, std::string>(EvalCmd["SpatialData"],InputType["Objectmap"])); 00288 00289 m.insert(std::pair<std::string, std::string>(EvalCmd["Transformation"],InputType["Transformation"])); 00290 00291 m.insert(std::pair<std::string, std::string>(EvalCmd["Diff"],InputType["Image"])); 00292 00293 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp0"],InputType["Image"])); 00294 00295 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp1"],InputType["Image"])); 00296 00297 m.insert(std::pair<std::string, std::string>(EvalCmd["Disp2"],InputType["Image"])); 00298 00299 m.insert(std::pair<std::string, std::string>(EvalCmd["Jacobian"],InputType["Image"])); 00300 00301 m.insert(std::pair<std::string, std::string>(EvalCmd["TransformImage"],InputType["Image"])); 00302 00303 m.insert(std::pair<std::string, std::string>(EvalCmd["InvertTransformation"],InputType["Image"])); 00304 00305 m.insert(std::pair<std::string, std::string>(EvalCmd["InverseConsistencyErrorImage"],InputType["ICE"])); 00306 m.insert(std::pair<std::string, std::string>(EvalCmd["InverseConsistencyErrorImage"],InputType["Image"])); 00307 00308 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["Image"])); 00309 m.insert(std::pair<std::string, std::string>(EvalCmd["TransitivityErrorImage"],InputType["TE"])); 00310 00311 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceTransform"],InputType["Image"])); 00312 00313 m.insert(std::pair<std::string, std::string>(EvalCmd["IntensityVarianceImage"],InputType["Image"])); 00314 return m; 00315 } 00316 00317 static EvalOutputList EvalOutput = create_eval_output_map(); 00318 00319 00320 // Jeffrey Hawley 00321 // Date: 7/21/2010 00322 // Purpose: make a global list of data types 00323 00324 typedef std::map<std::string, std::string> DataTypeList; 00325 static DataTypeList create_data_type_map(){ 00326 DataTypeList m; 00327 m["Image"] = "image"; 00328 m["Objectmap"] = "objectmap"; 00329 m["Transformation"] = "transformation"; 00330 00331 //This will be uncommented when we implement these 00332 //in GenerateRDL, need to check to see if these are 00333 //used anywhere else like NIREPDataManager 00334 //m["Jacobin"] = "jacobin"; 00335 //m["TransformImage"] = "transformimage"; 00336 //m["ICEImage"] = "ice_image"; 00337 //m["TEImage"] = "te_image"; 00338 return m; 00339 } 00340 00341 static DataTypeList DataType = create_data_type_map(); 00342 00343 00344 // Jeffrey Hawley 00345 // Date: 7/21/2010 00346 // Purpose: make a global list of format types 00347 00348 typedef std::map<std::string, std::string> TransformFormatList; 00349 static TransformFormatList create_transform_format_map(){ 00350 TransformFormatList m; 00351 m["Displacement"] = "displacement"; 00352 m["Displacement3"] = "displacement3"; 00353 m["SICLE_coeff"] = "sicle_coeff"; 00354 m["Air5"] = "air5"; 00355 return m; 00356 } 00357 00358 static TransformFormatList TransformFormat = create_transform_format_map(); 00359 00360 // Jeffrey Hawley 00361 // Date: 7/21/2010 00362 // Purpose: make a global list of format types 00363 00364 typedef std::map<std::string, std::string> TransformUnitsList; 00365 static TransformUnitsList create_transform_units_map(){ 00366 TransformUnitsList m; 00367 m["Unit_cube"] = "unit_cube"; 00368 m["Physical_space"] = "physical_space"; 00369 m["Image_space"] = "image_space"; 00370 return m; 00371 } 00372 00373 static TransformUnitsList TransformUnits = create_transform_units_map(); 00374 00375 00376 // Jeffrey Hawley 00377 // Date: 8/12/2010 00378 // Purpose: make a global list of extensions 00379 00380 typedef std::multimap<std::string, std::string> FileExtensionList; 00381 static FileExtensionList create_file_extension_map(){ 00382 FileExtensionList m; 00383 m.insert(std::pair<std::string, std::string>("hdr", DataType["Image"])); 00384 00385 m.insert(std::pair<std::string, std::string>("img",DataType["Image"])); 00386 00387 m.insert(std::pair<std::string, std::string>("nii",DataType["Image"])); 00388 m.insert(std::pair<std::string, std::string>("nii.gz",DataType["Image"])); 00389 m.insert(std::pair<std::string, std::string>("raw",DataType["Image"])); 00390 00391 m.insert(std::pair<std::string, std::string>("obj",DataType["Objectmap"])); 00392 00393 m.insert(std::pair<std::string, std::string>("lmk","Landmark")); 00394 00395 m.insert(std::pair<std::string, std::string>("coeff",DataType["Transformation"]));//"Sicle")); 00396 m.insert(std::pair<std::string, std::string>("coeff",TransformFormat["SICLE_coeff"])); 00397 00398 m.insert(std::pair<std::string, std::string>("warp",DataType["Transformation"]));//"AIR")); 00399 m.insert(std::pair<std::string, std::string>("warp",TransformFormat["Air5"])); 00400 return m; 00401 } 00402 00403 static FileExtensionList FileExtension = create_file_extension_map(); 00404 00405 typedef std::map<std::string, std::string> InterpolationTypeList; 00406 static InterpolationTypeList create_interpolation_type_map(){ 00407 InterpolationTypeList m; 00408 m["Linear"] = "linear"; 00409 m["Nearest Neighbor"] = "nearest neighbor"; 00410 return m; 00411 } 00412 00413 static InterpolationTypeList InterpolationType = create_interpolation_type_map(); 00414 00415 00421 00422 //---------------------------------------------------------------------------------------- 00423 //We want to depreciate this and use the wxString CmpNoCase 00424 //Instead of using CaseInsensitiveFind function use the following code: 00425 //wxString string1 = "Hello"; 00426 //wxString string2 = "hello"; 00427 //if(string2.CmpNoCase(string1) == 0) { 00428 // success 00429 //} else { 00430 // fail 00431 //} 00432 00433 static bool CaseInsensitiveFind(std::string string1, std::string string2){ 00434 00435 // Convert string1 to lower case for comparison 00436 std::transform(string1.begin(), string1.end(), string1.begin(), tolower); 00437 std::transform(string2.begin(), string2.end(), string2.begin(), tolower); 00439 //wxString temp_str = (wxT(string1.c_str())); 00440 //temp_str.Trim(true); 00441 //temp_str.Trim(false); 00442 //string1 = temp_str.c_str(); 00443 00444 // Trim spaces from left and right side of string2 00445 // Don't need to do this for string1 because we are looking 00446 // for string2 inside of string1 00447 wxString temp_str(string2.c_str(), wxConvUTF8); 00448 temp_str.Trim(true); 00449 temp_str.Trim(false); 00450 string2 = std::string(temp_str.mb_str()); 00451 00452 size_t found = string1.find(string2); 00453 00454 // found equals npos if string2 is not found in string1 00455 if (found == std::string::npos){ 00456 return false; 00457 } else { 00458 return true; 00459 } 00460 00461 } 00462 00463 #endif 00464