neurocarto.views.image

class neurocarto.views.image.ImageView

Base of image view.

__init__(config, image=None, *, logger='neurocarto.view.image')
Parameters:
property name: str

view name

property width: float

Width of image

property height: float

Height of image

start()

Invoked when figure is ready.

on_boundary_transform(state)

Image transforming updating callback.

Parameters:

state (BoundaryState) – updated boundary parameters.

class neurocarto.views.image.ImageViewState
class neurocarto.views.image.ImageHandler

Image information.

__init__(filename)
Parameters:

filename (str | None)

abstract property width: float

image width in um.

abstract property height: float

image height in um.

property resolution: tuple[float, float]

resolution (width, height) in unit um/pixel.

classmethod from_file(filename)
Parameters:

filename (str | Path) – any Pillow support image format

Returns:

Return type:

Self

class neurocarto.views.image.FileImageView

Load images from file.

__init__(config, *, logger='neurocarto.view.file')
Parameters:
property name: str

view name

save_state()

Save current state into S.

Returns:

json-serializable instance.

Return type:

list[ImageViewState]

restore_state(state)

Restore state from state.

Parameters:

state (list[ImageViewState]) – json-deserializable instance.