def __init__(self, pos=[20, 20], size=[20, 20], grid=[4, 5],
shape='Rect', gap=[0, 0], subgrid=([], []),
subgrid_width=0.05, pen='w', **kwargs):
'''
shape = ['Rect', 'Square', 'Circular', 'Pseudosquare']
'''
self.opts = {'shape': shape,
'grid': np.asarray(grid),
'gap': np.asfarray(gap),
'subgrid': subgrid,
'subgrid_width': subgrid_width
}
# TODO: limit max cell size while rescale
self.maxCellSize = size / self.opts['grid']
self.cells = []
self._createCells()
self._createSubgrid()
# cannot set brush at the moment, so:
if 'brush' in kwargs:
kwargs.pop('brush')
pg.ROI.__init__(self, pos, size, pen=pen, **kwargs)
self.translatable = False
self.mouseHovering = False
self._setCellSize(self.state['size'])
self._setCellPos(pos)
self.layout_rescaling = False
self.addScaleHandle([1, 1], [0, 0])
self.addScaleHandle([0, 0], [1, 1])
self.addScaleHandle([1, 0], [0, 1])
self.addScaleHandle([0, 1], [1, 0])
self.addRotateHandle([0.5, 1], [0.5, 0.5])
评论列表
文章目录