peri.viz.interaction

class peri.viz.interaction.OrthoViewer(field, onesided=True, vmin=None, vmax=None, cmap=’bone’, dohist=False, fourier=False, tooltips=False)

Easy interactive viewing of 3D ndarray with view selection. Navigate in 3D by clicking on the three panels which are slices through the array at a given position.

class peri.viz.interaction.OrthoPrefeature(image, pos, viewrad=None, cmap=’Greys_r’, part_col=[0.0, 1.0, 1.0, 1.0], **kwargs)

Interactive viewing of a 3D featured image, to examine the quality of initial featuring.

There are 3 modes of the viewer, accessed by pressing these keys:
  • ‘V’ : switch to view mode (click window to move view)
  • ‘A’ : add particle mode (click position to add)
  • ‘R’ : remove particle mode (click position to remove)

The viewer starts in view mode. The complete list of particle positions is stored in self.pos

Parameters:
  • im (numpy.ndarray) – The image to check pre-featuring on.
  • pos ([N,3] numpy.ndarray) – The initial guess for the particle positions, in pixel units
  • viewrad (Float or None, optional.) – The width of the particles to plot. Default is 2.
  • cmap (String, optional) – A valid matplotlib colormap. Default is ‘Greys_r’.s
  • part_col (list-like, optional) – Color of the particles…. RGBA. Default is cyan.
  • **kwargs (All keyword args to OrthoViewer....) –
class peri.viz.interaction.OrthoManipulator(state, size=8, cmap_abs=’bone’, cmap_diff=’RdBu’, incsize=18.0, orientation=None, vrange_img=1.0, vrange_diff=0.1)

An interactive viewer for states for a model in 3D. Can work with any 3D state with a set of components. This viewer relies heavily on hotkeys. The various modes that can be accessed are by pressing these keys:

‘Q’ : switch between ‘model’, ‘residual’, and ‘component’ views ‘A’ : add particle mode (click position to add) ‘R’ : remove particle mode (click position to remove) ‘E’ : optimize particle (click particle to optimize) ‘W’ : switch to fourier views ‘V’ : switch to view mode (click window to move view) ‘C’ : If in ‘component’ views, cycles through components
state : peri.states.State object
The state object to look at
size : float
Relative window size, this is based on matplotlib.figure(figsize) and has some units which I don’t understand.
cmap_abs : string
Colormap to use for the one sided scales such as data and model
cmap_dff : string
Colormap to use for difference images, such as residuals
orientation : one of [‘h’, ‘v’, ‘horizontal’, ‘vertical’]
The orientation of the two views
vrange_img : float
vmax for imshow for absolute images
vrange_diff : float
vmax - vmin for imshow for difference images