@@ -324,7 +324,7 @@ class HeadPlot {
324324 // initialize the image
325325 for (int Iy = 0 ; Iy < headImage. height ; Iy ++ ) {
326326 for (int Ix = 0 ; Ix < headImage. width ; Ix ++ ) {
327- headImage. set(Ix , Iy , OPENBCI_DARKBLUE );
327+ headImage. set(Ix , Iy , WHITE );
328328 }
329329 }
330330
@@ -992,7 +992,7 @@ class HeadPlot {
992992 headImage. set(Ix , Iy , calcPixelColor(Ix , Iy ));
993993 } else { // negative values are outside of the head
994994 // pixel is outside the head. set to black.
995- headImage. set(Ix , Iy , OPENBCI_DARKBLUE );
995+ headImage. set(Ix , Iy , WHITE );
996996 }
997997 }
998998 }
@@ -1004,32 +1004,17 @@ class HeadPlot {
10041004 // is this pixel inside the head?
10051005 if (electrode_color_weightFac[0 ][Ix ][Iy ] >= 0.0 ) { // zero and positive values are inside the head
10061006 // it is inside the head. set the color based on the electrodes
1007+ headVoltage[Ix ][Iy ] = calcPixelVoltage(Ix , Iy , headVoltage[Ix ][Iy ]);
10071008 headImage. set(Ix , Iy , calcPixelColor(headVoltage[Ix ][Iy ]));
10081009 } else { // negative values are outside of the head
10091010 // pixel is outside the head. set to black.
1010- headImage. set(Ix , Iy , OPENBCI_DARKBLUE );
1011- }
1012- }
1013- }
1014- }
1015-
1016-
1017- private void updateHeadVoltages () {
1018- for (int Iy = 0 ; Iy < headImage. height ; Iy ++ ) {
1019- for (int Ix = 0 ; Ix < headImage. width ; Ix ++ ) {
1020- // is this pixel inside the head?
1021- if (electrode_color_weightFac[0 ][Ix ][Iy ] >= 0.0 ) { // zero and positive values are inside the head
1022- // it is inside the head. set the voltage based on the electrodes
1023- headVoltage[Ix ][Iy ] = calcPixelVoltage(Ix , Iy , headVoltage[Ix ][Iy ]);
1024- } else { // negative values are outside of the head
1025- // pixel is outside the head.
10261011 headVoltage[Ix ][Iy ] = - 1.0 ;
1012+ headImage. set(Ix , Iy , WHITE );
10271013 }
10281014 }
10291015 }
10301016 }
10311017
1032- int count_call= 0 ;
10331018 private float calcPixelVoltage (int pixel_Ix , int pixel_Iy , float prev_val ) {
10341019 float weight, elec_volt;
10351020 int n_elec = electrode_xy. length;
@@ -1225,7 +1210,6 @@ class HeadPlot {
12251210 } else {
12261211 // update head voltages
12271212 if (! threadLock && hardCalcsDone) {
1228- updateHeadVoltages();
12291213 convertVoltagesToHeadImage();
12301214 }
12311215 }
@@ -1240,14 +1224,14 @@ class HeadPlot {
12401224 pushStyle ();
12411225 smooth ();
12421226 // draw head parts
1243- fill (255 , 255 , 255 );
1244- stroke (125 , 125 , 125 );
1227+ fill (WHITE );
1228+ stroke (GREY_125 );
12451229 triangle (nose_x[0 ], nose_y[0 ], nose_x[1 ], nose_y[1 ], nose_x[2 ], nose_y[2 ]); // nose
12461230 ellipse (earL_x, earL_y, ear_width, ear_height); // little circle for the ear
12471231 ellipse (earR_x, earR_y, ear_width, ear_height); // little circle for the ear
12481232
12491233 // draw head itself
1250- fill (255 , 255 , 255 , 255 ); // fill in a white head
1234+ fill (WHITE ); // fill in a white head
12511235 strokeWeight (1 );
12521236 ellipse (circ_x, circ_y, circ_diam, circ_diam); // big circle for the head
12531237 if (drawHeadAsContours) {
@@ -1281,7 +1265,7 @@ class HeadPlot {
12811265 }
12821266
12831267 // add labels to electrodes
1284- fill (0 , 0 , 0 );
1268+ fill (OPENBCI_DARKBLUE );
12851269 textFont (font);
12861270 textAlign (CENTER , CENTER );
12871271 for (int i= 0 ; i < electrode_xy. length; i++ ) {
0 commit comments