bebi103.image.record_clicks

bebi103.image.record_clicks(im, notebook_url='localhost:8888', point_size=3, table_height=200, crosshair_alpha=0.5, point_color='white', cmap=None, frame_height=400, frame_width=None, length_units='pixels', interpixel_distance=1.0, x_range=None, y_range=None, colorbar=False, no_ticks=False, x_axis_label=None, y_axis_label=None, title=None, flip=False, saturate_channels=True, min_intensity=None, max_intensity=None)

Display and record mouse clicks on a Bokeh plot of an image.

Parameters
  • im (2D Numpy array) – Image to display while clicking.

  • notebook_url (str, default 'localhost:8888') – URL of notebook for display.

  • point_size (int, default 3) – Size of points to display when clicking.

  • table_height (int, default 200) – Height, in pixels, of table displaying mouse click locations.

  • crosshair_alpha (float, default 0.5) – Opacity value for crosshairs when using the crosshair tool.

  • point_color (str, default 'white') – Color of the points displaying clicks.

  • cmap (str or list of hex colors, default None) – If im is an intensity image, cmap is a mapping of intensity to color. If None, default is 256-level Viridis. If im is a color image, then cmap can either be ‘rgb’ or ‘cmy’ (default), for RGB or CMY merge of channels.

  • frame_height (int) – Height of the plot in pixels. The width is scaled so that the x and y distance between pixels is the same.

  • frame_width (int or None (default)) – If None, the width is scaled so that the x and y distance between pixels is approximately the same. Otherwise, the width of the plot in pixels.

  • length_units (str, default 'pixels') – The units of length in the image.

  • interpixel_distance (float, default 1.0) – Interpixel distance in units of length_units.

  • x_range (bokeh.models.Range1d instance, default None) – Range of x-axis. If None, determined automatically.

  • y_range (bokeh.models.Range1d instance, default None) – Range of y-axis. If None, determined automatically.

  • colorbar (bool, default False) – If True, include a colorbar.

  • no_ticks (bool, default False) – If True, no ticks are displayed. See note below.

  • x_axis_label (str, default None) – Label for the x-axis. If None, labeled with length_units.

  • y_axis_label (str, default None) – Label for the y-axis. If None, labeled with length_units.

  • title (str, default None) – The title of the plot.

  • flip (bool, default False) – If True, flip image so it displays right-side up. This is necessary because traditionally images have their 0,0 pixel index in the top left corner, and not the bottom left corner. If you are going to use the clicks you record in further image processing applicaitons, you should have flip set to False.

  • saturate_channels (bool, default True) – If True, each of the channels have their displayed pixel values extended to range from 0 to 255 to show the full dynamic range.

  • min_intensity (int or float, default None) – Minimum possible intensity of a pixel in the image. If None, the image is scaled based on the dynamic range in the image.

  • max_intensity (int or float, default None) – Maximum possible intensity of a pixel in the image. If None, the image is scaled based on the dynamic range in the image.

Returns

output – A Bokeh ColumnDataSource instance. This can be immediately converted to a Pandas DataFrame using the to_df() method. For example, output.to_df().

Return type

Bokeh ColumnDataSource