Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
4 changes: 2 additions & 2 deletions fixationgui/LightCrafter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions fixationgui/ViewPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,20 +465,20 @@ 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):
if colNum == 5 or colNum == 10 or colNum == 20 or colNum == 25:
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)
Expand Down
12 changes: 6 additions & 6 deletions fixationgui/wxFixGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"