Core plugins API

hyperspyui.plugins.align module

class hyperspyui.plugins.align.AlignPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

align_1D(roi, signal=None)
align_2D(roi, signal=None)
align_XD(roi, signal=None)
align_horizontal(roi, signal=None)
align_vertical(roi, signal=None)
create_actions()
create_menu()
create_toolbars()
create_tools()
manual_align(signal=None)
name = 'Align'
class hyperspyui.plugins.align.ManualAlignDialog(signal, parent=None)

Bases: hyperspyui.widgets.extendedqwidgets.ExToolWindow

cancel()
close()
create_controls()
ok()

Callback when dialog is closed by OK-button.

update_x()
update_y()
hyperspyui.plugins.align.bin_(QTextStream) → QTextStream
hyperspyui.plugins.align.hex_(QTextStream) → QTextStream
hyperspyui.plugins.align.oct_(QTextStream) → QTextStream

hyperspyui.plugins.axesconf module

Created on Wed Jan 07 19:56:18 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.axesconf.AxesConf(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

Makes a widget that allows the configuration of the signal axes. The widget captures and displays the traitsui dialog shown by signal.axes_manager.show().

create_widgets()

Creates the TraitsWidget (inherits QDockWidget), and adds it to self.ui.

make_traits_dialog(window)

Creates the taitsui dialog. The TraitsWidget captures and displays it.

name = 'Axes Configuration'
valid_window(window)

Check whether the window belongs to a signalwrapper.

hyperspyui.plugins.axesorderwidget module

Created on Tue Apr 28 11:00:55 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.axesorderwidget.AxesListWidget(type, parent=None)

Bases: PyQt4.QtGui.QListWidget

decodeMimeData(data)
dropEvent(event)
inserted
last_drop = None
minimumSizeHint()
moved
sizeHint()
class hyperspyui.plugins.axesorderwidget.AxesOrderPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_widgets()
flip_axes(axes, signal=None)
name = 'Axes order widget'
rollaxis(axis, pos, signal=None)
class hyperspyui.plugins.axesorderwidget.AxesOrderWidget(ui, parent=None)

Bases: hyperspyui.widgets.extendedqwidgets.FigureWidget

create_controls()
hyperspyui.plugins.axesorderwidget.tr(text)

hyperspyui.plugins.basicsignal module

Created on Sun Mar 01 15:20:55 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.basicsignal.BasicSignalPlugin(*args, **kwargs)

Bases: hyperspyui.plugins.plugin.Plugin

add(signals=None)
copy(signals=None)
create_actions()
create_menu()
create_toolbars()
divide(signals=None)
histogram(signal=None)
max(signal=None, advanced=False)
mean(signal=None, advanced=False)
min(signal=None, advanced=False)
multiply(signals=None)
name = 'Basic signal tools'
split(signal=None, advanced=False)
stack(signals=None, advanced=False)
statistics(signal=None)
std(signal=None, advanced=False)
subtract(signals=None)
sum(signal=None, advanced=False)
switch(signal=None)
var(signal=None, advanced=False)
hyperspyui.plugins.basicsignal.bin_(QTextStream) → QTextStream
hyperspyui.plugins.basicsignal.hex_(QTextStream) → QTextStream
hyperspyui.plugins.basicsignal.oct_(QTextStream) → QTextStream
hyperspyui.plugins.basicsignal.tr(text)

hyperspyui.plugins.basicspectrum module

Created on Sun Mar 01 15:20:55 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.basicspectrum.BasicSpectrumPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

adjust_component_position(model=None)

Add widgets to adjust the position of the components in the model.

create_actions()
create_menu()
create_toolbars()
create_tools()
create_widgets()
estimate_thickness(signal=None)
filter_butterworth(signal=None)
fourier_ratio()
hanning_taper(signal=None)
name = 'Basic spectrum tools'
pick_element(element, signal=None)
plot_components(model=None)

Plot the function of each component together with the model.

remove_background(signal=None)
smooth_lowess(signal=None)
smooth_savitzky_golay(signal=None)
smooth_tv(signal=None)
class hyperspyui.plugins.basicspectrum.ElementPickerTool(windows=None)

Bases: hyperspyui._tools.signalfiguretool.SignalFigureTool

get_category()
get_icon()
get_name()
is_selectable()
on_mouseup(event)
on_pick_line(line)
picked
class hyperspyui.plugins.basicspectrum.Namespace

Bases: object

hyperspyui.plugins.basicspectrum.bin_(QTextStream) → QTextStream
hyperspyui.plugins.basicspectrum.hex_(QTextStream) → QTextStream
hyperspyui.plugins.basicspectrum.oct_(QTextStream) → QTextStream
hyperspyui.plugins.basicspectrum.tr(text)

hyperspyui.plugins.cmappicker module

Created on Wed Jan 20 22:32:58 2016

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.cmappicker.CMapDelegate(width, height, cmap_shift, *args, **kwargs)

Bases: PyQt4.QtGui.QItemDelegate

Delegate responsible for drawing a the entries in the colormap combobox.

In addition to drawing a preview of the colormap, it also allows for parent elements to be added (group headings). The colormaps will be prepended by a set amount to prevent overlapping with the text.

drawFocus(painter, option, rect)
paint(painter, option, index)
sizeHint(option, index)
class hyperspyui.plugins.cmappicker.CMapPickerPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

change_cmap(cmap, mpl_axes=None)
create_widgets()
name = 'Color map picker'
class hyperspyui.plugins.cmappicker.CMapPickerWidget(main_window, parent, figure=None)

Bases: hyperspyui.widgets.extendedqwidgets.FigureWidget

create_controls()
disable()
enable(enabled=True)
static make_parent_item(text)
update_controls_from_fig()
hyperspyui.plugins.cmappicker.bin_(QTextStream) → QTextStream
hyperspyui.plugins.cmappicker.hex_(QTextStream) → QTextStream
hyperspyui.plugins.cmappicker.oct_(QTextStream) → QTextStream
hyperspyui.plugins.cmappicker.tr(text)

hyperspyui.plugins.croptool module

Created on Sun Dec 07 02:03:23 2014

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.croptool.CropTool(windows=None, name=None, category=None, icon=None, description=None)

Bases: hyperspyui._tools.selectiontool.SelectionTool

Tool to crop signal interactively. Simply click and drag in a figure to create an ROI, and then press enter to apply cropping operation, or ESC to abort cropping. The cropping can also be aborted simply by selecting a different tool.

get_icon()
get_name()
make_cursor()
class hyperspyui.plugins.croptool.CropToolPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_tools()
crop(roi, signal=None, axes=None)
name = 'Crop tool'

hyperspyui.plugins.eelsdb module

Created on Mon May 04 17:30:36 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.eelsdb.EELSDBPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
default()
download(url)
load_blocking(view, *args)
name = 'EELSDB Plugin'
hyperspyui.plugins.eelsdb.bin_(QTextStream) → QTextStream
hyperspyui.plugins.eelsdb.hex_(QTextStream) → QTextStream
hyperspyui.plugins.eelsdb.oct_(QTextStream) → QTextStream

hyperspyui.plugins.fft module

Created on Fri Dec 12 23:43:54 2014

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.fft.FFT_Plugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
create_toolbars()
decompose(signal=None)
fft(signals=None, inverse=False, on_complete=None)
ifft(signals=None)
infft(signals=None)
live_fft(signals=None)

The live FFT produces the exact same results as the nfft, except nfft calculates the FFTs over all signal dimensions and stores the result in a new signal. The live FFT dynamically calculates the FFT as the user navigates. In other words, nfft is memory intensive, live is cpu intensive.

name = 'FFT'
nfft(signals=None, inverse=False)
hyperspyui.plugins.fft.bin_(QTextStream) → QTextStream
hyperspyui.plugins.fft.hex_(QTextStream) → QTextStream
hyperspyui.plugins.fft.oct_(QTextStream) → QTextStream
hyperspyui.plugins.fft.tr(text)

hyperspyui.plugins.fitting module

Created on Fri Apr 17 00:23:43 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.fitting.FittingPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_tools()
name = 'Fitting plugin'
regression(roi, signal=None, axes=None)
class hyperspyui.plugins.fitting.RegressionTool(*args, **kwargs)

Bases: hyperspyui._tools.selectiontool.SelectionTool

get_icon()
get_name()
on_keyup(event)

hyperspyui.plugins.gaussianfilter module

class hyperspyui.plugins.gaussianfilter.GaussianFilter(ui)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
create_toolbars()
gaussian(sigma, signal=None, out=None, record=True, *args, **kwargs)

Apply a gaussian smoothing filter to an image signal.

Uses skimage.filters.gaussian() for the actual processing.

sigma
: {float}
Smoothing factor in units of pixels, i.e a value around 1 is a slight smoothing.
signal
: {Signal | None}
Signal to operate on. If not, it will use the currently selected one
out
: {Signal | None}
Output signal
record
: {bool}
Whether the operation should be recorded or not.

Other args are passed to skimage.filters.gaussian().

name = 'Gaussian Filter'
on_dialog_accept(dialog)
selection_rules(win, action)

Callback to determine if filter is valid for the passed window.

show_dialog()
class hyperspyui.plugins.gaussianfilter.GaussianFilterDialog(signal, parent, plugin)

Bases: hyperspyui.widgets.extendedqwidgets.ExToolWindow

close_new(value=False)
connect()
create_controls()

Create UI controls.

disconnect()
ok()
set_preview(value)
undo()
update()
hyperspyui.plugins.gaussianfilter.tr(text)

hyperspyui.plugins.gitgetter module

class hyperspyui.plugins.gitgetter.GitSelector(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
name = 'Version selector'
show_dialog()
update_check(silent=False)

Checks for updates to hyperspy and hyperspyUI.

If the packages are not source installs, it checks for a new version on PyPI.

silent: bool
If not silent (default), a message box will appear if no updates are available, with a message to that fact.
class hyperspyui.plugins.gitgetter.PipOutput(parent=None)

Bases: PyQt4.QtGui.QDialog

create_controls()
sizeHint()
class hyperspyui.plugins.gitgetter.VersionSelectionDialog(plugin, parent=None)

Bases: PyQt4.QtGui.QDialog

create_controls()
class hyperspyui.plugins.gitgetter.VisualLogStream(parent=None, buf='')

Bases: _io.StringIO

isatty()
write(s)
hyperspyui.plugins.gitgetter.bin_(QTextStream) → QTextStream
hyperspyui.plugins.gitgetter.check_git_repo(package_name)

Try to determine if the package “package_name” is installed as a source install from a git folder.

hyperspyui.plugins.gitgetter.checkout_branch(branch, stream=None)

If branch is a string, assume it is archive url. Try to install by pip. Otherwise branch is assumed by a branch object from the git package, which will be attempted to be checked out.

hyperspyui.plugins.gitgetter.get_branches(package_name, url)

Either get git branches, or fetch branches from github.com

hyperspyui.plugins.gitgetter.get_github_branches(repo_url)

Return a list of branches for the github repo at given URL.

The branches are returned in the form of an ordered dictionary, with branch names as keys, and source zip URL as value.

hyperspyui.plugins.gitgetter.hex_(QTextStream) → QTextStream
hyperspyui.plugins.gitgetter.oct_(QTextStream) → QTextStream
hyperspyui.plugins.gitgetter.tr(text)

hyperspyui.plugins.imagerotation module

Created on Wed Jan 21 14:49:08 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.imagerotation.ImageRotationDialog(signal, axes, parent, plugin)

Bases: hyperspyui.widgets.extendedqwidgets.ExToolWindow

close_new(value=False)
connect()
connect_update_plot(signal, disconnect=False)
create_controls()

Create UI controls.

disconnect()
ok()
set_preview(value)
update()
class hyperspyui.plugins.imagerotation.ImageRotation_Plugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
create_toolbars()
name = 'Image Rotation'
on_dialog_accept()
rotate_signal(angle, signal=None, reshape=False, out=None, record=True, *args, **kwargs)
selection_rules(win, action)

Callback to determine if rotation is valid for the passed window.

show_rotate_dialog()
hyperspyui.plugins.imagerotation.bin_(QTextStream) → QTextStream
hyperspyui.plugins.imagerotation.hex_(QTextStream) → QTextStream
hyperspyui.plugins.imagerotation.oct_(QTextStream) → QTextStream
hyperspyui.plugins.imagerotation.tr(text)

hyperspyui.plugins.linemeasure module

Created on Thu Jul 30 11:35:49 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.linemeasure.LineMeasure(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_tools()
measure(roi)
name = 'LineMeasure'
class hyperspyui.plugins.linemeasure.LineMeasureTool(windows=None)

Bases: hyperspyui._tools.linetool.LineTool

Tool to crop signal interactively. Simply click and drag in a figure to create an ROI, and then press enter to apply cropping operation, or ESC to abort cropping. The cropping can also be aborted simply by selecting a different tool.

get_icon()
get_name()

hyperspyui.plugins.mirrorplot module

Created on Sun Mar 01 15:18:30 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.mirrorplot.MirrorPlotPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
create_toolbars()
mirror_navi(uisignals=None, shared_nav=False)
name = 'Mirror plot'
share_navi(uisignals=None)
hyperspyui.plugins.mirrorplot.bin_(QTextStream) → QTextStream
hyperspyui.plugins.mirrorplot.hex_(QTextStream) → QTextStream
hyperspyui.plugins.mirrorplot.oct_(QTextStream) → QTextStream
hyperspyui.plugins.mirrorplot.tr(text)

hyperspyui.plugins.moviesaver module

hyperspyui.plugins.mva module

Created on Fri Dec 12 23:44:01 2014

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.mva.MVA_Plugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

Implements MVA decomposition utilities.

bss(signal=None, n_components=None, advanced=False)

Performs decomposition if neccessary, then plots the scree for the user to select the number of components to use for a blind source separation. The selection is made by clicking on the scree, which closes the scree and creates the model.

bss_model(signal=None, n_components=None, advanced=False)

Performs decomposition if neccessary, then plots the scree for the user to select the number of components to use for a blind source separation model. The selection is made by clicking on the scree, which closes the scree and creates the model.

clear(signal=None)

Clears the learning results from the signal.

coc_values = {'convert': 'Convert', 'copy': 'Copy'}
create_actions()
create_menu()
create_toolbars()
do_after_scree(model, signal=None, n_components=None)

Performs decomposition, then plots the scree for the user to select the number of components to use for a decomposition model. The selection is made by clicking on the scree, which closes the scree and creates the model.

get_bss_results(signal)
name = 'MVA'
pca(signal=None, n_components=None, advanced=False)

Performs decomposition, then plots the scree for the user to select the number of components to use for a decomposition model. The selection is made by clicking on the scree, which closes the scree and creates the model.

plot_decomposition_results(signal=None, advanced=False)

Performs decomposition if necessary, then plots the decomposition results according to the hyperspy implementation.

selection_rules(win, action)

Callback to determine if action is valid for the passed window.

hyperspyui.plugins.mva.align_yaxis(ax1, v1, ax2, v2)

adjust ax2 ylimit so that v2 in ax2 is aligned to v1 in ax1

hyperspyui.plugins.mva.bin_(QTextStream) → QTextStream
hyperspyui.plugins.mva.hex_(QTextStream) → QTextStream
hyperspyui.plugins.mva.make_advanced_dialog(ui, algorithms=None)
hyperspyui.plugins.mva.oct_(QTextStream) → QTextStream
hyperspyui.plugins.mva.tr(text)

hyperspyui.plugins.plugin module

Created on Fri Dec 12 23:44:26 2014

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.plugin.Plugin(main_window)

Bases: object

add_action(key, *args, **kwargs)
add_menuitem(category, action, *args, **kwargs)
add_tool(tool, selection_callback=None)
add_toolbar_button(category, action, *args, **kwargs)
add_widget(widget, *args, **kwargs)
create_actions()
create_menu()
create_toolbars()
create_tools()
create_widgets()
name = None
open_dialog(dialog, modal=False, delete_on_close=True)
record_code(code)
unload()

hyperspyui.plugins.rebin module

Created on Wed Jan 07 23:37:51 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.rebin.RebinDialog(signal, plugin, ui, parent)

Bases: hyperspyui.widgets.extendedqwidgets.ExToolWindow

create_controls()
rebin()
validate()
class hyperspyui.plugins.rebin.RebinPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
name = 'Rebin'
rebin(factors, signal=None)
rebin_dialog(signal=None)
hyperspyui.plugins.rebin.bin_(QTextStream) → QTextStream
hyperspyui.plugins.rebin.hex_(QTextStream) → QTextStream
hyperspyui.plugins.rebin.oct_(QTextStream) → QTextStream
hyperspyui.plugins.rebin.tr(text)

hyperspyui.plugins.recorderwidget module

Created on Sun Feb 22 18:46:40 2015

@author: Vidar Tonaas Fauske

class hyperspyui.plugins.recorderwidget.RecorderWidget(main_window, parent=None)

Bases: PyQt4.QtGui.QDockWidget

create_controls()
disconnect_editor(editor=None)
start_recording()
stop_recording(disconnect=True)
update_filter()
class hyperspyui.plugins.recorderwidget.RecorderWidgetPlugin(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_widgets()
name = 'Recorder Widget'
hyperspyui.plugins.recorderwidget.bin_(QTextStream) → QTextStream
hyperspyui.plugins.recorderwidget.hex_(QTextStream) → QTextStream
hyperspyui.plugins.recorderwidget.oct_(QTextStream) → QTextStream
hyperspyui.plugins.recorderwidget.tr(text)

hyperspyui.plugins.segmentation module

class hyperspyui.plugins.segmentation.Segmentation(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_tools()
name = 'Segmentation'
segment(signal, rois)
start(signal=None)

hyperspyui.plugins.tightlayout module

class hyperspyui.plugins.tightlayout.Tightlayout(main_window)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
create_toolbars()
default()
name = 'TightLayout'

hyperspyui.plugins.virtual_aperture module

class hyperspyui.plugins.virtual_aperture.VirtualBfDf(*args, **kwargs)

Bases: hyperspyui.plugins.plugin.Plugin

create_actions()
create_menu()
name = 'Virtual BF/DF'
virtual_annulus(signal=None)
virtual_aperture(signal=None, annulus=False, navigate=False)
virtual_navigator(signal=None)