Index: src/sas/perspectives/calculator/image_viewer.py
===================================================================
--- src/sas/perspectives/calculator/image_viewer.py	(revision d90f91bd16ef019bd8af5b7140db6f2cb7587f1d)
+++ src/sas/perspectives/calculator/image_viewer.py	(revision 49ab5d718dd7743a6a296e666dfb643183bc969d)
@@ -36,5 +36,5 @@
         """
         self.parent = parent
-        
+
     def load(self):
         """
@@ -66,7 +66,7 @@
                 ax.subplot.set_xlabel('x [pixel]')
                 ax.subplot.set_ylabel('y [pixel]')
-                ax.figure.subplots_adjust(left=0.15, bottom=0.1, 
+                ax.figure.subplots_adjust(left=0.15, bottom=0.1,
                                           right=0.95, top=0.95)
-                plot_frame.SetTitle('Picture -- %s --'% basename)
+                plot_frame.SetTitle('Picture -- %s --' % basename)
                 plot_frame.Show(True)
                 if parent != None:
@@ -74,5 +74,5 @@
             except:
                 print "parent", parent
-                err_msg += "Failed to load '%s'.\n"% basename
+                err_msg += "Failed to load '%s'.\n" % basename
         if err_msg:
             if parent is not None:
@@ -80,5 +80,5 @@
             else:
                 print err_msg
-        
+
     def choose_data_file(self, location=None):
         """
@@ -88,6 +88,6 @@
         if location == None:
             location = os.getcwd()
-        dlg = wx.FileDialog(self.parent, "Image Viewer: Choose a image file", 
-                            location, "", "", style=wx.FD_OPEN|wx.FD_MULTIPLE)
+        dlg = wx.FileDialog(self.parent, "Image Viewer: Choose a image file",
+                            location, "", "", style=wx.FD_OPEN | wx.FD_MULTIPLE)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPaths()
@@ -101,6 +101,6 @@
     Frame for simple plot
     """
-    def __init__(self, parent, id, title, image=None, scale='log_{10}', 
-                 size=wx.Size(550, 470)): 
+    def __init__(self, parent, id, title, image=None, scale='log_{10}',
+                 size=wx.Size(550, 470)):
         """
         comment
@@ -111,7 +111,7 @@
         PlotFrame.__init__(self, parent, id, title, scale, size)
         self.parent = parent
-        self.data = image 
+        self.data = image
         self.file_name = title
-                   
+
         menu = wx.Menu()
         id = wx.NewId()
@@ -127,8 +127,8 @@
         wx.EVT_MENU(self, id, self.on_help)
         self.menu_bar.Append(menu_help, "&Help")
-        
+
         self.SetMenuBar(self.menu_bar)
         self.im_show(image)
-    
+
     def on_set_data(self, event):
         """
@@ -139,24 +139,24 @@
         self.panel.ShowModal()
 
-    def on_help(self, event):    
-        """       
-        Bring up Image Viewer Documentation from the image viewer window 
-        whenever the help menu item "how to" is clicked. Calls 
+    def on_help(self, event):
+        """
+        Bring up Image Viewer Documentation from the image viewer window
+        whenever the help menu item "how to" is clicked. Calls
         DocumentationWindow with the path of the location within the
-        documentation tree (after /doc/ ....".  
-        
+        documentation tree (after /doc/ ....".
+
         :param evt: Triggers on clicking "how to" in help menu
         """
-                
+
         _TreeLocation = "user/perspectives/calculator/image_viewer_help.html"
         _doc_viewer = DocumentationWindow(self, -1, \
-             _TreeLocation,"Image Viewer Help")
-        
-            
+             _TreeLocation, "Image Viewer Help")
+
+
 class SetDialog(wx.Dialog):
     """
     Dialog for Data Set
     """
-    def __init__(self, parent, id=-1, title="Convert to Data", image=None, 
+    def __init__(self, parent, id= -1, title="Convert to Data", image=None,
                  size=(_DIALOG_WIDTH, 270)):
         wx.Dialog.__init__(self, parent, id, title, size)
@@ -170,8 +170,8 @@
         self.is_png = self._get_is_png()
         self._build_layout()
-        my_title = "Convert Image to Data - %s -"% self.title
+        my_title = "Convert Image to Data - %s -" % self.title
         self.SetTitle(my_title)
         self.SetSize(size)
-    
+
     def _get_is_png(self):
         """
@@ -180,5 +180,5 @@
         _, extension = os.path.splitext(self.title)
         return extension.lower() == '.png'
-            
+
     def _build_layout(self):
         """
@@ -190,5 +190,5 @@
         ybox = wx.BoxSizer(wx.HORIZONTAL)
         btnbox = wx.BoxSizer(wx.VERTICAL)
-        
+
         sb_title = wx.StaticBox(self, -1, 'Transform Axes')
         boxsizer = wx.StaticBoxSizer(sb_title, wx.VERTICAL)
@@ -203,5 +203,5 @@
         z_ctl = InputTextCtrl(self, -1, size=(_BOX_WIDTH , 20),
                                 style=wx.TE_PROCESS_ENTER)
-        
+
         xmin_ctl = InputTextCtrl(self, -1, size=(_BOX_WIDTH, 20),
                                 style=wx.TE_PROCESS_ENTER)
@@ -222,18 +222,18 @@
         ymin_ctl.Bind(wx.EVT_TEXT, self._onparam)
         ymax_ctl.Bind(wx.EVT_TEXT, self._onparam)
-        xbox.AddMany([(x_title , 0, wx.LEFT, 0), 
-                      (xmin_title , 0, wx.LEFT, 10), 
-                      (xmin_ctl , 0, wx.LEFT, 10), 
-                      (xmax_title , 0, wx.LEFT, 10), 
+        xbox.AddMany([(x_title , 0, wx.LEFT, 0),
+                      (xmin_title , 0, wx.LEFT, 10),
+                      (xmin_ctl , 0, wx.LEFT, 10),
+                      (xmax_title , 0, wx.LEFT, 10),
                       (xmax_ctl , 0, wx.LEFT, 10)])
-        ybox.AddMany([(y_title , 0, wx.LEFT, 0), 
-                      (ymin_title , 0, wx.LEFT, 10), 
-                      (ymin_ctl , 0, wx.LEFT, 10), 
-                      (ymax_title , 0, wx.LEFT, 10), 
-                      (ymax_ctl , 0, wx.LEFT, 10)])     
-        zbox.AddMany([(z_title , 0, wx.LEFT, 0), 
+        ybox.AddMany([(y_title , 0, wx.LEFT, 0),
+                      (ymin_title , 0, wx.LEFT, 10),
+                      (ymin_ctl , 0, wx.LEFT, 10),
+                      (ymax_title , 0, wx.LEFT, 10),
+                      (ymax_ctl , 0, wx.LEFT, 10)])
+        zbox.AddMany([(z_title , 0, wx.LEFT, 0),
                       (ztime_title, 0, wx.LEFT, 10),
-                      (z_ctl , 0, wx.LEFT, 7), 
-                      ])   
+                      (z_ctl , 0, wx.LEFT, 7),
+                      ])
         msg = "The data rescaled will show up in the Data Explorer. \n"
         msg += "*Note: Recommend to use an image with 8 bit Grey \n"
@@ -269,6 +269,6 @@
         By pass original txtcrl binding
         """
-        pass    
-        
+        pass
+
     def _onparam(self, event=None):
         """
@@ -284,5 +284,5 @@
         item.SetBackgroundColour("white")
         try:
-            val = float(item.GetValue())  
+            val = float(item.GetValue())
             if val < -10.0 or val > 10.0:
                 item.SetBackgroundColour("pink")
@@ -297,5 +297,5 @@
             err_msg += "between -10 and 10."
             if self.base is not None:
-                wx.PostEvent(self.base, StatusEvent(status=err_msg, 
+                wx.PostEvent(self.base, StatusEvent(status=err_msg,
                                                     info="error"))
             else:
@@ -303,5 +303,5 @@
         return flag
 
-    def _on_z_enter(self, event= None): 
+    def _on_z_enter(self, event=None):
         """
         On z factor enter
@@ -309,5 +309,5 @@
         item = event.GetEventObject()
         self._check_z_ctrl(item)
-        
+
     def _check_z_ctrl(self, item, is_button=False):
         """
@@ -316,5 +316,5 @@
         item.SetBackgroundColour("white")
         try:
-            val = float(item.GetValue())  
+            val = float(item.GetValue())
             if val <= 0:
                 item.SetBackgroundColour("pink")
@@ -323,18 +323,18 @@
         except:
             item.SetBackgroundColour("pink")
-            item.Refresh() 
+            item.Refresh()
             flag = False
         if not flag and is_button:
             err_msg = "The z scale value should be larger than 0."
             if self.base is not None:
-                wx.PostEvent(self.base, StatusEvent(status=err_msg, 
+                wx.PostEvent(self.base, StatusEvent(status=err_msg,
                                                     info="error"))
             else:
                 print err_msg
-        return flag 
-    
+        return flag
+
     def on_set(self, event):
         """
-        Set image as data   
+        Set image as data
         """
         event.Skip()
@@ -357,11 +357,11 @@
             err_msg = "Error occurred while converting Image to Data."
             if self.base is not None:
-                wx.PostEvent(self.base, StatusEvent(status=err_msg, 
+                wx.PostEvent(self.base, StatusEvent(status=err_msg,
                                                     info="error"))
             else:
                 print err_msg
-            
+
         self.OnClose(event)
-    
+
     def convert_image(self, rgb, xmin, xmax, ymin, ymax, zscale):
         """
@@ -405,5 +405,5 @@
             data = self.base.create_gui_data(output, self.title)
             self.base.add_data({data.id:data})
-            
+
     def rgb2gray(self, rgb):
         """
@@ -415,13 +415,13 @@
             rgb = rgb[::-1]
         if rgb.ndim == 2:
-            grey = np.rollaxis(rgb, axis = 0)
+            grey = np.rollaxis(rgb, axis=0)
         else:
-            red, green, blue = np.rollaxis(rgb[...,:3], axis = -1)
+            red, green, blue = np.rollaxis(rgb[..., :3], axis= -1)
             grey = 0.299 * red + 0.587 * green + 0.114 * blue
         max_i = rgb.max()
         factor = 255.0 / max_i
-        grey *= factor 
+        grey *= factor
         return np.array(grey)
-                      
+
     def OnClose(self, event):
         """
@@ -431,9 +431,8 @@
         event.Skip()
         self.Destroy()
-                       
+
 if __name__ == "__main__":
-    app  = wx.App()
+    app = wx.App()
     ImageView(None).load()
-    app.MainLoop()   
-    
- 
+    app.MainLoop()
+
