Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Labeling mode functionality(left click). Done by Nikhil.
authorlingutln <lingutln@localhost>
Tue, 10 Jan 2012 23:39:29 +0000 (23:39 +0000)
committerlingutln <lingutln@localhost>
Tue, 10 Jan 2012 23:39:29 +0000 (23:39 +0000)
svn path=/; revision=260

Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java
Annotation/src/ie/dcu/apps/ist/widgets/AnnotatedImageControl.java
Annotation/src/ie/dcu/segment/SegmentationContext.java
Annotation/src/ie/dcu/segment/painters/CombinedPainter.java

index 07cb808d7a448caabcaa8a212f0ca257638b5078..40392d5d41cf2d89bea2cc35e099cfade859d90f 100644 (file)
@@ -1067,7 +1067,9 @@ public class SegmentationView extends Composite {
                        }
                        else if(event.button == 1)
                        {
-                               System.out.println("Mouse left click"+event.x + "and" +event.y);
+                               System.out.println("Mask number "+view.getContext().getMasks().size());
+                               //view.highlightClickedSegment(event.x,event.y);
+                               repaint();
                        }
                }
                public void mouseDown(MouseEvent e) 
index 2a8644eae2ade94a8ec20aa92cd55889d58609c5..e366a1121c83c805f935b2631924ba8ad77b5758 100644 (file)
@@ -312,6 +312,14 @@ public class AnnotatedImageControl extends Composite {
                }
        }
        
+       /**
+        * For highlighting the mouse clicked segment in Labelling Mode.
+        * @param Mosue clicked points x,y
+        */
+       public void highlightClickedSegment(int x, int y) {
+               ctx.highlightClickedSegment(x,y);
+       }
+       
        
        /**
         * Re-construct the display image buffer, and dispose the old one if
index 7a0171dd09ad43bef3dbf4e846fcdc9c98b5d590..85e2ed793afca15def82d16e69a13fc2351f2a0e 100644 (file)
@@ -42,6 +42,11 @@ public class SegmentationContext {
         */
        private File file;
        
+       /**
+        * For storing the mouse clicked point in Labelling mode
+        */
+       public static Point mouseClickedPoint;
+       
        /**
         * For storing independent Segmentation objects
         */
@@ -163,6 +168,20 @@ public class SegmentationContext {
                
                return segmentationMaskObjects;
        }
+       /**
+        * For highlighting the clicked segmentObject
+        * @param x, mouse clicked point x
+        * @param y, mouse clicked point y
+        */
+       public void highlightClickedSegment(int x, int y) {
+               mouseClickedPoint.x = x;
+               mouseClickedPoint.y = y;
+       }
+       
+       public Point getMouseClickedPoint()
+       {
+               return mouseClickedPoint;
+       }
        
        /**
         * Returns the current image being segmented. This method returns an an SWT
index 77c519f12dfe3023e1a11e1082c5a8363ca3c458..11c51a6d472f8b7d055d7e1233fc2766ab0fd7cf 100644 (file)
@@ -37,7 +37,9 @@ public class CombinedPainter implements SegmentationPainter {
 
                // Paint image
                gc.drawImage(ctx.getImage(), 0, 0);
-
+               
+               Point mouseClickedPoint = ctx.getMouseClickedPoint();
+               
                // Paint masks
                if(ctx.getMasks().size() > 0)
                {