Difference between revisions of "PlugIn Algorithm Median (con't, part 4)"

From MIPAV
Jump to: navigation, search
 
Line 1: Line 1:
 
{|
 
{|
1200 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (!sliceFiltering)<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1201 kernel = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new byte</font>'''</span>[kernelSize*kernelSize*kernelSize];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1202 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1203 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (OutOfMemoryError e) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1204 displayError("Algorithm Median reports: not enough memory to form a kernel mask.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1205 setCompleted(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">false</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1206 setThreadStopped(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1207 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return;</font>'''</span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1208 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1209 setKernel();<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1210 makeKernelMask();<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1211 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1212 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1213 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> /**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1214 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Fill in the mask for which pixels are used in filtering.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1215 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1216 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1217 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> setKernel() {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1218 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1219 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> halfK = kernelSize/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1220 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1221 // square/box<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1222 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ( (kernelShape == SQUARE_KERNEL) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1223 (kernelShape == CUBE_KERNEL)) { <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1224 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i=0; i &lt; kernel.length; i )<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1225 kernel[i] = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1226 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1227 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end square/cube kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1228 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1229 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// cross/axial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1230 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ((kernelShape == CROSS_KERNEL) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1231 (kernelShape == AXIAL_KERNEL)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1232 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1233 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1234 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1235 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1236 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1237 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1238 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1239 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1240 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;} <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// should be for a cross -&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1241 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // else if</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1242 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">(row == halfK) {kernel[i] = 1;}</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1243 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1244 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1245 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1246 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1247 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1248 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1249 slice = i/(kernelSize*kernelSize);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1250 row = (i%(kernelSize*kernelSize))/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1251 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1252 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1253 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (slice == halfK) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1254 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1255 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1256 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1257 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1258 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ((row == halfK) &amp;&amp; (col == halfK)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1259 kernel[i] = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1260 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1261 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1262 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1263 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1264 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end cross/axial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1265 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ( kernelShape == VERT_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1266 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1267 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1268 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1269 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1270 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1271 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1272 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1273 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1274 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1275 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1276 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1277 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1278 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1279 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1280 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end vert</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1281 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1282 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ( kernelShape == HORZ_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1283 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1284 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1285 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1286 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1287 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1288 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1289 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1290 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1291 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1292 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1293 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1294 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1295 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1296 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1297 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end vert</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1298 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1299 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 'x' kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1300 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1301 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1302 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1303 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> revcol; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// runs opposite of the col.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1304 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1305 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1306 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1307 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1308 revcol = kernelSize - 1 - col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1309 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1310 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (row == col) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1311 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == revcol) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1312 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1313 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1314 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1315 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1316 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1317 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1318 slice = i/(kernelSize*kernelSize);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1319 row = (i%(kernelSize*kernelSize))/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1320 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1321 revcol = kernelSize - 1 - col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1322 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1323 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ((slice == col) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1324 (slice == revcol)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1325 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (row == col) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1326 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == revcol) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1327 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1328 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1329 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1330 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1331 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1332 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end 'x' kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1333 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1334 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1335 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1336 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1337 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1338 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* Makes the kernel mask.</nowiki></font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1339 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The kernel mask is the list of values pulled from the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1340 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * image which will be used to find the median of the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1341 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * central pixel. Its length is</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1342 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;i&gt;(number of pixels to be used to determine median) 1&lt;/i&gt;.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1343 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;p&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1344 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Thus the kernel center (decided here), has the value of</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1345 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the location of the central pixel shown in the window.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1346 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The value of the kernel center is the number of pixels picked</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1347 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * up to median sort.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1348 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1349 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Since the kernel mask is &lt;i&gt;number of pixels 1&lt;/i&gt;,</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1350 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the maskCenter must be</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1351 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1352 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> makeKernelMask() {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1353 halfK = kernelSize/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1354 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// figure how many kernel elements are actually in the kernel-mask</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1355 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> count = 1;<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // start counting from one, since sort starts with element</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">1 </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1356 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // (even empty mask must have 1 element!)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1357 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> m = 0; m &lt; kernel.length; m ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1358 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[m] != 0) <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// if this element is marked 'on'</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1359 count ;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1360 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1361 kernelMask = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new float</font>'''</span>[count]; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// must have the leading element empty: the sort</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1362 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">starts with element 1</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1363 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 2D</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1364 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1365 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernelShape == SQUARE_KERNEL){<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1366 kernelCenter = count/2 - 1; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole square</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1367 maskCenter = halfK*(kernelSize 1) 1; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// count/2 : I feel dumb</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1368 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1369 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == CROSS_KERNEL || kernelShape == VERT_KERNEL || kernelShape == <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1370 HORZ_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1371 kernelCenter = halfK*(kernelSize 1);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1372 maskCenter = kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1373 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1374 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sizeof kernel is same as CROSS_KERNEL</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1375 kernelCenter = halfK*(kernelSize 1); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole square -- (count/2-1)??</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1376 maskCenter = kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1377 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1378 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1379 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//3D</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1380 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if </font>'''</span>(kernelShape == CUBE_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1381 kernelCenter = count/2 - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1382 maskCenter = halfK*(kernelSize*kernelSize kernelSize 1) 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1383 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1384 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == AXIAL_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1385 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole cube</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1386 maskCenter = count/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// i feel dumb...</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1387 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1388 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sizeof kernel is same as AXIAL_KERNEL</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1389 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole cube</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1390 maskCenter = count/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// i feel dumb...</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1391 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1392 }<br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1393 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// not entirely dumb. mc = count/2 because of the symmetry of the mask. Custom masks</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1394 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// may be diff. &amp; i'd like to include custom masks someday....</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1395 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1396 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1397 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1398 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Compiles a list of the values neighboring the desired pixel, that are defined</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1399 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * in the kernel. Be careful because although the kernel starts its index at 0,</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1400 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the list that is returned starts indexing at 1.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1401 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;p&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1402 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Color images are processed differently from the monochrome images because</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1403 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * although color images use the same size kernel as mono images, it fills the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1404 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * kernel with brightness levels that are spread out in the data set. The</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1405 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Neighbor list still reports the monochromatic brightness values. That is, for</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1406 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * a color image: the neighbors of the central pixel with the same color are</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1407 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * returned in the neighbor list's kernel.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1408 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param i The central pixel to find neighbors for.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1409 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param data Image data</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1410 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param is2D True indicates that the neighbors are found along a</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1411 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * 2D slice (or 2D image) instead of neighbors in a 3D volume.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1412 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The neighboring pixel list, where the list starts at 1 (leaving the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1413 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> initial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1414 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * element 0), and corresponds to the kernel chosen.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1415 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1416 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span>[] getNeighborList(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>[] data, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">boolean</font>'''</span> is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1417 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row, col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1418 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> kCenter = kernelCenter; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// index to the central element of the kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1419 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// (this is the mask for which elements in data are</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1420 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // used.)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1421 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> width = 0; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// width of slice in number of pixels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1422 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> height = 0; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// height of slice in number of pixels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1423 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1424 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1425 width = srcImage.getExtents()[0];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1426 height = srcImage.getExtents()[1];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1427 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1428 Preferences.debug("AlgorithmMedian: null pointer while making neighbor list.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1429 setThreadStopped(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1430 setCompleted(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">false</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1431 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1432 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> sliceWidth = width * valuesPerPixel; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// width of slice in number of</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1433 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // elements</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1434 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1435 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// place all the masked 'on' elements into the data-list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1436 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> count = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1437 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// color images are different from the mono images in that though color images</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1438 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // use the same size kernel as mono images, but fill it with brightness levels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1439 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // that are spread out in the data set.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1440 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1441 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> kcol;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1442 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> leftBound = -halfK * 4;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1443 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> rightBound = halfK * 4;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1444 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1445 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all rows</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1446 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = leftBound, kcol = -halfK; col &lt;= rightBound; col = 4, kcol ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1447 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through every 4th column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1448 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter kcol row*kernelSize] != 0) {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// but don't bother</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1449 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // copying into the list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1450 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // if we don't want that</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1451 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // that element (the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1452 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // kernel's pixl is zero)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1453 kernelMask[count ] = data[i col row*sliceWidth];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1454 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1455 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1456 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1457 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1458 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// find neighbors in a volume</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1459 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1460 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// halfK-number of kernelSize slices (to get to the center slice)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1461 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (slice = -halfK; slice &lt;= halfK; slice ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1462 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1463 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = leftBound, kcol = -halfK; col &lt;= rightBound; col = 4, kcol ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1464 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter kcol row*kernelSize slice*kernelSize*kernelSize]<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1465 != 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1466 kernelMask[count ] = <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1467 data[i col row*sliceWidth slice*sliceWidth*height];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1468 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1469 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1470 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1471 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1472 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1473 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1474 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// a mono image</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1475 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1476 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all rows</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1477 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = -halfK; col &lt;= halfK; col ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all columns</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1478 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter col row*kernelSize] != 0) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// but don't bother</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1479 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // copying into the list </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1480 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// if we don't want </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1481 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// that element (the </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1482 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // kernel's pixl is zero)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1483 kernelMask[count ] = data[i col row*width];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1484 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1485 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1486 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1487 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1488 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (isColorImage) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 2D filtering of color images is a little different</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1489 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // than of mono images</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1490 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// find neighbors in a volume</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1491 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1492 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// halfK-number of kernelSize slices (to get to the center slice)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1493 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (slice = -halfK; slice &lt;= halfK; slice ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1494 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) {<br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1495 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = -halfK; col &lt;= halfK; col ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1496 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter col row*kernelSize slice*kernelSize*kernelSize] !=<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1497 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1498 kernelMask[count ] = data[i col row*width slice*width*height];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1499 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1500 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1501 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1502 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1503 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1504 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1505 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (kernelMask);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1506 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1507 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1508 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1509 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Sorts a list of values. Taken from Numerical Recipes in C, 2nd ed. William H.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1510 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Press, et al, page 332. Chose shell sort over a quicksort because both shell</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1511 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * and quick are about the same speed for the middle range of sizes of the list. </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1512 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The list is more likely during a slice-filter operation to be smaller than the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1513 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * maximum 121 length. The list could be as much as 1331 elements, but according</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1514 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * to Numerical Recipes, it still runs fast enough at only N**1.25 an average for</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1515 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * N &lt; 60000). My guess is that sliceFilter is more useful than a volumeFilter</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1516 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * and will be plenty fast enough to not necessitate a quicksort for a</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1517 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * debatable speed-increase.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1518 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1519 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param float a[] The list to sort.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1520 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1521 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final void</font>'''</span> shellSort(float a[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1522 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N = a.length - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1523 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i, j;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1524 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> inc = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1525 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> val;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1526 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1527 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">do</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1528 inc *=3;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1529 inc ;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1530 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (inc &lt;= N);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1531 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">do</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1532 inc /=3;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1533 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = inc 1; i &lt;= N; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1534 val = a[i];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1535 j = i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1536 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (a[j - inc] &gt; val) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1537 a[j] = a[j - inc];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1538 j -= inc;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1539 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (j &lt;= inc) <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">break</font>'''</span><nowiki>;</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1540 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1541 a[j] = val;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1542 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1543 }<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (inc &gt; 1);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1544 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1545 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1546 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the median value of the list. Median assumes the list of values starts</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1547 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * at index 1, not an index of 0. (i.e., 1st element is not included.)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1548 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list List of numbers</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1549 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The median.</font></span><br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1550 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @author parsonsd</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1551 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1552 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> median(float list[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1553 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1554 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> med;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1555 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1556 N = list.length - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1557 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1558 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ((N%2) != 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1559 med = list[N/2];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1560 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1561 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1562 med = (list[N/2] list[N/2 1])/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1563 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1564 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (med);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1565 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1566 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1567 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1568 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the mean value (average) in the list. Mean assumes the list of </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1569 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * values starts at index 1, not an index of 0. (i.e., 1st element is not</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1570 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * included.) </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1571 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list List of numbers</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1572 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return float The mean.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1573 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @author parsonsd</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1574 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1575 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> mean(float list[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1576 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1577 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> sum = 0;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1578 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1579 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 1; i &lt; list.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1580 sum = list[i];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1581 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1582 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>)(sum/(list.length - 1)); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// length-1 because list goes from </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1583 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // [1 ... N]</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1584 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1585 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1586 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1587 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the standard deviation of the values in the input list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1588 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * (defined as: s = [(1/(N-2))*SUM (from 1 to N-1)[ (Xi - &lt;bold&gt;X&lt;/ </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1589 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * bold&gt;)^2]]^(1/2))</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1590 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list The list of numbers.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1591 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param average Arithmetic mean of the values in list.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1592 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The standard deviation.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1593 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1594 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> standardDeviation(float list[], float average) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1595 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1596 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N = list.length;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1597 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1598 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">double</font>'''</span> sum = 0.0;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1599 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1600 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 1; i &lt; N; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1601 sum = (list[i] - average)*(list[i] - average);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1602 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1603 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> ((<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>) Math.sqrt(sum/(N-2))); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sqrt((1/(N-2)) * sum)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1604 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1605 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1606 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1607 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1608 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Creates the standard progressBar. Stores in the class-global, progressBar.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1609 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1610 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> buildProgressBar(){<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1611 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1612 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (pBarVisible == <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1613 progressBar = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new</font>'''</span> ViewJProgressBar(srcImage.getImageName(), "Filtering <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1614 image ...",<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1615 0, 100, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">this</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">this</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1616 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> xScreen = Toolkit.getDefaultToolkit().getScreenSize().width;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1617 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> yScreen = Toolkit.getDefaultToolkit().getScreenSize().height;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1618 progressBar.setLocation(xScreen/2, yScreen/2);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1619 progressBar.setVisible(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1620 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1621 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1622 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (Preferences.isDebug()) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1623 Preferences.debug("AlgrithmMedian: NullPointerException found while building <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1624 progress bar.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1625 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1626 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1627 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1628 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1629 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1630 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * If the progress bar is visible, sets the text to: &lt;br&gt;&lt;tt&gt;Copying all &lt;i&gt;color&lt;/i&gt; values</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1631 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * ... &lt;/tt&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1632 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param colorText The color to use. E.g., "red" or "blue".</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1633 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1634 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> setCopyColorText(String colorText)<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1635 {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1636 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1637 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (pBarVisible == true) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1638 progressBar.setMessage("Copying all " colorText " values ... ");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1639 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1640 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1641 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (Preferences.isDebug()) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1642 Preferences.debug("AlgrithmMedian: NullPointerException found while setting<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1643 progress bar text.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1644 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1645 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1646 }<br /></font></div> |} <br /></font>'''</div>
+
1200 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (!sliceFiltering)<br /><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1201 kernel = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new byte</font>'''</span>[kernelSize*kernelSize*kernelSize];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1202 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1203 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (OutOfMemoryError e) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1204 displayError("Algorithm Median reports: not enough memory to form a kernel mask.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1205 setCompleted(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">false</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1206 setThreadStopped(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1207 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return;</font>'''</span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1208 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1209 setKernel();<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1210 makeKernelMask();<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1211 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1212 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1213 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> /**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1214 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Fill in the mask for which pixels are used in filtering.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1215 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1216 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1217 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> setKernel() {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1218 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1219 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> halfK = kernelSize/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1220 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1221 // square/box<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1222 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ( (kernelShape == SQUARE_KERNEL) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1223 (kernelShape == CUBE_KERNEL)) { <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1224 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i=0; i &lt; kernel.length; i )<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1225 kernel[i] = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1226 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1227 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end square/cube kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1228 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1229 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// cross/axial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1230 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ((kernelShape == CROSS_KERNEL) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1231 (kernelShape == AXIAL_KERNEL)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1232 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1233 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1234 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1235 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1236 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1237 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1238 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1239 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1240 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;} <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// should be for a cross -&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1241 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // else if</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1242 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">(row == halfK) {kernel[i] = 1;}</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1243 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1244 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1245 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1246 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1247 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1248 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1249 slice = i/(kernelSize*kernelSize);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1250 row = (i%(kernelSize*kernelSize))/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1251 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1252 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1253 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (slice == halfK) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1254 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1255 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1256 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1257 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1258 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ((row == halfK) &amp;&amp; (col == halfK)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1259 kernel[i] = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1260 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1261 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1262 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1263 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1264 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end cross/axial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1265 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ( kernelShape == VERT_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1266 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1267 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1268 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1269 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1270 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1271 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1272 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1273 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1274 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1275 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1276 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1277 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1278 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1279 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1280 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end vert</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1281 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1282 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> ( kernelShape == HORZ_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1283 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1284 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1285 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1286 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1287 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1288 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1289 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1290 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (col == halfK) {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1291 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == halfK) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1292 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1293 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1294 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1295 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1296 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1297 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end vert</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1298 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1299 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 'x' kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1300 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1301 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current row</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1302 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> col; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// indicates current column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1303 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> revcol; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// runs opposite of the col.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1304 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1305 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1306 row = i/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1307 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1308 revcol = kernelSize - 1 - col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1309 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1310 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (row == col) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1311 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == revcol) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1312 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1313 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1314 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1315 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// volume filtering</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1316 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1317 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 0; i &lt; kernel.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1318 slice = i/(kernelSize*kernelSize);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1319 row = (i%(kernelSize*kernelSize))/kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1320 col = i%kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1321 revcol = kernelSize - 1 - col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1322 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1323 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ((slice == col) ||<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1324 (slice == revcol)) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1325 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (row == col) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1326 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (row == revcol) {kernel[i] = 1;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1327 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1328 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1329 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {kernel[i] = 0;}<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1330 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1331 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1332 } <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// end 'x' kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1333 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1334 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1335 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1336 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1337 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1338 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"><nowiki>* Makes the kernel mask.</nowiki></font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1339 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The kernel mask is the list of values pulled from the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1340 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * image which will be used to find the median of the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1341 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * central pixel. Its length is</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1342 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;i&gt;(number of pixels to be used to determine median) 1&lt;/i&gt;.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1343 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;p&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1344 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Thus the kernel center (decided here), has the value of</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1345 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the location of the central pixel shown in the window.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1346 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The value of the kernel center is the number of pixels picked</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1347 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * up to median sort.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1348 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1349 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Since the kernel mask is &lt;i&gt;number of pixels 1&lt;/i&gt;,</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1350 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the maskCenter must be</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1351 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1352 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> makeKernelMask() {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1353 halfK = kernelSize/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1354 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// figure how many kernel elements are actually in the kernel-mask</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1355 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> count = 1;<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // start counting from one, since sort starts with element</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">1 </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1356 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // (even empty mask must have 1 element!)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1357 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> m = 0; m &lt; kernel.length; m ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1358 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[m] != 0) <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// if this element is marked 'on'</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1359 count ;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1360 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1361 kernelMask = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new float</font>'''</span>[count]; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// must have the leading element empty: the sort</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1362 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//</font></span> <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">starts with element 1</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1363 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (sliceFiltering) {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 2D</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1364 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1365 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernelShape == SQUARE_KERNEL){<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1366 kernelCenter = count/2 - 1; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole square</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1367 maskCenter = halfK*(kernelSize 1) 1; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// count/2 : I feel dumb</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1368 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1369 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == CROSS_KERNEL || kernelShape == VERT_KERNEL || kernelShape == <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1370 HORZ_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1371 kernelCenter = halfK*(kernelSize 1);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1372 maskCenter = kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1373 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1374 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sizeof kernel is same as CROSS_KERNEL</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1375 kernelCenter = halfK*(kernelSize 1); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole square -- (count/2-1)??</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1376 maskCenter = kernelSize;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1377 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1378 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1379 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">//3D</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1380 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if </font>'''</span>(kernelShape == CUBE_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1381 kernelCenter = count/2 - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1382 maskCenter = halfK*(kernelSize*kernelSize kernelSize 1) 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1383 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1384 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == AXIAL_KERNEL) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1385 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole cube</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1386 maskCenter = count/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// i feel dumb...</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1387 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1388 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else if</font>'''</span> (kernelShape == X_KERNEL) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sizeof kernel is same as AXIAL_KERNEL</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1389 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// whole cube</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1390 maskCenter = count/2; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// i feel dumb...</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1391 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1392 }<br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1393 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// not entirely dumb. mc = count/2 because of the symmetry of the mask. Custom masks</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1394 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// may be diff. &amp; i'd like to include custom masks someday....</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1395 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1396 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1397 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1398 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Compiles a list of the values neighboring the desired pixel, that are defined</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1399 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * in the kernel. Be careful because although the kernel starts its index at 0,</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1400 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * the list that is returned starts indexing at 1.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1401 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * &lt;p&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1402 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Color images are processed differently from the monochrome images because</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1403 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * although color images use the same size kernel as mono images, it fills the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1404 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * kernel with brightness levels that are spread out in the data set. The</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1405 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Neighbor list still reports the monochromatic brightness values. That is, for</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1406 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * a color image: the neighbors of the central pixel with the same color are</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1407 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * returned in the neighbor list's kernel.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1408 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param i The central pixel to find neighbors for.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1409 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param data Image data</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1410 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param is2D True indicates that the neighbors are found along a</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1411 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * 2D slice (or 2D image) instead of neighbors in a 3D volume.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1412 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The neighboring pixel list, where the list starts at 1 (leaving the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1413 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> initial</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1414 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * element 0), and corresponds to the kernel chosen.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1415 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1416 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span>[] getNeighborList(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>[] data, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">boolean</font>'''</span> is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1417 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> row, col;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1418 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> kCenter = kernelCenter; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// index to the central element of the kernel</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1419 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// (this is the mask for which elements in data are</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1420 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // used.)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1421 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> width = 0; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// width of slice in number of pixels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1422 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> height = 0; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// height of slice in number of pixels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1423 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1424 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1425 width = srcImage.getExtents()[0];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1426 height = srcImage.getExtents()[1];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1427 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1428 Preferences.debug("AlgorithmMedian: null pointer while making neighbor list.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1429 setThreadStopped(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1430 setCompleted(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">false</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1431 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1432 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> sliceWidth = width * valuesPerPixel; <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// width of slice in number of</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1433 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // elements</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1434 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1435 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// place all the masked 'on' elements into the data-list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1436 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> count = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1437 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// color images are different from the mono images in that though color images</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1438 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // use the same size kernel as mono images, but fill it with brightness levels</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1439 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // that are spread out in the data set.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1440 <br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1441 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> kcol;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1442 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> leftBound = -halfK * 4;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1443 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> rightBound = halfK * 4;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1444 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1445 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all rows</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1446 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = leftBound, kcol = -halfK; col &lt;= rightBound; col = 4, kcol ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1447 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through every 4th column</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1448 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter kcol row*kernelSize] != 0) {<span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// but don't bother</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1449 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // copying into the list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1450 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // if we don't want that</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1451 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // that element (the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1452 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // kernel's pixl is zero)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1453 kernelMask[count ] = data[i col row*sliceWidth];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1454 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1455 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1456 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1457 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1458 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// find neighbors in a volume</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1459 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1460 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// halfK-number of kernelSize slices (to get to the center slice)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1461 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (slice = -halfK; slice &lt;= halfK; slice ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1462 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1463 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = leftBound, kcol = -halfK; col &lt;= rightBound; col = 4, kcol ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1464 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter kcol row*kernelSize slice*kernelSize*kernelSize]<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1465 != 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1466 kernelMask[count ] = <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1467 data[i col row*sliceWidth slice*sliceWidth*height];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1468 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1469 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1470 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1471 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1472 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1473 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1474 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// a mono image</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1475 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (is2D) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1476 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all rows</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1477 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = -halfK; col &lt;= halfK; col ) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// go through all columns</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1478 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter col row*kernelSize] != 0) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// but don't bother</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1479 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // copying into the list </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1480 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// if we don't want </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1481 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// that element (the </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1482 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // kernel's pixl is zero)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1483 kernelMask[count ] = data[i col row*width];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1484 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1485 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1486 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1487 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1488 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (isColorImage) { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// 2D filtering of color images is a little different</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1489 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // than of mono images</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1490 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> { <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// find neighbors in a volume</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1491 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> slice;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1492 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// halfK-number of kernelSize slices (to get to the center slice)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1493 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (slice = -halfK; slice &lt;= halfK; slice ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1494 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (row = -halfK; row &lt;= halfK; row ) {<br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1495 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (col = -halfK; col &lt;= halfK; col ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1496 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (kernel[kCenter col row*kernelSize slice*kernelSize*kernelSize] !=<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1497 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1498 kernelMask[count ] = data[i col row*width slice*width*height];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1499 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1500 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1501 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1502 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1503 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1504 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1505 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (kernelMask);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1506 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1507 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1508 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1509 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Sorts a list of values. Taken from Numerical Recipes in C, 2nd ed. William H.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1510 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Press, et al, page 332. Chose shell sort over a quicksort because both shell</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1511 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * and quick are about the same speed for the middle range of sizes of the list. </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1512 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * The list is more likely during a slice-filter operation to be smaller than the</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1513 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * maximum 121 length. The list could be as much as 1331 elements, but according</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1514 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * to Numerical Recipes, it still runs fast enough at only N**1.25 an average for</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1515 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * N &lt; 60000). My guess is that sliceFilter is more useful than a volumeFilter</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1516 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * and will be plenty fast enough to not necessitate a quicksort for a</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1517 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * debatable speed-increase.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1518 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> *</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1519 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param float a[] The list to sort.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1520 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1521 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final void</font>'''</span> shellSort(float a[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1522 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N = a.length - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1523 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i, j;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1524 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> inc = 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1525 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> val;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1526 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1527 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">do</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1528 inc *=3;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1529 inc ;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1530 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (inc &lt;= N);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1531 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">do</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1532 inc /=3;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1533 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = inc 1; i &lt;= N; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1534 val = a[i];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1535 j = i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1536 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (a[j - inc] &gt; val) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1537 a[j] = a[j - inc];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1538 j -= inc;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1539 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (j &lt;= inc) <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">break</font>'''</span><nowiki>;</nowiki><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1540 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1541 a[j] = val;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1542 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1543 }<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">while</font>'''</span> (inc &gt; 1);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1544 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1545 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1546 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the median value of the list. Median assumes the list of values starts</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1547 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * at index 1, not an index of 0. (i.e., 1st element is not included.)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1548 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list List of numbers</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1549 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The median.</font></span><br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1550 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @author parsonsd</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1551 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1552 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> median(float list[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1553 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1554 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> med;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1555 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1556 N = list.length - 1;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1557 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1558 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> ((N%2) != 0) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1559 med = list[N/2];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1560 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1561 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">else</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1562 med = (list[N/2] list[N/2 1])/2;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1563 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1564 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (med);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1565 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1566 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1567 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1568 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the mean value (average) in the list. Mean assumes the list of </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1569 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * values starts at index 1, not an index of 0. (i.e., 1st element is not</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1570 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * included.) </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1571 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list List of numbers</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1572 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return float The mean.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1573 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @author parsonsd</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1574 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1575 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> mean(float list[]) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1576 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1577 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span> sum = 0;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1578 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1579 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 1; i &lt; list.length; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1580 sum = list[i];<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1581 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1582 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> (<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>)(sum/(list.length - 1)); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// length-1 because list goes from </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1583 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> // [1 ... N]</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1584 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1585 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1586 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1587 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Finds the standard deviation of the values in the input list</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1588 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * (defined as: s = [(1/(N-2))*SUM (from 1 to N-1)[ (Xi - &lt;bold&gt;X&lt;/ </font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1589 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * bold&gt;)^2]]^(1/2))</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1590 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param list The list of numbers.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1591 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param average Arithmetic mean of the values in list.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1592 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @return The standard deviation.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1593 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div> |- | <div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1594 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private final float</font>'''</span> standardDeviation(float list[], float average) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1595 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> i;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1596 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> N = list.length;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1597 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1598 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">double</font>'''</span> sum = 0.0;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1599 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1600 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">for</font>'''</span> (i = 1; i &lt; N; i ) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1601 sum = (list[i] - average)*(list[i] - average);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1602 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1603 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">return</font>'''</span> ((<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">float</font>'''</span>) Math.sqrt(sum/(N-2))); <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">// sqrt((1/(N-2)) * sum)</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1604 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1605 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1606 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1607 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1608 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * Creates the standard progressBar. Stores in the class-global, progressBar.</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1609 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1610 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> buildProgressBar(){<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1611 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1612 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (pBarVisible == <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1613 progressBar = <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">new</font>'''</span> ViewJProgressBar(srcImage.getImageName(), "Filtering <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1614 image ...",<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1615 0, 100, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">this</font>'''</span>, <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">this</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1616 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> xScreen = Toolkit.getDefaultToolkit().getScreenSize().width;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1617 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">int</font>'''</span> yScreen = Toolkit.getDefaultToolkit().getScreenSize().height;<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1618 progressBar.setLocation(xScreen/2, yScreen/2);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1619 progressBar.setVisible(<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">true</font>'''</span>);<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1620 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1621 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1622 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (Preferences.isDebug()) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1623 Preferences.debug("AlgrithmMedian: NullPointerException found while building <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1624 progress bar.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1625 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1626 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1627 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1628 <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1629 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07">/**</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1630 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * If the progress bar is visible, sets the text to: &lt;br&gt;&lt;tt&gt;Copying all &lt;i&gt;color&lt;/i&gt; values</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1631 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * ... &lt;/tt&gt;</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1632 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> * @param colorText The color to use. E.g., "red" or "blue".</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#00ef07"> 1633 <span style="font-style: normal; font-weight: normal; text-decoration: none; text-transform: none; vertical-align: baseline"><font color="#00ef07"> */</font></span><br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1634 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">private void</font>'''</span> setCopyColorText(String colorText)<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1635 {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1636 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">try</font>'''</span> {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1637 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (pBarVisible == true) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1638 progressBar.setMessage("Copying all " colorText " values ... ");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1639 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1640 } <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">catch</font>'''</span> (NullPointerException npe) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1641 <span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">if</font>'''</span> (Preferences.isDebug()) {<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1642 Preferences.debug("AlgrithmMedian: NullPointerException found while setting<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1643 progress bar text.");<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1644 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1645 }<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 30pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -30pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 1646 }<br /></font></div> |} <br />
  
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br />
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 24pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br />

Latest revision as of 14:56, 16 February 2012

1200 else if (!sliceFiltering)
1201 kernel = new byte[kernelSize*kernelSize*kernelSize];
1202 }
1203 catch (OutOfMemoryError e) {
1204 displayError("Algorithm Median reports: not enough memory to form a kernel mask.");
1205 setCompleted(false);
1206 setThreadStopped(true);
1207 return;
1208 }
1209 setKernel();
1210 makeKernelMask();
1211 }
1212
1213 /**
1214 * Fill in the mask for which pixels are used in filtering.
1215 *
1216 */
1217 private void setKernel() {
1218 int i;
1219 int halfK = kernelSize/2;
1220
1221 // square/box
1222 if ( (kernelShape == SQUARE_KERNEL) ||
1223 (kernelShape == CUBE_KERNEL)) {
|- |
1224 for (i=0; i < kernel.length; i )
1225 kernel[i] = 1;
1226
1227 } // end square/cube kernel
1228
1229 // cross/axial
1230 else if ((kernelShape == CROSS_KERNEL) ||
1231 (kernelShape == AXIAL_KERNEL)) {
1232 int row; // indicates current row
1233 int col; // indicates current column
1234 if (sliceFiltering) {
1235 for (i = 0; i < kernel.length; i ) {
1236 row = i/kernelSize;
1237 col = i%kernelSize;
1238
1239 if (col == halfK) {kernel[i] = 1;}
1240 else if (row == halfK) {kernel[i] = 1;} // should be for a cross ->
1241 // else if
1242 // (row == halfK) {kernel[i] = 1;}
1243 else {kernel[i] = 0;}
1244 }
1245 }
1246 else { // volume filtering
1247 int slice;
1248 for (i = 0; i < kernel.length; i ) {
1249 slice = i/(kernelSize*kernelSize);
1250 row = (i%(kernelSize*kernelSize))/kernelSize;
1251 col = i%kernelSize;
1252
1253 if (slice == halfK) {
1254 if (col == halfK) {kernel[i] = 1;}
1255 else if (row == halfK) {kernel[i] = 1;}
1256 else {kernel[i] = 0;}
1257 }
1258 else if ((row == halfK) && (col == halfK)) {
1259 kernel[i] = 1;
1260 }
1261 else {kernel[i] = 0;}
1262 }
1263 }
1264 } // end cross/axial
1265 else if ( kernelShape == VERT_KERNEL) {
1266 int row; // indicates current row
1267 int col; // indicates current column
1268 if (sliceFiltering) {
1269 for (i = 0; i < kernel.length; i ) {
1270 row = i/kernelSize;
1271 col = i%kernelSize;
1272
1273 if (col == halfK) {kernel[i] = 1;}
1274 else if (row == halfK) {kernel[i] = 0;}
1275 else {kernel[i] = 0;}
1276 }
1277 }
1278 else { // volume filtering
1279 }
1280 } // end vert
1281
|- |
1282 else if ( kernelShape == HORZ_KERNEL) {
1283 int row; // indicates current row
1284 int col; // indicates current column
1285 if (sliceFiltering) {
1286 for (i = 0; i < kernel.length; i ) {
1287 row = i/kernelSize;
1288 col = i%kernelSize;
1289
1290 if (col == halfK) {kernel[i] = 0;}
1291 else if (row == halfK) {kernel[i] = 1;}
1292 else {kernel[i] = 0;}
1293 }
1294 }
1295 else { // volume filtering
1296 }
1297 } // end vert
1298
1299 // 'x' kernel
1300 else if (kernelShape == X_KERNEL) {
1301 int row; // indicates current row
1302 int col; // indicates current column
1303 int revcol; // runs opposite of the col.
1304 if (sliceFiltering) {
1305 for (i = 0; i < kernel.length; i ) {
1306 row = i/kernelSize;
1307 col = i%kernelSize;
1308 revcol = kernelSize - 1 - col;
1309
1310 if (row == col) {kernel[i] = 1;}
1311 else if (row == revcol) {kernel[i] = 1;}
1312 else {kernel[i] = 0;}
1313 }
1314 }
1315 else { // volume filtering
1316 int slice;
1317 for (i = 0; i < kernel.length; i ) {
1318 slice = i/(kernelSize*kernelSize);
1319 row = (i%(kernelSize*kernelSize))/kernelSize;
1320 col = i%kernelSize;
1321 revcol = kernelSize - 1 - col;
1322
1323 if ((slice == col) ||
1324 (slice == revcol)) {
1325 if (row == col) {kernel[i] = 1;}
1326 else if (row == revcol) {kernel[i] = 1;}
1327 else {kernel[i] = 0;}
1328 }
1329 else {kernel[i] = 0;}
1330 }
1331 }
1332 } // end 'x' kernel
1333
1334 }
1335
1336 /**
1337
|- |
1338 * Makes the kernel mask.
1339 * The kernel mask is the list of values pulled from the
1340 * image which will be used to find the median of the
1341 * central pixel. Its length is
1342 * <i>(number of pixels to be used to determine median) 1</i>.
1343 * <p>
1344 * Thus the kernel center (decided here), has the value of
1345 * the location of the central pixel shown in the window.
1346 * The value of the kernel center is the number of pixels picked
1347 * up to median sort.
1348 *
1349 * Since the kernel mask is <i>number of pixels 1</i>,
1350 * the maskCenter must be
1351 */
1352 private void makeKernelMask() {
1353 halfK = kernelSize/2;
1354 // figure how many kernel elements are actually in the kernel-mask
1355 int count = 1; // start counting from one, since sort starts with element 1
1356 // (even empty mask must have 1 element!)
1357 for (int m = 0; m < kernel.length; m ) {
1358 if (kernel[m] != 0) // if this element is marked 'on'
1359 count ;
1360 }
1361 kernelMask = new float[count]; // must have the leading element empty: the sort
1362 // starts with element 1
1363 if (sliceFiltering) {// 2D
1364
1365 if (kernelShape == SQUARE_KERNEL){
1366 kernelCenter = count/2 - 1; // whole square
1367 maskCenter = halfK*(kernelSize 1) 1; // count/2 : I feel dumb
1368 }
1369 else if (kernelShape == CROSS_KERNEL || kernelShape == VERT_KERNEL || kernelShape ==
1370 HORZ_KERNEL) {
1371 kernelCenter = halfK*(kernelSize 1);
1372 maskCenter = kernelSize;
1373 }
1374 else if (kernelShape == X_KERNEL) { // sizeof kernel is same as CROSS_KERNEL
1375 kernelCenter = halfK*(kernelSize 1); // whole square -- (count/2-1)??
1376 maskCenter = kernelSize;
1377 }
1378 }
1379 else {//3D
1380 if (kernelShape == CUBE_KERNEL) {
1381 kernelCenter = count/2 - 1;
1382 maskCenter = halfK*(kernelSize*kernelSize kernelSize 1) 1;
1383 }
1384 else if (kernelShape == AXIAL_KERNEL) {
1385 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; // whole cube
1386 maskCenter = count/2; // i feel dumb...
1387 }
1388 else if (kernelShape == X_KERNEL) { // sizeof kernel is same as AXIAL_KERNEL
1389 kernelCenter = (kernelSize*kernelSize*kernelSize)/2; // whole cube
1390 maskCenter = count/2; // i feel dumb...
1391 }
1392 }
|- |
1393 // not entirely dumb. mc = count/2 because of the symmetry of the mask. Custom masks
1394 // may be diff. & i'd like to include custom masks someday....
1395 }
1396
1397 /**
1398 * Compiles a list of the values neighboring the desired pixel, that are defined
1399 * in the kernel. Be careful because although the kernel starts its index at 0,
1400 * the list that is returned starts indexing at 1.
1401 * <p>
1402 * Color images are processed differently from the monochrome images because
1403 * although color images use the same size kernel as mono images, it fills the
1404 * kernel with brightness levels that are spread out in the data set. The
1405 * Neighbor list still reports the monochromatic brightness values. That is, for
1406 * a color image: the neighbors of the central pixel with the same color are
1407 * returned in the neighbor list's kernel.
1408 * @param i The central pixel to find neighbors for.
1409 * @param data Image data
1410 * @param is2D True indicates that the neighbors are found along a
1411 * 2D slice (or 2D image) instead of neighbors in a 3D volume.
1412 * @return The neighboring pixel list, where the list starts at 1 (leaving the
1413 initial
1414 * element 0), and corresponds to the kernel chosen.
1415 */
1416 private final float[] getNeighborList(int i, float[] data, boolean is2D) {
1417 int row, col;
1418 int kCenter = kernelCenter; // index to the central element of the kernel
1419 // (this is the mask for which elements in data are
1420 // used.)
1421 int width = 0; // width of slice in number of pixels
1422 int height = 0; // height of slice in number of pixels
1423
1424 try {
1425 width = srcImage.getExtents()[0];
1426 height = srcImage.getExtents()[1];
1427 } catch (NullPointerException npe) {
1428 Preferences.debug("AlgorithmMedian: null pointer while making neighbor list.");
1429 setThreadStopped(true);
1430 setCompleted(false);
1431 }
1432 int sliceWidth = width * valuesPerPixel; // width of slice in number of
1433 // elements
1434
1435 // place all the masked 'on' elements into the data-list
1436 int count = 1;
1437 // color images are different from the mono images in that though color images
1438 // use the same size kernel as mono images, but fill it with brightness levels
1439 // that are spread out in the data set.
1440
|- |
1441 int kcol;
1442 int leftBound = -halfK * 4;
1443 int rightBound = halfK * 4;
1444 if (is2D) {
1445 for (row = -halfK; row <= halfK; row ) { // go through all rows
1446 for (col = leftBound, kcol = -halfK; col <= rightBound; col = 4, kcol ) {
1447 // go through every 4th column
1448 if (kernel[kCenter kcol row*kernelSize] != 0) {// but don't bother
1449 // copying into the list
1450 // if we don't want that
1451 // that element (the
1452 // kernel's pixl is zero)
1453 kernelMask[count ] = data[i col row*sliceWidth];
1454 }
1455 }
1456 }
1457 }
1458 else { // find neighbors in a volume
1459 int slice;
1460 // halfK-number of kernelSize slices (to get to the center slice)
1461 for (slice = -halfK; slice <= halfK; slice ) {
1462 for (row = -halfK; row <= halfK; row ) {
1463 for (col = leftBound, kcol = -halfK; col <= rightBound; col = 4, kcol ) {
1464 if (kernel[kCenter kcol row*kernelSize slice*kernelSize*kernelSize]
1465 != 0) {
1466 kernelMask[count ] =
1467 data[i col row*sliceWidth slice*sliceWidth*height];
1468 }
1469 }
1470 }
1471 }
1472 }
1473 }
1474 else { // a mono image
1475 if (is2D) {
1476 for (row = -halfK; row <= halfK; row ) { // go through all rows
1477 for (col = -halfK; col <= halfK; col ) { // go through all columns
1478 if (kernel[kCenter col row*kernelSize] != 0) { // but don't bother
1479 // copying into the list
1480 // if we don't want
1481 // that element (the
1482 // kernel's pixl is zero)
1483 kernelMask[count ] = data[i col row*width];
1484 }
1485 }
1486 }
1487 }
1488 if (isColorImage) { // 2D filtering of color images is a little different
1489 // than of mono images
1490 else { // find neighbors in a volume
1491 int slice;
1492 // halfK-number of kernelSize slices (to get to the center slice)
1493 for (slice = -halfK; slice <= halfK; slice ) {
1494 for (row = -halfK; row <= halfK; row ) {
|- |
1495 for (col = -halfK; col <= halfK; col ) {
1496 if (kernel[kCenter col row*kernelSize slice*kernelSize*kernelSize] !=
1497 0) {
1498 kernelMask[count ] = data[i col row*width slice*width*height];
1499 }
1500 }
1501 }
1502 }
1503 }
1504 }
1505 return (kernelMask);
1506 }
1507
1508 /**
1509 * Sorts a list of values. Taken from Numerical Recipes in C, 2nd ed. William H.
1510 * Press, et al, page 332. Chose shell sort over a quicksort because both shell
1511 * and quick are about the same speed for the middle range of sizes of the list.
1512 * The list is more likely during a slice-filter operation to be smaller than the
1513 * maximum 121 length. The list could be as much as 1331 elements, but according
1514 * to Numerical Recipes, it still runs fast enough at only N**1.25 an average for
1515 * N < 60000). My guess is that sliceFilter is more useful than a volumeFilter
1516 * and will be plenty fast enough to not necessitate a quicksort for a
1517 * debatable speed-increase.
1518 *
1519 * @param float a[] The list to sort.
1520 */
1521 private final void shellSort(float a[]) {
1522 int N = a.length - 1;
1523 int i, j;
1524 int inc = 1;
1525 float val;
1526
1527 do {
1528 inc *=3;
1529 inc ;
1530 } while (inc <= N);
1531 do {
1532 inc /=3;
1533 for (i = inc 1; i <= N; i ) {
1534 val = a[i];
1535 j = i;
1536 while (a[j - inc] > val) {
1537 a[j] = a[j - inc];
1538 j -= inc;
1539 if (j <= inc) break;
1540 }
1541 a[j] = val;
1542 }
1543 }while (inc > 1);
1544 }
1545 /**
1546 * Finds the median value of the list. Median assumes the list of values starts
1547 * at index 1, not an index of 0. (i.e., 1st element is not included.)
1548 * @param list List of numbers
1549 * @return The median.
|- |
1550 * @author parsonsd
1551 */
1552 private final float median(float list[]) {
1553 int N;
1554 float med;
1555
1556 N = list.length - 1;
1557
1558 if ((N%2) != 0) {
1559 med = list[N/2];
1560 }
1561 else {
1562 med = (list[N/2] list[N/2 1])/2;
1563 }
1564 return (med);
1565 }
1566
1567 /**
1568 * Finds the mean value (average) in the list. Mean assumes the list of
1569 * values starts at index 1, not an index of 0. (i.e., 1st element is not
1570 * included.)
1571 * @param list List of numbers
1572 * @return float The mean.
1573 * @author parsonsd
1574 */
1575 private final float mean(float list[]) {
1576 int i;
1577 float sum = 0;
1578
1579 for (i = 1; i < list.length; i ) {
1580 sum = list[i];
1581 }
1582 return (float)(sum/(list.length - 1)); // length-1 because list goes from
1583 // [1 ... N]
1584 }
1585
1586 /**
1587 * Finds the standard deviation of the values in the input list
1588 * (defined as: s = [(1/(N-2))*SUM (from 1 to N-1)[ (Xi - <bold>X</
1589 * bold>)^2]]^(1/2))
1590 * @param list The list of numbers.
1591 * @param average Arithmetic mean of the values in list.
1592 * @return The standard deviation.
1593 */
|- |
1594 private final float standardDeviation(float list[], float average) {
1595 int i;
1596 int N = list.length;
1597
1598 double sum = 0.0;
1599
1600 for (i = 1; i < N; i ) {
1601 sum = (list[i] - average)*(list[i] - average);
1602 }
1603 return ((float) Math.sqrt(sum/(N-2))); // sqrt((1/(N-2)) * sum)
1604 }
1605
1606
1607 /**
1608 * Creates the standard progressBar. Stores in the class-global, progressBar.
1609 */
1610 private void buildProgressBar(){
1611 try {
1612 if (pBarVisible == true) {
1613 progressBar = new ViewJProgressBar(srcImage.getImageName(), "Filtering
1614 image ...",
1615 0, 100, true, this, this);
1616 int xScreen = Toolkit.getDefaultToolkit().getScreenSize().width;
1617 int yScreen = Toolkit.getDefaultToolkit().getScreenSize().height;
1618 progressBar.setLocation(xScreen/2, yScreen/2);
1619 progressBar.setVisible(true);
1620 }
1621 } catch (NullPointerException npe) {
1622 if (Preferences.isDebug()) {
1623 Preferences.debug("AlgrithmMedian: NullPointerException found while building
1624 progress bar.");
1625 }
1626 }
1627 }
1628
1629 /**
1630 * If the progress bar is visible, sets the text to: <br><tt>Copying all <i>color</i> values
1631 * ... </tt>
1632 * @param colorText The color to use. E.g., "red" or "blue".
1633 */
1634 private void setCopyColorText(String colorText)
1635 {
1636 try {
1637 if (pBarVisible == true) {
1638 progressBar.setMessage("Copying all " colorText " values ... ");
1639 }
1640 } catch (NullPointerException npe) {
1641 if (Preferences.isDebug()) {
1642 Preferences.debug("AlgrithmMedian: NullPointerException found while setting
1643 progress bar text.");
1644 }
1645 }
1646 }
|}