def __init__(self, field, onesided=True, vmin=None, vmax=None, cmap=None,<EOL>dohist=False, fourier=False, tooltips=False, size=<NUM_LIT:8>):
self.vmin = vmin<EOL>self.vmax = vmax<EOL>self.field = field<EOL>self.onesided = onesided<EOL>self.dohist = dohist<EOL>self.fourier = fourier<EOL>if cmap is not None:<EOL><INDENT>self.cmap = cmap<EOL><DEDENT>else:<EOL><INDENT>self.cmap = '<STR_LIT>' if self.onesided else '<STR_LIT>'<EOL><DEDENT>z,y,x = [float(i) for i in self.field.shape]<EOL>w = float(x + z)<EOL>h = float(y + z)<EOL>self.fig = make_clean_figure(<EOL>figsize=(size * w/h, size), remove_tooltips=not tooltips,<EOL>remove_keybindings=True)<EOL>self.g = {}<EOL>self.g['<STR_LIT>'] = self.fig.add_axes((<NUM_LIT:0.0>, <NUM_LIT:1>-y/h, x/w,   y/h))<EOL>self.g['<STR_LIT>'] = self.fig.add_axes((<NUM_LIT:0.0>, <NUM_LIT:0.0>,   x/w,   <NUM_LIT:1>-y/h))<EOL>self.g['<STR_LIT>'] = self.fig.add_axes((x/w, <NUM_LIT:1>-y/h, <NUM_LIT:1>-x/w, y/h))<EOL>self.g['<STR_LIT>'] = self.fig.add_axes((x/w, <NUM_LIT:0.0>,   <NUM_LIT:1>-x/w, <NUM_LIT:1>-y/h))<EOL>self.slices = (np.array(self.field.shape)/<NUM_LIT:2>).astype('<STR_LIT:int>')<EOL>if self.fourier:<EOL><INDENT>self.field = np.fft.fftshift(np.fft.fftn(self.field))<EOL><DEDENT>self.draw()<EOL>self.register_events()<EOL>
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.

Parameters
----------
field : np.ndarray
    The field to view
onesided : bool, optional
    Whether to use the default one-sided or two-sided colormap.
    Over-ridden by cmap. Default is True
vmin, vmax : numeric, optional
    The min, max colorbar range, as passed to the matplotlib
    colormap. Default is the (min, max) of the data.
cmap : {None, valid matplotlib colormap}, optional
    Use to directly a specific colormap, e.g. `'bone'`. If None
    selects `'bone' if onesided else 'RdBu'`. Default is None
dohist : bool, optional
    Set to True to include a histogram of `field` in an
    additional panel. Default is False
fourier : bool, optional
    Set to True to view the Fourier transform of field. Default
    is False
tooltips : bool, optional
    Whether to include the tooltips bar on the figure. Default
    is False
size : numeric, optional
    The rough figure size of the viewer; the actual size is re-
    scaled based on the field's size. Default is 8