pyclickimage.ClickImageApp#

class pyclickimage.ClickImageApp(image: ndarray | None = None, output: str | None = None)[source]#

Bases: QMainWindow

PyQt application for collecting precise mouse clicks on images.

Features#

  • Subpixel precision (float coordinates)

  • Optional integer rounding mode

  • Multiple click groups

  • CSV export/import

  • Real-time overlay rendering

_append_log(msg: str)[source]#

Append log message.

_format_value(v)[source]#
_init_ui()[source]#

Build full interface layout.

_process_left_click(x: float, y: float)[source]#

Store click.

_process_right_click(x: float, y: float)[source]#

Store placeholder click.

choose_color()[source]#
clear_logs()[source]#

Clear log message.

closeEvent(event)[source]#

Confirm exit if unsaved.

crosshair_choose_color()[source]#
get_selected_colormap()[source]#

Get the selected colormap for displaying the image.

Returns:

The selected colormap.

Return type:

str

on_add_group()[source]#

Create a new click group.

on_colormap_changed(index)[source]#

Called when the user selects a different colormap.

on_delete_group()[source]#

Delete current group with safety checks.

on_display_clicks_changed(state)[source]#

Toggle dispaly clicks.

on_group_changed(name)[source]#

Switch active group.

on_half_shift_changed(state)[source]#

Toggle half-shift mode.

on_load_clicks()[source]#

Load clicks from CSV and replace current data.

on_load_image()[source]#

Load an image from file dialog.

If clicks already exist, ask user whether to clear them or keep them.

on_marker_size_changed(value: str)[source]#

Update marker size.

on_precision_changed(state)[source]#

Toggle integer/float precision mode.

on_rename_group()[source]#

Rename current group.

on_undo_all_click()[source]#

Remove all click from current group.

on_undo_last_click()[source]#

Remove last click from current group.

save_as_csv()[source]#
save_csv()[source]#

Save clicks to CSV.

set_image(image: ndarray | None)[source]#

Set image to display.

update()[source]#

Refresh UI.

update_groups()[source]#

Sync group selector.

update_table()[source]#

Update table with current group points.

update_viewer()[source]#

Render image + clicks.