mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Also add handle style to ThickLineTool
This commit is contained in:
@@ -151,6 +151,9 @@ class ThickLineTool(LineTool):
|
||||
Maximum pixel distance allowed when selecting control handle.
|
||||
line_props : dict
|
||||
Properties for :class:`matplotlib.lines.Line2D`.
|
||||
handle_props : dict
|
||||
Marker properties for the handles (also see
|
||||
:class:`matplotlib.lines.Line2D`).
|
||||
|
||||
Attributes
|
||||
----------
|
||||
@@ -159,13 +162,14 @@ class ThickLineTool(LineTool):
|
||||
"""
|
||||
|
||||
def __init__(self, viewer, on_move=None, on_enter=None, on_release=None,
|
||||
on_change=None, maxdist=10, line_props=None):
|
||||
on_change=None, maxdist=10, line_props=None, handle_props=None):
|
||||
super(ThickLineTool, self).__init__(viewer,
|
||||
on_move=on_move,
|
||||
on_enter=on_enter,
|
||||
on_release=on_release,
|
||||
maxdist=maxdist,
|
||||
line_props=line_props)
|
||||
line_props=line_props,
|
||||
handle_props=handle_props)
|
||||
|
||||
if on_change is None:
|
||||
def on_change(*args):
|
||||
|
||||
@@ -104,7 +104,8 @@ def test_thick_line_tool():
|
||||
img = data.camera()
|
||||
viewer = ImageViewer(img)
|
||||
|
||||
tool = ThickLineTool(viewer, maxdist=10)
|
||||
tool = ThickLineTool(viewer, maxdist=10, line_props=dict(color='red'),
|
||||
handle_props=dict(markersize=5))
|
||||
tool.end_points = get_end_points(img)
|
||||
|
||||
do_event(viewer, 'scroll', button='up')
|
||||
|
||||
Reference in New Issue
Block a user