neuralib.imglib.labeller.SequenceLabeller

class neuralib.imglib.labeller.SequenceLabeller[source]

Bases: object

__init__(seqs_info, output=None)[source]
Parameters:
  • seqs_info (list[FrameInfo])

  • output (str | Path | PathLike[str] | None)

Methods

__init__(seqs_info[, output])

check_note_changes()

True if any changes in notes

clear_note()

enqueue_message(text)

go_to(i)

goto_begin()

goto_end()

handle_command(command)

handle_keycode(k)

load_from_dir(directory[, file_suffix, ...])

load_note()

read image-related notes from file

load_sequences(seqs[, filenames, output])

main()

main loop for the GUI

read_note()

save_note()

save image-related notes to file

write_note(note, *[, append_mode])

Attributes

current_frame_index

n_frames

aka.

text_color

window_title

window_title: ClassVar[str] = 'SeqLabeller'
__init__(seqs_info, output=None)[source]
Parameters:
  • seqs_info (list[FrameInfo])

  • output (str | Path | PathLike[str] | None)

classmethod load_sequences(seqs, filenames=None, output=None)[source]
Parameters:
  • seqs (ndarray | list[ndarray])

  • filenames (list[str] | None)

  • output (str | Path | PathLike[str] | None)

Returns:

Return type:

Self

classmethod load_from_dir(directory, file_suffix='.tif', sort_func=None, single_frame_per_file=True, output=None)[source]
Parameters:
  • directory (str | Path | PathLike[str]) – directory contain image sequences

  • file_suffix (str) – sequence file suffix

  • sort_func (Callable[[Path], Any] | None) – sorted function with signature (filename:Path) -> Comparable

  • single_frame_per_file (bool)

  • output (str | Path | PathLike[str] | None)

Returns:

Return type:

Self

property n_frames: int

aka. number of images

property current_frame_index: int
property text_color: float | tuple[int, int, int]
save_note()[source]

save image-related notes to file

load_note()[source]

read image-related notes from file

write_note(note, *, append_mode=False)[source]
Parameters:
  • note (str)

  • append_mode (bool)

read_note()[source]
Return type:

str | None

clear_note()[source]
check_note_changes()[source]

True if any changes in notes

Return type:

bool

goto_begin()[source]
goto_end()[source]
go_to(i)[source]
Parameters:

i (int)

handle_keycode(k)[source]
Parameters:

k (int)

handle_command(command)[source]
Parameters:

command (str)

enqueue_message(text)[source]
Parameters:

text (str)

main()[source]

main loop for the GUI