neulab/docprompting-conala huggingface dataset:
__init__(manager, overlay_shape, radius=5, alpha=0.3, on_move=None, on_release=None, on_enter=None, rect_props=None) [source]
 
Initialize self. See help(type(self)) for accurate signature.
__init__(manager, on_move=None, on_release=None, on_enter=None, maxdist=10, rect_props=None) [source]
 
 Parameters 
 
axAxes 

The parent axes for the widget.  
onselectfunction 

A callback function that is called after a selection is completed. It must have the signature: def onselect(eclick: MouseEvent, erelease: MouseEvent)
 where eclick and erelease are the mouse click and release MouseEvents that start and complete the selection.  
drawtype{“box”, “line”, “none”}, default: “box” 

Whether to draw the full rectangle box, the diagonal line of the rectangle, or nothing at all.  
minspanxfloat, default: 0 

Selections with an x-span less than minspanx are ignored.  
minspanyfloat, default: 0 

Selections with an y-span less than minspany are ignored.  
useblitbool, default: False 

Whether to use blitting for faster drawing (if supported by the backend).  
linepropsdict, optional 

Properties with which the line is drawn, if drawtype == "line". Default: dict(color="black", linestyle="-", linewidth=2, alpha=0.5)
  
rectpropsdict, optional 

Properties with which the rectangle is drawn, if drawtype ==
"box". Default: dict(facecolor="red", edgecolor="black", alpha=0.2, fill=True)
  
spancoords{“data”, “pixels”}, default: “data” 

Whether to interpret minspanx and minspany in data or in pixel coordinates.  
buttonMouseButton, list of MouseButton, default: all buttons 

Button(s) that trigger rectangle selection.  
maxdistfloat, default: 10 

Distance in pixels within which the interactive tool handles can be activated.  
marker_propsdict 

Properties with which the interactive handles are drawn. Currently not implemented and ignored.  
interactivebool, default: False 

Whether to draw a set of handles that allow interaction with the widget after it is drawn.  
state_modifier_keysdict, optional 

Keyboard modifiers which affect the widget’s behavior. Values amend the defaults.  “move”: Move the existing shape, default: no modifier. “clear”: Clear the current shape, default: “escape”. “square”: Makes the shape square, default: “shift”. “center”: Make the initial point the center of the shape, default: “ctrl”.  “square” and “center” can be combined.
class skimage.viewer.canvastools.ThickLineTool(manager, on_move=None, on_enter=None, on_release=None, on_change=None, maxdist=10, line_props=None, handle_props=None) [source]
 
Bases: skimage.viewer.canvastools.linetool.LineTool Widget for line selection in a plot. The thickness of the line can be varied using the mouse scroll wheel, or with the ‘+’ and ‘-‘ keys.  Parameters 
 
managerViewer or PlotPlugin. 

Skimage viewer or plot plugin object.  
on_movefunction 

Function called whenever a control handle is moved. This function must accept the end points of line as the only argument.  
on_releasefunction 

Function called whenever the control handle is released.  
on_enterfunction 

Function called whenever the “enter” key is pressed.  
on_changefunction 

Function called whenever the line thickness is changed.  
maxdistfloat 

Maximum pixel distance allowed when selecting control handle.  
line_propsdict 

Properties for matplotlib.lines.Line2D.  
handle_propsdict 

Marker properties for the handles (also see matplotlib.lines.Line2D).    Attributes 
 
end_points2D array 

End points of line ((x1, y1), (x2, y2)).      
__init__(manager, on_move=None, on_enter=None, on_release=None, on_change=None, maxdist=10, line_props=None, handle_props=None) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
on_key_press(event) [source]

  
on_scroll(event) [source]
__init__(manager, on_move=None, on_enter=None, on_release=None, on_change=None, maxdist=10, line_props=None, handle_props=None) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.CollectionViewer(image_collection, update_on='move', **kwargs) [source]
 
Bases: skimage.viewer.viewers.core.ImageViewer Viewer for displaying image collections. Select the displayed frame of the image collection using the slider or with the following keyboard shortcuts:  left/right arrows

Previous/next image in collection.  number keys, 0–9

0% to 90% of collection. For example, “5” goes to the image in the middle (i.e. 50%) of the collection.  home/end keys

First/last image in collection.    Parameters 
 
image_collectionlist of images 

List of images to be displayed.  
update_on{‘move’ | ‘release’} 

