Index: /trunk/psModules/src/pmObjects.c
===================================================================
--- /trunk/psModules/src/pmObjects.c	(revision 3087)
+++ /trunk/psModules/src/pmObjects.c	(revision 3088)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-25 01:22:12 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-25 02:42:27 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,19 +104,13 @@
     psU32 col = 0;
     psU32 row = 0;
-    psVector *rowX = NULL;
-
-    tmpRow = p_psGetRowVectorFromImage((psImage *) image, 0);
+
+    row = 0;
+    tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
     psVector *row1 = pmFindVectorPeeks(tmpRow, threshold);
-    tmpRow = p_psGetRowVectorFromImage((psImage *) image, 1);
-    psVector *row2 = pmFindVectorPeeks(tmpRow, threshold);
-    tmpRow = p_psGetRowVectorFromImage((psImage *) image, 2);
-    psVector *row3 = pmFindVectorPeeks(tmpRow, threshold);
-
-    row = 0;
     for (psU32 i = 0 ; i < row1->n ; i++ ) {
         col = row1->data.U32[i];
         if (col == 0) {
-            if ( (image->data.F32[row][col] > image->data.F32[row][col+1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row+1][col]) &&
+            if ( (image->data.F32[row][col] >  image->data.F32[row][col+1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row+1][col]) &&
                     (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
                 // Add peak at location (row, col)
@@ -124,8 +118,8 @@
         } else if (col < (image->numCols - 1)) {
             if ( (image->data.F32[row][col] >= image->data.F32[row][col-1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row][col+1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row][col+1]) &&
                     (image->data.F32[row][col] >= image->data.F32[row+1][col-1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row+1][col]) &&
-                    (image->data.F32[row][col] >= image->data.F32[row+1][col+2])) {
+                    (image->data.F32[row][col] >  image->data.F32[row+1][col]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
                 // Add peak at location (row, col)
             }
@@ -143,35 +137,55 @@
     }
 
+    for (row = 1 ; row < (image->numRows - 1) ; row++) {
+        tmpRow = p_psGetRowVectorFromImage((psImage *) image, 0);
+        row1 = pmFindVectorPeeks(tmpRow, threshold);
+
+        // Step through all local peask in this row.
+        for (psU32 i = 0 ; i < row1->n ; i++ ) {
+            col = row1->data.U32[i];
+
+            if ((image->data.F32[row][col] >= image->data.F32[row-1][col-1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row-1][col]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) &&
+                    (image->data.F32[row][col] > image->data.F32[row][col-1]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row][col+1]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row+1][col-1]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row+1][col]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
+                // Add peak at location (row, col)
+            }
+        }
+    }
+
     row = image->numRows - 1;
+    tmpRow = p_psGetRowVectorFromImage((psImage *) image, row);
+    row1 = pmFindVectorPeeks(tmpRow, threshold);
     for (psU32 i = 0 ; i < row1->n ; i++ ) {
         col = row1->data.U32[i];
         if (col == 0) {
-            if ( (image->data.F32[row][col] > image->data.F32[row][col+1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row+1][col]) &&
-                    (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) {
+            if ( (image->data.F32[row][col] >  image->data.F32[row-1][col]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row][col+1])) {
                 // Add peak at location (row, col)
             }
         } else if (col < (image->numCols - 1)) {
-            if ( (image->data.F32[row][col] >= image->data.F32[row][col-1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row][col+1]) &&
-                    (image->data.F32[row][col] >= image->data.F32[row+1][col-1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row+1][col]) &&
-                    (image->data.F32[row][col] >= image->data.F32[row+1][col+2])) {
+            if ( (image->data.F32[row][col] >= image->data.F32[row-1][col-1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row-1][col]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row-1][col+1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row][col-1]) &&
+                    (image->data.F32[row][col] >= image->data.F32[row][col+1])) {
                 // Add peak at location (row, col)
             }
 
         } else if (col == (image->numCols - 1)) {
-            if ( (image->data.F32[row][col] >= image->data.F32[row][col-1]) &&
-                    (image->data.F32[row][col] > image->data.F32[row+1][col]) &&
-                    (image->data.F32[row][col] >= image->data.F32[row+1][col-1])) {
-                // Add peak at location (row, col)
-            }
-
+            if ( (image->data.F32[row][col] >= image->data.F32[row-1][col-1]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row-1][col]) &&
+                    (image->data.F32[row][col] >  image->data.F32[row][col-1])) {
+                // Add peak at location (row, col)
+            }
         } else {
             printf("XXX: ERROR!\n");
         }
     }
-
-
 
     return(NULL);
