diff --git a/README.md b/README.md index 2415fc4..4f6850a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This software provides an easy-to-use interface to drive secondary-monitor fixat Fixation_GUI uses a socket-based interface to recieve notifications that an image has been acquired, or other aspects of imaging have been changed: e.g. the field of view of the instrument has been adjusted. +![Screenshot](screenshot.png) ## General Usage: __IMPORTANT NOTE: for Savior users, skip to Savior Installation Instructions below__ diff --git a/fixationgui/LightCrafter.py b/fixationgui/LightCrafter.py index 0840706..40f3409 100644 --- a/fixationgui/LightCrafter.py +++ b/fixationgui/LightCrafter.py @@ -154,8 +154,8 @@ def repaint(self, start=0, port=100, wavelength=500, frequency=10, stimulusDurat if self._cursor is 0: self._pen.SetWidth(self._fixsize) dc.SetPen(self._pen) - dc.DrawLine(0, self._location.y, self.thisSize.x, self._location.y) - dc.DrawLine(self._location.x, 0, self._location.x, self.thisSize.y) + dc.DrawLine(0, int(self._location.y), int(self.thisSize.x), int(self._location.y)) + dc.DrawLine(int(self._location.x), 0, int(self._location.x), int(self.thisSize.y)) elif self._cursor is 1: self._pen.SetWidth(self._fixsize/3) dc.SetPen(self._pen) diff --git a/fixationgui/ViewPane.py b/fixationgui/ViewPane.py index 6103289..bed30b0 100644 --- a/fixationgui/ViewPane.py +++ b/fixationgui/ViewPane.py @@ -465,7 +465,7 @@ def Paint(self, dc=None): dc.SetPen(self.THINORANGEPEN) else: dc.SetPen(self.BLKPEN) - dc.DrawLine(0, rowNum * cellHgt, width, rowNum * cellHgt) + dc.DrawLine(int(0), int(rowNum * cellHgt), int(width), int(rowNum * cellHgt)) # Draw Column lines for colNum in range(numCols + 1): @@ -473,12 +473,12 @@ def Paint(self, dc=None): dc.SetPen(self.THINORANGEPEN) else: dc.SetPen(self.BLKPEN) - dc.DrawLine(colNum * cellWid, 0, colNum * cellWid, height) + dc.DrawLine(int(colNum * cellWid), 0, int(colNum * cellWid), height) # Draws Center Lines dc.SetPen(self.MEDORANGEPEN) - dc.DrawLine(0, self._numgridlines / 2 * cellHgt, width, self._numgridlines / 2 * cellHgt) - dc.DrawLine(self._numgridlines / 2 * cellWid, 0, self._numgridlines / 2 * cellWid, height) + dc.DrawLine(0, int(self._numgridlines / 2 * cellHgt), width, int(self._numgridlines / 2 * cellHgt)) + dc.DrawLine(int(self._numgridlines / 2 * cellWid), 0, int(self._numgridlines / 2 * cellWid), height) # Draws Viewable Region Circle - use the graphics context because its actually # Got a bit of AA in it (can do floating point drawing) diff --git a/fixationgui/wxFixGUI.py b/fixationgui/wxFixGUI.py index eda9a1b..b65fab7 100644 --- a/fixationgui/wxFixGUI.py +++ b/fixationgui/wxFixGUI.py @@ -117,7 +117,7 @@ def __init__(self, parent=None, id=wx.ID_ANY): # Spawn the pair of listener threads so we can detect changes in the comm Queues passed by Savior self.fovListener = ConnListener(self) # This will recieve a tuple of sizes self.fovListenerThread = threading.Thread(target=asyncore.loop, kwargs={'timeout': 1}) - self.fovListenerThread.setDaemon(True) + self.fovListenerThread.daemon = True self.fovListenerThread.start() def initViewPane(self, parent): @@ -663,7 +663,7 @@ def on_right_mouse_button(self, event): self.viewpane.SetMouseOffset(None) def on_mouse_wheel(self, event): - if self.viewpane.get_state() is 1 or self.viewpane.get_state() is 2: + if self.viewpane.get_state() == 1 or self.viewpane.get_state() == 2: print('okwheel') # uncomment this if you want the zoom scroll self.viewpane.SetBkgrdScale(math.copysign(1.0, event.GetWheelRotation()) * .01) @@ -967,13 +967,13 @@ def on_keyboard_press(self, event): def call_stimulus(self): import datetime # Heather Stimulus - if self.flicker_stimulus is 1: + if self.flicker_stimulus == 1: print(datetime.datetime.now()) self.LCCanvas.set_fixation_cursor(6, 1, self.com) - if self.stimulus is 1: + if self.stimulus == 1: print(datetime.datetime.now()) self.LCCanvas.set_fixation_cursor(7, 1, self.com, self.wavelength, self.frequency) - if self.animal_stim is 1: + if self.animal_stim == 1: print(datetime.datetime.now()) self.LCCanvas.set_fixation_cursor(8, 1, self.com, 1, 1, self.stimulusDuration) @@ -1149,7 +1149,7 @@ def save_location(self, horzloc, vertloc, vidnum="-1", removemode=0, loadplanmod # saviorfov = self.saviorfov # saviorfovh, saviorfovv = list(map(float, saviorfov)) # Create a file that we will dump all of the relevant information to - if self._locationfname is None or loadplanmode is 1: + if self._locationfname == None or loadplanmode == 1: # If it doesn't exist, then prompt for the location before continuing... self.on_set_save_protocol_location(None, loadplanmode) diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..c910d77 Binary files /dev/null and b/screenshot.png differ diff --git a/setup.bash b/setup.bash index 7fec6c1..cbeb233 100644 --- a/setup.bash +++ b/setup.bash @@ -13,5 +13,5 @@ python3 -m virtualenv "$THISPATH/venv" # Activate our virtualenv, then install wxPython 4 and numpy. source "$THISPATH/venv/bin/activate" -python3 -m pip install wxPython && python3 -m pip install numpy +python3 -m pip install wxPython numpy pdfrw opencv-python serial deactivate diff --git a/setup.bat b/setup.bat index d10d145..4635f57 100644 --- a/setup.bat +++ b/setup.bat @@ -9,4 +9,6 @@ REM Install the virtual environment py -m virtualenv "%thispath%\venv" REM Activate our virtualenv, then install wxPython 4 and numpy. -"%thispath%\venv\Scripts\activate.bat" & py -m pip install wxPython & py -m pip install numpy & "%thispath%\venv\Scripts\deactivate.bat" +"%thispath%\venv\Scripts\activate.bat" +py -m pip install wxPython numpy pdfrw opencv-python serial +"%thispath%\venv\Scripts\deactivate.bat"