oursin.camera

Camera

Functions

set_pan

Set camera pan coordinates

set_position

Set the camera position in CCF space in um relative to CCF (0,0,0), coordinates can be outside CCF space.

set_rotation

Set the camera rotation (pitch, yaw, spin).

set_target

Set the camera target coordinate in CCF space in um relative to CCF (0,0,0), without moving the camera.

set_target_area

Set the camera rotation to look towards a target area

set_zoom

Set the camera zoom.

set_target(camera_target_coordinate)[source]

Set the camera target coordinate in CCF space in um relative to CCF (0,0,0), without moving the camera. Coordinates can be negative or larger than the CCF space (11400,13200,8000)

Parameters

camera_target_coordinatefloat list

list of coordinates in ml/ap/dv in um

Examples

>>> urn.set_target([500,1500,1000])
set_position(camera_pos, preserve_target=True)[source]

Set the camera position in CCF space in um relative to CCF (0,0,0), coordinates can be outside CCF space.

Parameters

camera_posfloat list

list of coordinates in ml/ap/dv in um

preserve_targetbool, optional

when True keeps the camera aimed at the current target, when False preserves the camera rotation, by default True

Examples

>>> urn.set_position([500,1500,1000])
set_rotation(pitch, yaw, spin)[source]

Set the camera rotation (pitch, yaw, spin). The camera is locked to a target, so this rotation rotates around the target.

Rotations are applied in order: pitch, then yaw, then spin.

Parameters

camera_rotfloat list

list of euler angles to set the camera rotation in (pitch, yaw, spin)

set_zoom(zoom)[source]

Set the camera zoom.

Parameters

zoomfloat

camera zoom parameter

set_target_area(camera_target_area)[source]

Set the camera rotation to look towards a target area

Note: some long/curved areas have mesh centers that aren’t the ‘logical’ center. For these areas, calculate a center yourself and use set_camera_target.

Parameters

camera_target_areastring

area ID or acronym, append “-lh” or “-rh” for one-sided meshes

set_pan(pan_x, pan_y)[source]

Set camera pan coordinates

Parameters

pan_xfloat

x coordinate

pan_yfloat

y coordinate

Examples

>>> urn.set_pan(3.0, 4.0)