pixviz.roi#

pixviz.roi.RoiName#

alias of str

pixviz.roi.compute_pixel_intensity(image, func, debug_save=False)[source]#

Compute the selected area pixel intensity

Parameters:
  • image (QImage | ndarray) – image object, either PyQt6.QtGui.QImage or image numpy.array

  • func (Literal['mean', 'median']) – PIXEL_CAL_FUNCTION {‘mean’, ‘median’}

  • debug_save (bool) – debug save cropped image

Returns:

Return type:

float

class pixviz.roi.RoiLabelObject[source]#
__init__()[source]#
rect_item: QGraphicsRectItem#

set after selection

text: QGraphicsTextItem#

set after roi dialog

background: QGraphicsRectItem | None#

set after roi dialog

func: Literal['mean', 'median']#

calculation func

data: ndarray | None#

(F,)

angle: float#
rotation_handle: QGraphicsEllipseItem#
property rect_repr: str#

rect coordinates

set_name(name)[source]#

set name, text and background of the selected area

Parameters:

name (str) – roi name

Return type:

None

set_data(data)[source]#

set calculated pixel intensity data

Parameters:

data (ndarray)

Return type:

None

rotate(deg)[source]#
Parameters:

deg (float)

Return type:

None

update_rotation()[source]#
update_element_position()[source]#
to_meta(idx)[source]#

to meta for saving

Parameters:

idx (int)

Return type:

dict[str, Any]

asdict()[source]#
Return type:

dict[str, Any]

class pixviz.roi.PixVizResult[source]#
__init__(dat, meta)[source]#
Parameters:
  • dat (Path | str) – .npy or .mat data path

  • meta (Path | str) – .json data path

dat: ndarray#
meta: dict[str, Any]#
classmethod load(dat, meta)[source]#
Parameters:
  • dat (Path | str)

  • meta (Path | str)

get_index(name)[source]#

Get index from roi name

Parameters:

name (str) – roi name

Returns:

roi index

Return type:

int

get_data(source)[source]#

Get roi data from either index or name

Parameters:

source (int | str) – if int type, get data from index; If string type, get data from roi name

Returns:

data (F,)

Return type:

ndarray

property n_rois: int#

number of roi selected

property n_frames: int#

number of frames (sequences)