holopy.vis package

Module contents

Visualize HoloPy objects

Uses Matplotlib and Mayavi to visualize holopy objects.

  1. Image, Volume, or Spheres object => plot or rendering

This module does not import plotting packages until they are actually needed so that holopy does not have a hard dependency on mayavi or matplotlib. Because of this you may see a small lag on your first plot.

holopy.vis.show module

A general show method that can display most holopy and scatterpy objects in a sensible way.

exception VisualizationNotImplemented(o)

Bases: Exception

show(o, color=(0.5, 0.5, 0.5))

Visualize a scatterer, hologram, or reconstruction

Parameters:o (Image, Volume or Spheres) – Object to visualize

Notes

Loads plotting library the first time it is required (so that we don’t have to import all of matplotlib or mayavi just to load holopy)

test_disp()

holopy.vis.vis2d module

New custom display functions for holograms and reconstructions.

class plotter(im, plane_axes, slice_axis, starting_index, t)

Bases: object

click(event)
draw()
location(x, y)
pixel(x, y)
show2d(im, plane_axes=None, slice_axis=None, starting_index=0, t=0, phase=False)

Display a hologram or reconstruction

Allows scrolling through multidimensional holograms or reconstructions. Defaults to showing magnitude of complex images

Parameters:
  • im (ndarray) – Image to be shown
  • z0 (int) – slice along z dimension to show first.
  • t (int) – slice along time to show for reconstructions.
show_scatterer_slices(scatterer, spacing)

Show slices of a scatterer voxelation

scatterer : .Scatterer
scatterer to visualize
spacing : float or (float, float, float)
voxel spacing for the visualization

holopy.vis.vis3d module

Show sphere clusters using mayavi

import_mayavi()
show_scatterer(scatterer, spacing=None)
show_sphere_cluster(s, color)
volume_contour(d)