Update Categories based on info in AbstractCoordinator */
| 196 | |
| 197 | /** Update Categories based on info in AbstractCoordinator */ |
| 198 | void AbstractMapCanvas::CreateAndUpdateCategories() |
| 199 | { |
| 200 | SyncVarInfoFromCoordinator(); |
| 201 | cat_data.CreateEmptyCategories(num_time_vals, num_obs); |
| 202 | |
| 203 | |
| 204 | double sig_cutoff = a_coord->GetSignificanceCutoff(); |
| 205 | int s_f = a_coord->GetSignificanceFilter(); |
| 206 | int set_perm = a_coord->GetNumPermutations(); |
| 207 | int num_obs = a_coord->num_obs; |
| 208 | double stop_sig = 1.0 / (1.0 + set_perm); |
| 209 | std::vector<wxString> def_cats = a_coord->GetDefaultCategories(); |
| 210 | std::vector<double> def_cutoffs = a_coord->GetDefaultCutoffs(); |
| 211 | |
| 212 | bool is_cust_cutoff = true; |
| 213 | for (int i=0; i<NUM_SIG_CATS; i++) { |
| 214 | if (sig_cutoff == def_cutoffs[i]) { |
| 215 | is_cust_cutoff = false; |
| 216 | break; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | for (int t=0; t<num_time_vals; t++) { |
| 221 | if (!map_valid[t]) break; |
| 222 | |
| 223 | bool has_isolates = a_coord->GetHasIsolates(t); |
| 224 | bool has_undefined = a_coord->GetHasUndefined(t); |
| 225 | double* p = a_coord->GetLocalSignificanceValues(t); |
| 226 | int* cluster = a_coord->GetClusterIndicators(t); |
| 227 | |
| 228 | int undefined_cat = -1; |
| 229 | int isolates_cat = -1; |
| 230 | int num_cats = 0; |
| 231 | |
| 232 | if ( has_isolates ) |
| 233 | num_cats++; |
| 234 | |
| 235 | if ( has_undefined ) |
| 236 | num_cats++; |
| 237 | |
| 238 | if (is_clust) { |
| 239 | // NotSig LL HH LH HL |
| 240 | SetLabelsAndColorForClusters(num_cats, t, cat_data); |
| 241 | |
| 242 | } else { |
| 243 | // significance map |
| 244 | // 0: >0.05 (Not sig) 1: 0.05, 2: 0.01, 3: 0.001, 4: 0.0001, 5: 0.00001 |
| 245 | num_cats += 1; // not sig category |
| 246 | |
| 247 | if (is_cust_cutoff) { |
| 248 | num_cats += 1; |
| 249 | } else { |
| 250 | for (int j=0; j < NUM_SIG_CATS; j++) { |
| 251 | if (sig_cutoff >= def_cutoffs[j] && stop_sig <= def_cutoffs[j]) { |
| 252 | num_cats += 1; |
| 253 | } |
| 254 | } |
| 255 | } |
no test coverage detected