cigvis.vispynodes.axis_aligned_image module#

class cigvis.vispynodes.axis_aligned_image.AxisAlignedImage(image_funcs: List[Callable], axis='z', pos=0, limit=None, cmaps=['grays'], clims=None, interpolation=['linear'], method='auto', texture_format=None, display_range: Dict[str, Tuple[int, int]] = None, offset_factor=2.0, offset_units=2.0)#

Bases: Image

Visual subclass displaying an image that aligns to an axis. This image should be able to move along the perpendicular direction when user gives corresponding inputs.

Parameters#

image_funcList[array-like]

input images

axisstr

one of [‘x’, ‘y’, ‘z’]

posint

position of the image, can be int number or Tuple, pos=10, axis=’z’ => start_pos = [0, 0, 10]

limitTuple

limit of the viewbox

cmapsList

cmap for each image

climsList

clim for each image

interpolationsList

interpolation method for each image

methodstr

method of Image

add_mask(vol: ndarray, cmap: str, clim: List, interpolation: str, method: str = 'auto', texture_format: str = 'auto', preproc_f: Callable = None)#
add_observer(line)#
property axis#

The dimension that this image is perpendicular aligned to.

drag_visual_node(mouse_move_event)#

Drag this visual node while holding left click in the selection mode (<Ctrl> pressed). The plane will move in the normal direction perpendicular to this image, and the anchor point (set with func ‘set_anchor’) will move along the normal direction to stay as close to the mouse as possible, so that user feels like ‘dragging’ the plane.

get_click_pos3d(mouse_press_event)#
remove_mask(idx)#
set_anchor(mouse_press_event)#

Set an anchor point (2D coordinate on the image plane) when left click in the selection mode (<Ctrl> pressed). After that, the dragging called in func ‘drag_visual_node’ will try to move along the normal direction and let the anchor follows user’s mouse position as close as possible.

set_visible(idx: int, visible=False)#
update_lines()#
class cigvis.vispynodes.axis_aligned_image.InteractiveLine(axis_pair, shape, pos=None, color=(1, 1, 1), width=1, connect='strip', method='gl', antialias=False, display_range=None)#

Bases: Line

refresh()#
cigvis.vispynodes.axis_aligned_image.get_image_func(axis: str, vol: ndarray, preproc_f: Callable, forcefp32=False) Callable#

Parameters#

axisstr

‘x’ or ‘y’ or ‘z’

i_volint

index of the volumes