Index: guiframe/local_perspectives/plotting/masking.py
===================================================================
--- guiframe/local_perspectives/plotting/masking.py	(revision b40439d9cca3d58281efbaf6646d9c3cbfe1d90d)
+++ guiframe/local_perspectives/plotting/masking.py	(revision a5ca7ef12eebd33f75e4d308aa5ec32d11f5cb7a)
@@ -12,4 +12,5 @@
 copyright 2008, University of Tennessee
 """
+##Todo: cleaning up, improving the maskplotpanel initialization, and testing.
 import wx
 import sys
@@ -17,4 +18,5 @@
 import copy,numpy
 from danse.common.plottools.PlotPanel import PlotPanel
+from danse.common.plottools.plottables import Graph
 from binder import BindArtist
 from sans.guiframe.dataFitting import Data2D
@@ -79,5 +81,5 @@
 
             # Panel for 2D plot
-            self.plotpanel    = SANSplotpanel(self, -1, style=wx.TRANSPARENT_WINDOW)
+            self.plotpanel    = Maskplotpanel(self, -1, style=wx.TRANSPARENT_WINDOW)
             self.cmap = DEFAULT_CMAP
             ## Create Artist and bind it
@@ -208,6 +210,4 @@
         self.update()
         self.slicer_mask = self.slicer.update()
-
-        #wx.PostEvent(self, InternalEvent(slicer= BoxMask))
         
     
@@ -228,5 +228,4 @@
         self.update()
         self.slicer_mask = self.slicer.update()
-        #wx.PostEvent(self, InternalEvent(slicer= BoxMask))
 
         
@@ -245,8 +244,7 @@
         self.subplot.set_xlim(self.data.xmin, self.data.xmax)   
 
-        #mask = self.slicer.update()   
         self.update()
         self.slicer_mask = self.slicer.update() 
-        #wx.PostEvent(self, InternalEvent(slicer= SectorMask))
+
         
     def onOuterSectorMask(self,event=None):
@@ -266,5 +264,5 @@
         self.update()     
         self.slicer_mask = self.slicer.update()   
-        #wx.PostEvent(self, InternalEvent(slicer= SectorMask))
+
         
     def onInnerRingMask(self, event=None):
@@ -281,9 +279,8 @@
         self.subplot.set_ylim(self.data.ymin, self.data.ymax)
         self.subplot.set_xlim(self.data.xmin, self.data.xmax)   
-        #mask = self.slicer.update()   
+
         self.update()
         self.slicer_mask = self.slicer.update() 
- 
-        #wx.PostEvent(self, InternalEvent(slicer= AnnulusInteractor))
+
         
     def onOuterRingMask(self, event=None):
@@ -314,7 +311,4 @@
 
             self._check_display_mask(data.mask, event)
-            # Post slicer None event
-            #event = self._getEmptySlicerEvent()
-            #wx.PostEvent(self, event)
             
     def _check_display_mask(self, mask, event):
@@ -335,6 +329,4 @@
             mask[self.slicer_mask==False] = True
 
-            #event = self._getEmptySlicerEvent()
-            #wx.PostEvent(self, event)
             self._check_display_mask(mask, event)
             
@@ -352,7 +344,4 @@
         self.data.mask = mask
 
-        # Post slicer None event
-        #event = self._getEmptySlicerEvent()
-        #wx.PostEvent(self, event)
         # update mask plot
         self._check_display_mask(mask, event)
@@ -370,8 +359,5 @@
         mask = numpy.ones(len(self.data.mask), dtype=bool)
         self.data.mask = mask
-        
-        # Post slicer None event
-        #event = self._getEmptySlicerEvent()
-        #wx.PostEvent(self, event)
+
         # update mask plot
         self._check_display_mask(mask, event)
@@ -385,8 +371,4 @@
             self.subplot.figure.canvas.draw()
             self.slicer = None
-        
-            # Post slicer None event
-            #event = self._getEmptySlicerEvent()
-            #wx.PostEvent(self, event)
 
             
@@ -464,5 +446,9 @@
         
         #replot
-        
+        ##This method not alway updating the plot(?): use manual plot 
+        #self.newplot=Data2D(image=temp_data.data)
+        #self.newplot.setValues(temp_data)
+        #self.plotpanel.add_image(self.newplot)
+        #use this method
         plot = self.plotpanel.image(data= temp_mask,
                        qx_data=self.data.qx_data,
@@ -515,5 +501,5 @@
         pass  
            
-class SANSplotpanel(PlotPanel):
+class Maskplotpanel(PlotPanel):
     
     def __init__(self, parent, id = -1, color = None,\
@@ -527,4 +513,5 @@
         # doesn't have a dictionary of handles for the plottables)
         self.plots = {}
+        self.graph = Graph()
         
     def add_toolbar(self):
@@ -544,11 +531,15 @@
     def add_image(self, plot):
         self.plots[plot.name] = plot
-        
+        #init graph
+        self.gaph = Graph()
+        #add plot
         self.graph.add(plot)
+        #add axes
         self.graph.xaxis('\\rm{Q}_{x} ', 'A^{-1}')
         self.graph.yaxis('\\rm{Q}_{y} ', 'A^{-1}')
+        #draw
         self.graph.render(self)
         self.subplot.figure.canvas.draw_idle()
-        #self.onResetGraph(None)
+        
     def onMouseMotion(self, event):
         """
@@ -576,20 +567,4 @@
 
 
-
-
-from DataLoader.readers.IgorReader import Reader
-        
-class ViewApp(wx.App):
-    def OnInit(self):
-        frame = MaskPanel(None, -1, 'Mask Editor') 
-        data = Data2D()
-        data = Reader().read('/test/MAR07232_rest.ASC')
-        panel = frame(self, data=data)  
-        panel.Show(True)
-        self.SetTopWindow(panel)
-        
-        return True
-        
-
 if __name__ == "__main__": 
     app = ViewApp(0)
