Skip to content

Commit

Permalink
Black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilim committed Jan 10, 2020
1 parent eeb1080 commit f4e059f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.8.27
## Fixes
- Tile range calculation fix
- The calibrator now shows axis directions and proper positioning of the zebrafish
- Fixes for closed loop stimulus logging
- Windmill drawing moved to the new background framework

# 0.8.26
## Fixes
- Background stimuli reworked: tiling of stimulus works in all cases regardless of transform
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="stytra",
version="0.8.26",
version="0.8.27",
author="Vilim Stih, Luigi Petrucco @portugueslab",
author_email="[email protected]",
license="GPLv3+",
Expand Down
22 changes: 18 additions & 4 deletions stytra/calibration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import cv2
import numpy as np
from PyQt5.QtCore import QRect, QPoint
from PyQt5.QtGui import QPainter, QPen, QColor, QBrush
from PyQt5.QtGui import QPainter, QPen, QColor, QBrush, QPolygon

from lightparam.param_qt import ParametrizedQt, Param

Expand Down Expand Up @@ -129,9 +129,23 @@ def paint_calibration_pattern(self, p, h, w):
p.setBrush(QBrush(QColor(0, 0, 0, 255)))
p.drawRect(QRect(1, 1, w - 2, h - 2))
l2 = self.length_px / 2
p.drawLine(w // 2 - l2, h // 2, w // 2 + l2, h // 2)
p.drawLine(w // 2, h // 2 + l2, w // 2, h // 2 - l2)
p.drawLine(w // 2, h // 2 + l2, w // 2 + l2, h // 2 + l2)
cw = w // 2
ch = h // 2

# draw the cross and the axis labels
p.drawLine(cw - l2, ch, cw + l2, h // 2)
p.drawText(w * 3 // 4, ch - 5, "x")
p.drawLine(cw, h // 2 + l2, cw, ch - l2)
p.drawText(cw + 5, h * 3 // 4, "y")

# draw the "fish outline"
p.drawEllipse(cw - 5, ch - 8, 3, 5)
p.drawEllipse(cw + 2, ch - 8, 3, 5)
p.drawPolygon(
QPolygon(
[QPoint(cw - 3, ch + 2), QPoint(cw + 3, ch + 2), QPoint(cw, ch + 20)]
)
)

def set_pixel_scale(self, w, h):
""""Set pixel size, need to be called by the projector widget on resizes"""
Expand Down

0 comments on commit f4e059f

Please sign in to comment.