Control whether image is updated on slide or release of the image slider. Using ‘on_release’ will give smoother behavior when displaying large images or when writing a plugin/subclass that requires heavy computation.      
__init__(image_collection, update_on='move', **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
keyPressEvent(event) [source]

  
update_index(name, index) [source]
 
Select image on display using index into image collection.
update_index(name, index) [source]
 
Select image on display using index into image collection.
__init__(image_collection, update_on='move', **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.ImageViewer(image, useblit=True) [source]
 
Bases: object Viewer for displaying images. This viewer is a simple container object that holds a Matplotlib axes for showing images. ImageViewer doesn’t subclass the Matplotlib axes (or figure) because of the high probability of name collisions. Subclasses and plugins will likely extend the update_image method to add custom overlays or filter the displayed image.  Parameters 
 
imagearray 

Image being viewed.     Examples >>> from skimage import data
>>> image = data.coins()
>>> viewer = ImageViewer(image) 
>>> viewer.show()               
  Attributes 
 
canvas, fig, axMatplotlib canvas, figure, and axes 

Matplotlib canvas, figure, and axes used to display image.  
imagearray 

Image being viewed. Setting this value will update the displayed frame.  
original_imagearray 

Plugins typically operate on (but don’t change) the original image.  
pluginslist 

List of attached plugins.      
__init__(image, useblit=True) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
add_tool(tool) [source]

  
closeEvent(event) [source]

  
connect_event(event, callback) [source]
 
Connect callback function to matplotlib event and return id. 
  
disconnect_event(callback_id) [source]
 
Disconnect callback by its id (returned by connect_event). 
  
dock_areas = {'bottom': None, 'left': None, 'right': None, 'top': None} 
  
property image 
  
open_file(filename=None) [source]
 
Open image file and display in viewer. 
  
original_image_changed = None 
  
redraw() [source]

  
remove_tool(tool) [source]

  
reset_image() [source]

  
save_to_file(filename=None) [source]
 
Save current image to file. The current behavior is not ideal: It saves the image displayed on screen, so all images will be converted to RGB, and the image size is not preserved (resizing the viewer window will alter the size of the saved image). 
  
show(main_window=True) [source]
 
Show ImageViewer and attached plugins. This behaves much like matplotlib.pyplot.show and QWidget.show. 
  
update_image(image) [source]
 
Update displayed image. This method can be overridden or extended in subclasses and plugins to react to image changes.
connect_event(event, callback) [source]
 
Connect callback function to matplotlib event and return id.
disconnect_event(callback_id) [source]
 
Disconnect callback by its id (returned by connect_event).
dock_areas = {'bottom': None, 'left': None, 'right': None, 'top': None}
open_file(filename=None) [source]
 
Open image file and display in viewer.
save_to_file(filename=None) [source]
 
Save current image to file. The current behavior is not ideal: It saves the image displayed on screen, so all images will be converted to RGB, and the image size is not preserved (resizing the viewer window will alter the size of the saved image).
show(main_window=True) [source]
 
Show ImageViewer and attached plugins. This behaves much like matplotlib.pyplot.show and QWidget.show.
update_image(image) [source]
 
Update displayed image. This method can be overridden or extended in subclasses and plugins to react to image changes.
__init__(image, useblit=True) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.CannyPlugin(*args, **kwargs) [source]
 
Bases: skimage.viewer.plugins.overlayplugin.OverlayPlugin Canny filter plugin to show edges of an image.  
__init__(*args, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
name = 'Canny Filter'
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets.
__init__(*args, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.ColorHistogram(max_pct=0.99, **kwargs) [source]
 
Bases: skimage.viewer.plugins.plotplugin.PlotPlugin  
__init__(max_pct=0.99, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
ab_selected(extents) [source]

  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
help() [source]

  
name = 'Color Histogram' 
  
output() [source]
 
Return the image mask and the histogram data.  Returns 
 
maskarray of bool, same shape as image 

The selected pixels.  
datadict 

The data describing the histogram and the selected region. The dictionary contains:  ‘bins’ : array of float The bin boundaries for both a and b channels. ‘hist’ : 2D array of float The normalized histogram. ‘edges’ : tuple of array of float The bin edges along each dimension ‘extents’ : tuple of float The left and right and top and bottom of the selected region.
output() [source]
 
Return the image mask and the histogram data.  Returns 
 
maskarray of bool, same shape as image 

The selected pixels.  
datadict 

The data describing the histogram and the selected region. The dictionary contains:  ‘bins’ : array of float The bin boundaries for both a and b channels. ‘hist’ : 2D array of float The normalized histogram. ‘edges’ : tuple of array of float The bin edges along each dimension ‘extents’ : tuple of float The left and right and top and bottom of the selected region.
__init__(max_pct=0.99, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.Crop(maxdist=10, **kwargs) [source]
 
Bases: skimage.viewer.plugins.base.Plugin  
__init__(maxdist=10, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
crop(extents) [source]

  
help() [source]

  
name = 'Crop' 
  
reset() [source]
__init__(maxdist=10, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.LabelPainter(max_radius=20, **kwargs) [source]
 
Bases: skimage.viewer.plugins.base.Plugin  
__init__(max_radius=20, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
help() [source]

  
property label 
  
name = 'LabelPainter' 
  
on_enter(overlay) [source]

  
property radius
__init__(max_radius=20, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.LineProfile(maxdist=10, epsilon='deprecated', limits='image', **kwargs) [source]
 
Bases: skimage.viewer.plugins.plotplugin.PlotPlugin Plugin to compute interpolated intensity under a scan line on an image. See PlotPlugin and Plugin classes for additional details.  Parameters 
 
maxdistfloat 

Maximum pixel distance allowed when selecting end point of scan line.  
limitstuple or {None, ‘image’, ‘dtype’} 

(minimum, maximum) intensity limits for plotted profile. The following special values are defined: None : rescale based on min/max intensity along selected scan line. ‘image’ : fixed scale based on min/max intensity in image. ‘dtype’ : fixed scale based on min/max intensity of image dtype.      
__init__(maxdist=10, epsilon='deprecated', limits='image', **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
get_profiles() [source]
 
Return intensity profile of the selected line.  Returns 
 end_points: (2, 2) array

The positions ((x1, y1), (x2, y2)) of the line ends.  profile: list of 1d arrays

Profile of intensity values. Length 1 (grayscale) or 3 (rgb).     
  
help() [source]

  
line_changed(end_points) [source]

  
name = 'Line Profile' 
  
output() [source]
 
Return the drawn line and the resulting scan.  Returns 
 
line_image(M, N) uint8 array, same shape as image 

An array of 0s with the scanned line set to 255. If the linewidth of the line tool is greater than 1, sets the values within the profiled polygon to 128.  
scan(P,) or (P, 3) array of int or float 

The line scan values across the image.     
  
reset_axes(scan_data) [source]
get_profiles() [source]
 
Return intensity profile of the selected line.  Returns 
 end_points: (2, 2) array

The positions ((x1, y1), (x2, y2)) of the line ends.  profile: list of 1d arrays

Profile of intensity values. Length 1 (grayscale) or 3 (rgb).
output() [source]
 
Return the drawn line and the resulting scan.  Returns 
 
line_image(M, N) uint8 array, same shape as image 

An array of 0s with the scanned line set to 255. If the linewidth of the line tool is greater than 1, sets the values within the profiled polygon to 128.  
scan(P,) or (P, 3) array of int or float 

The line scan values across the image.
__init__(maxdist=10, epsilon='deprecated', limits='image', **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.Measure(maxdist=10, **kwargs) [source]
 
Bases: skimage.viewer.plugins.base.Plugin  
__init__(maxdist=10, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
help() [source]

  
line_changed(end_points) [source]

  
name = 'Measure'
class skimage.viewer.plugins.OverlayPlugin(**kwargs) [source]
 
Bases: skimage.viewer.plugins.base.Plugin Plugin for ImageViewer that displays an overlay on top of main image. The base Plugin class displays the filtered image directly on the viewer. OverlayPlugin will instead overlay an image with a transparent colormap. See base Plugin class for additional details.  Attributes 
 
overlayarray 

Overlay displayed on top of image. This overlay defaults to a color map with alpha values varying linearly from 0 to 1.  
colorint 

Color of overlay.      
__init__(**kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
closeEvent(event) [source]
 
On close disconnect all artists and events from ImageViewer. Note that artists must be appended to self.artists. 
  
property color 
  
colors = {'cyan': (0, 1, 1), 'green': (0, 1, 0), 'red': (1, 0, 0), 'yellow': (1, 1, 0)} 
  
display_filtered_image(image) [source]
 
Display filtered image as an overlay on top of image in viewer. 
  
property filtered_image  
Return filtered image. This “filtered image” is used when saving from the plugin. 
  
output() [source]
 
Return the overlaid image.  Returns 
 
overlayarray, same shape as image 

The overlay currently displayed.  
dataNone 
   
  
property overlay
closeEvent(event) [source]
 
On close disconnect all artists and events from ImageViewer. Note that artists must be appended to self.artists.
colors = {'cyan': (0, 1, 1), 'green': (0, 1, 0), 'red': (1, 0, 0), 'yellow': (1, 1, 0)}
display_filtered_image(image) [source]
 
Display filtered image as an overlay on top of image in viewer.
property filtered_image  
Return filtered image. This “filtered image” is used when saving from the plugin.
output() [source]
 
Return the overlaid image.  Returns 
 
overlayarray, same shape as image 

The overlay currently displayed.  
dataNone
__init__(**kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.plugins.PlotPlugin(image_filter=None, height=150, width=400, **kwargs) [source]
 
Bases: skimage.viewer.plugins.base.Plugin Plugin for ImageViewer that contains a plot canvas. Base class for plugins that contain a Matplotlib plot canvas, which can, for example, display an image histogram. See base Plugin class for additional details.  
__init__(image_filter=None, height=150, width=400, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature. 
  
add_plot() [source]

  
add_tool(tool) [source]

  
attach(image_viewer) [source]
 
Attach the plugin to an ImageViewer. Note that the ImageViewer will automatically call this method when the plugin is added to the ImageViewer. For example: viewer += Plugin(...)
 Also note that attach automatically calls the filter function so that the image matches the filtered value specified by attached widgets. 
  
redraw() [source]
 
Redraw plot. 
  
remove_tool(tool) [source]
__init__(image_filter=None, height=150, width=400, **kwargs) [source]
 
Initialize self. See help(type(self)) for accurate signature.
add_widget(widget) [source]
 
Add widget to plugin. Alternatively, Plugin’s __add__ method is overloaded to add widgets: plugin += Widget(...)
 Widgets can adjust required or optional arguments of filter function or parameters for the plugin. This is specified by the Widget’s ptype.
display_filtered_image(image) [source]
 
Display the filtered image on image viewer. If you don’t want to simply replace the displayed image with the filtered image (e.g., you want to display a transparent overlay), you can override this method.
filter_image(*widget_arg) [source]
 
Call image_filter with widget args and kwargs Note: display_filtered_image is automatically called.
output() [source]
 
Return the plugin’s representation and data.  Returns 
 
imagearray, same shape as self.image_viewer.image, or None 

The filtered image.  
dataNone 

Any data associated with the plugin.     Notes Derived classes should override this method to return a tuple containing an overlay of the same shape of the image, and a data object. Either of these is optional: return None if you don’t want to return a value.
remove_image_artists() [source]
 
Remove artists that are connected to the image viewer.
update_plugin(name, value) [source]
 
Update keyword parameters of the plugin itself. These parameters will typically be implemented as class properties so that they update the image or some other component.
__init__(image_filter=None, height=0, width=400, useblit=True, dock='bottom') [source]
 
Initialize self. See help(type(self)) for accurate signature.
class skimage.viewer.utils.ClearColormap(rgb, max_alpha=1, name='clear_color') [source]
 
Bases: skimage.viewer.utils.core.LinearColormap Color map that varies linearly from alpha = 0 to 1  
__init__(rgb, max_alpha=1, name='clear_color') [source]
 
Create color map from linear mapping segments segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of x, y0, y1 tuples, forming rows in a table. Entries for alpha are optional. Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: cdict = {'red':   [(0.0,  0.0, 0.0),
                   (0.5,  1.0, 1.0),
                   (1.0,  1.0, 1.0)],

         'green': [(0.0,  0.0, 0.0),
                   (0.25, 0.0, 0.0),
                   (0.75, 1.0, 1.0),
                   (1.0,  1.0, 1.0)],

         'blue':  [(0.0,  0.0, 0.0),
                   (0.5,  0.0, 0.0),
                   (1.0,  1.0, 1.0)]}
 Each row in the table for a given color is a sequence of x, y0, y1 tuples. In each sequence, x must increase monotonically from 0 to 1. For any input value z falling between x[i] and x[i+1], the output value of a given color will be linearly interpolated between y1[i] and y0[i+1]: row i:   x  y0  y1
               /
              /
row i+1: x  y0  y1
 Hence y0 in the first row and y1 in the last row are never used.  See also  
LinearSegmentedColormap.from_list 

Static method; factory function for generating a smoothly-varying LinearSegmentedColormap.  
makeMappingArray 

For information about making a mapping array.