@@ -2248,9 +2248,7 @@ int GCSArelabelWithAseg(GCSA *gcsa, MRI_SURFACE *mris, MRI *mri_aseg)
2248
2248
{
2249
2249
int old_index, vno, vno_classifier, vno_prior, label, index, changed, cc_annotation;
2250
2250
VERTEX *v, *v_classifier, *v_prior;
2251
- GCSA_NODE *gcsan;
2252
- CP_NODE *cpn;
2253
- double v_inputs[100 ], p;
2251
+ double v_inputs[100 ], p[3 ];
2254
2252
double x, y, z;
2255
2253
2256
2254
for (changed = vno = 0 ; vno < mris->nvertices ; vno++) {
@@ -2267,11 +2265,11 @@ int GCSArelabelWithAseg(GCSA *gcsa, MRI_SURFACE *mris, MRI *mri_aseg)
2267
2265
v_classifier = GCSAsourceToClassifierVertex (gcsa, v_prior);
2268
2266
vno_classifier = v_classifier - gcsa->mris_classifiers ->vertices ;
2269
2267
if (vno_classifier == Gdiag_no) DiagBreak ();
2270
- gcsan = &gcsa->gc_nodes [vno_classifier];
2268
+ GCSA_NODE * gcsan = &gcsa->gc_nodes [vno_classifier];
2271
2269
2272
2270
CTABfindAnnotation (mris->ct , v->annotation , &old_index);
2273
2271
2274
- cpn = &gcsa->cp_nodes [vno_prior];
2272
+ CP_NODE * cpn = &gcsa->cp_nodes [vno_prior];
2275
2273
if (IS_CC (label)) {
2276
2274
CTABfindName (mris->ct , " corpuscallosum" , &index);
2277
2275
if (index < 0 ) CTABfindName (mris->ct , " Medial_wall" , &index);
@@ -2291,7 +2289,7 @@ int GCSArelabelWithAseg(GCSA *gcsa, MRI_SURFACE *mris, MRI *mri_aseg)
2291
2289
else if (old_index >= 0 && mris->ct && !stricmp (mris->ct ->entries [old_index]->name , " corpuscallosum" )) {
2292
2290
// find 2nd most likely label that isn't callosum
2293
2291
CTABannotationAtIndex (mris->ct , old_index, &cc_annotation);
2294
- label = GCSANclassify (gcsan, cpn, v_inputs, gcsa->ninputs , & p, &cc_annotation, 1 , vno);
2292
+ label = GCSANclassify (gcsan, cpn, v_inputs, gcsa->ninputs , p, &cc_annotation, 1 , vno);
2295
2293
if (label != v->annotation ) {
2296
2294
changed++;
2297
2295
v->annotation = label;
@@ -2305,9 +2303,7 @@ int GCSAreclassifyMarked(GCSA *gcsa, MRI_SURFACE *mris, int mark, int *exclude_l
2305
2303
{
2306
2304
int old_index, vno, vno_classifier, vno_prior, label, index, changed, num, n;
2307
2305
VERTEX *v, *v_classifier, *v_prior, *vn;
2308
- GCSA_NODE *gcsan;
2309
- CP_NODE *cpn;
2310
- double v_inputs[100 ], p;
2306
+ double v_inputs[100 ], p[3 ];
2311
2307
2312
2308
for (changed = vno = 0 ; vno < mris->nvertices ; vno++) {
2313
2309
v = &mris->vertices [vno];
@@ -2321,12 +2317,12 @@ int GCSAreclassifyMarked(GCSA *gcsa, MRI_SURFACE *mris, int mark, int *exclude_l
2321
2317
v_classifier = GCSAsourceToClassifierVertex (gcsa, v_prior);
2322
2318
vno_classifier = v_classifier - gcsa->mris_classifiers ->vertices ;
2323
2319
if (vno_classifier == Gdiag_no) DiagBreak ();
2324
- gcsan = &gcsa->gc_nodes [vno_classifier];
2320
+ GCSA_NODE * gcsan = &gcsa->gc_nodes [vno_classifier];
2325
2321
2326
2322
CTABfindAnnotation (mris->ct , v->annotation , &old_index);
2327
2323
2328
- cpn = &gcsa->cp_nodes [vno_prior];
2329
- label = GCSANclassify (gcsan, cpn, v_inputs, gcsa->ninputs , & p, exclude_list, nexcluded, vno);
2324
+ CP_NODE * cpn = &gcsa->cp_nodes [vno_prior];
2325
+ label = GCSANclassify (gcsan, cpn, v_inputs, gcsa->ninputs , p, exclude_list, nexcluded, vno);
2330
2326
if (label >= 0 && label != v->annotation ) {
2331
2327
changed++;
2332
2328
v->annotation = label;
@@ -2337,9 +2333,13 @@ int GCSAreclassifyMarked(GCSA *gcsa, MRI_SURFACE *mris, int mark, int *exclude_l
2337
2333
that had nonzero priors and reclassify them based on nbrs. */
2338
2334
do {
2339
2335
for (num = vno = 0 ; vno < mris->nvertices ; vno++) {
2340
- VERTEX_TOPOLOGY const * const vt = &mris->vertices_topology [vno];
2341
2336
v = &mris->vertices [vno];
2342
2337
if (v->ripflag || v->marked != mark) continue ;
2338
+ VERTEX_TOPOLOGY const * const vt = &mris->vertices_topology [vno];
2339
+ /* moved to before assigning VERTEX_TOPOLOGY const * const vt
2340
+ * v = &mris->vertices[vno];
2341
+ * if (v->ripflag || v->marked != mark) continue;
2342
+ */
2343
2343
if (vno == Gdiag_no) DiagBreak ();
2344
2344
for (n = 0 ; n < vt->vnum ; n++) {
2345
2345
vn = &mris->vertices [vt->v [n]];
0 commit comments