#!/usr/bin/env python

#redundant code?

        #self.planeWidgetS.On()
        #self.planeWidgetS2.On()
        #make zero level of stat volume invisible
        #self.planeWidgetS.GetColorMap().GetLookupTable().SetTableValue(0, (0.0,0.0,0.0,0.0))
        #self.planeWidgetS.GetColorMap().SetOutputFormatToRGBA()
        #self.planeWidgetS2.GetColorMap().GetLookupTable().SetTableValue(0, (0.0,0.0,0.0,0.0))
        #self.planeWidgetS2.GetColorMap().SetOutputFormatToRGBA()
        
        



       # # STat
       # self.planeWidgetS = planewidget()
       # self.planeWidgetS.DisplayTextOn()
       # self.planeWidgetS.SetInteractor(self.widget)
       # self.planeWidgetS.SetInput(self.stat_vol.GetOutput())
       # self.planeWidgetS.SetPlaneOrientationToZAxes()
       # self.planeWidgetS.SetSliceIndex(self.x_slice_pos)
       # self.planeWidgetS.SetPicker(self.picker)
       # self.planeWidgetS.SetHandleSize(500)
       # #planeWidgetZ.AddObserver("KeyPressEvent", myMouse_tracker)
       # prop1 = self.planeWidgetS.GetPlaneProperty()
       # prop1.SetColor(1, 1, 1)
       # #if we use the same lookuptable, x, y and z all update together
       # #self.planeWidgetZ.SetLookupTable(self.planeWidgetX.GetLookupTable())
       # self.planeWidgetS.SetKeyPressActivation(0)
       #
       #
       ## Stat
       # self.planeWidgetS2 = planewidget()
       # self.planeWidgetS2.DisplayTextOn()
       # self.planeWidgetS2.SetInteractor(self.widget)
       # self.planeWidgetS2.SetInput(self.stat_vol.GetOutput())
       # self.planeWidgetS2.SetPlaneOrientationToYAxes()
       # self.planeWidgetS2.SetSliceIndex(self.y_slice_pos)
       # self.planeWidgetS2.SetPicker(self.picker)
       # self.planeWidgetS2.SetHandleSize(500)
       # #planeWidgetZ.AddObserver("KeyPressEvent", myMouse_tracker)
       # prop1 = self.planeWidgetS2.GetPlaneProperty()
       # prop1.SetColor(1, 1, 1)
       # #if we use the same lookuptable, x, y and z all update together
       # #self.planeWidgetZ.SetLookupTable(self.planeWidgetX.GetLookupTable())
       # self.planeWidgetS2.SetKeyPressActivation(0)
       
       
       
       
       
       
            self.stat_vol, self.stat_data_max, self.stat_data_min,           \
                      self.stat_data_bounds, self.stat_x_slice_pos,          \
                      self.stat_y_slice_pos, self.stat_z_slice_pos,          \
                      self.stat_s_row_x, self.stat_s_row_y,                  \
                      self.stat_s_row_z, self.stat_spacing                   \
                       = nifti2vtkImageData(stat_file_to_load)
            self.stat_data = self.stat_vol.GetOutput()
        