Giter Site home page Giter Site logo

hyperspy / hyperspyui Goto Github PK

View Code? Open in Web Editor NEW
25.0 8.0 14.0 12.29 MB

A user interface for the hyperspy package. https://hyperspy.org/hyperspyUI

License: GNU General Public License v3.0

Python 99.63% Shell 0.33% Batchfile 0.04%
gui hyperspy data-analysis data-visualization eds eels life-sciences materials-science multi-dimensional physical-sciences spectroscopy x-ray-spectroscopy electron-energy-loss-spectroscoy

hyperspyui's Introduction

HyperSpyUI

pypi_version_ anaconda_cloud_ tests_ pre-commit_ python_version_

HyperSpyUI tries to bring a streamlined user interface to the powerful multi-dimensional analysis capabilities of HyperSpy. HyperSpy is an open source Python library which provides tools to facilitate data analysis of multidimensional datasets.

HyperSpy aims at making it easy and natural to apply analytical procedures that operate on an individual signal to multidimensional arrays, as well as providing easy access to analytical tools that exploit the multidimensionality of the dataset.

While the UI tries to create a simple and intuitive interface to HyperSpy, it still retains the raw power of HyperSpy via the UIโ€™s built in IPython console, which runs on the same Python kernel as the UI.

Documentation

For an introduction to HyperSpyUI, see the documentation.

Installation

There are several ways to install HyperSpyUI. The application itself is rather simple to install, but its dependencies can be a bit more tricky. From version 1.1, HyperSpyUI supports both PyQt4 and PyQt5.

HyperSpy Bundle Installer

The quickest way to get set up is to download and install the HyperSpy bundle installer, which includes HyperSpyUI.

Anaconda/Miniconda/Miniforge

Download and install the Miniforge (Miniconda or Anaconda) distribution and run the following command in the anaconda prompt:

conda install -c conda-forge hyperspyui

Installation via pip

To install HyperSpyUI can be intalled from pypi.org including optional dependencies (exspy and pyqt5)

pip install hyperspyui[all]

To install HyperSpyUI with the minimum dependencies:

pip install hyperspyui

Run HyperSpyUI

After installation, you can run HyperSpyUI from the command prompt with:

hyperspyui

or

python -m hyperspyui

For further information, see the full documentation.

hyperspyui's People

Contributors

dependabot[bot] avatar ericpre avatar francisco-dlp avatar jat255 avatar magnunor avatar pre-commit-ci[bot] avatar thomasaarholt avatar to266 avatar vidartf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyperspyui's Issues

PCA/BSS setting for algorithm

If there are many appropriate options that are not shared between the different algorithms, it might be better to create a custom dialog.

Mangled Toolbar icons on Linux

As I was playing around with HyperspyUI today on my laptop, I noticed that some icons didn't look as expected, and were cut off on the edges, namely the text ones (see below).

icon_snapshot1

After playing around with this, I discovered that it is due to the Calibri font (which is saved in the .svg files) is not present on Linux, so the font gets substituted in a less than ideal manner.

Searching around online, there are a few options for fixing this and having a truly "cross-platform" font. The font can be embedded in the qt resources, but this seems like it is an undesirable setup. The other option would be to either convert all the text entries in the .svg files to paths (so there is no text rendered by qt), or to use a font that is very likely to be present on all systems.

NEW: X-ray lines

Plotting the element maps works nicely. It would be nice to select the X-ray lines chosen to plot it.

Labeling X-ray lines would be great as done with marker in branch #296 of hyperspy.

Initial Documentation

Setup and create documentation.

TODO:

  • Setup doc system
  • System for including "Core" plugins' docs
  • Document:
    • Quick-start guide
    • UI build-up: Actions (menu/toolbars), Widgets, Figures/Signals
    • Data tree
    • Plugin system
    • Settings
    • Loading/saving data
  • Individual plugins documentation

Plotting PCA decomposition

I was expecting the explore decomposition to work as plot_decomposition_result. What does explore decomposition do exactly? plot_decomposition_result doesn't need extra computation, it would be nice to have it (maybe keeping only the two signal windows a slider)

Cannot launch HyperspyUI with latest master

Hi Vidar,

I just tried to launch HyperspyUI with the latest hyperspy and hyperspyui master branches, and I'm getting an error. It seems to be related to traits/ipython, but I'm not sure what might be broken.

Here's the traceback:

D:\UMD_Research\SOFC_Project\data\2015-01-30-YMdAP-02 EDS>python D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py
C:\Python279-x64\lib\site-packages\sklearn\lda.py:4: DeprecationWarning: lda.LDA has been moved to discriminant_analysis.LinearDiscriminantAnalysis in 0.17 and will be removed in 0.19
  "in 0.17 and will be removed in 0.19", DeprecationWarning)
C:\Python279-x64\lib\site-packages\sklearn\qda.py:4: DeprecationWarning: qda.QDA has been moved to discriminant_analysis.QuadraticDiscriminantAnalysis in 0.17 and will be removed in 0.19.
  "in 0.17 and will be removed in 0.19.", DeprecationWarning)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "segmentation" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\segmentation.py", line 5, in <module>
    from hyperspyui.tools import MultiSelectionTool
ImportError: cannot import name MultiSelectionTool

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "navigatorswitch" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\navigatorswitch.py", line 2, in <module>
    import hyperspy.roi
ImportError: No module named roi

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "align" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\align.py", line 7, in <module>
    from hyperspyui.tools import SelectionTool
ImportError: cannot import name SelectionTool

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "croptool" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\croptool.py", line 13, in <module>
    from hyperspy.roi import BaseInteractiveROI
ImportError: No module named roi

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "moviesaver" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\moviesaver.py", line 18, in <module>
    writers = mpl.animation.writers
AttributeError: 'module' object has no attribute 'animation'

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "linemeasure" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\linemeasure.py", line 11, in <module>
    from hyperspy.roi  import BaseInteractiveROI
ImportError: No module named roi

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "gaussianfilter" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\gaussianfilter.py", line 3, in <module>
    from hyperspy.signal import DataIterator
ImportError: cannot import name DataIterator

  self.warn("import", plug)
d:\umd_research\software\hyperspyui\hyperspyui\pluginmanager.py:93: RuntimeWarning: Exception in import of hyperspyui plugin "fitting" error:
  File "d:\umd_research\software\hyperspyui\hyperspyui\plugins\fitting.py", line 14, in <module>
    from hyperspyui.tools import SelectionTool
ImportError: cannot import name SelectionTool

  self.warn("import", plug)
Traceback (most recent call last):
  File "D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py", line 93, in <module>
    main()
  File "D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py", line 79, in main
    form = MainWindow()
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindow.py", line 62, in __init__
    super(MainWindow, self).__init__(parent)
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer5.py", line 97, in __init__
    super(MainWindowLayer5, self).__init__(parent)
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer4.py", line 23, in __init__
    super(MainWindowLayer4, self).__init__(parent)
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer3.py", line 24, in __init__
    super(MainWindowLayer3, self).__init__(parent)
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer2.py", line 31, in __init__
    super(MainWindowLayer2, self).__init__(parent)
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer1.py", line 133, in __init__
    self.create_ui()
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer1.py", line 219, in create_ui
    self.create_console()
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer1.py", line 484, in create_console
    control = ConsoleWidget(config=c)
  File "d:\umd_research\software\hyperspyui\hyperspyui\widgets\consolewidget.py", line 21, in __init__
    super(ConsoleWidget, self).__init__(*args, **kwargs)
  File "C:\Python279-x64\lib\site-packages\IPython\qt\console\rich_ipython_widget.py", line 39, in __init__
    super(RichIPythonWidget, self).__init__(*args, **kw)
  File "C:\Python279-x64\lib\site-packages\IPython\qt\console\ipython_widget.py", line 118, in __init__
    super(IPythonWidget, self).__init__(*args, **kw)
  File "C:\Python279-x64\lib\site-packages\IPython\qt\console\frontend_widget.py", line 155, in __init__
    super(FrontendWidget, self).__init__(*args, **kw)
  File "C:\Python279-x64\lib\site-packages\IPython\qt\console\history_console_widget.py", line 27, in __init__
    super(HistoryConsoleWidget, self).__init__(*args, **kw)
  File "C:\Python279-x64\lib\site-packages\IPython\qt\console\console_widget.py", line 245, in __init__
    LoggingConfigurable.__init__(self, **kw)
  File "C:\Python279-x64\lib\site-packages\IPython\config\configurable.py", line 80, in __init__
    self.config = config
  File "C:\Python279-x64\lib\site-packages\IPython\utils\traitlets.py", line 430, in __set__
    new_value = self._validate(obj, value)
  File "C:\Python279-x64\lib\site-packages\IPython\utils\traitlets.py", line 451, in _validate
    return self.validate(obj, value)
  File "C:\Python279-x64\lib\site-packages\IPython\utils\traitlets.py", line 965, in validate
    self.error(obj, value)
  File "C:\Python279-x64\lib\site-packages\IPython\utils\traitlets.py", line 798, in error
    raise TraitError(e)
IPython.utils.traitlets.TraitError: The 'config' trait of a ConsoleWidget instance must be a Config or None, but a value of class 'traitlets.config.loader.Config' (i.e. {'FrontendWidget': {'banner': u'\n    H y p e r S p y\n    Version 0.9+dev\n\n    http://www.hyperspy.org\n\n    '}}) was specified.

For reference, here's my installation environment (via pip list)

agpy (0.1.4)
alabaster (0.7.6)
apptools (4.3.0)
APScheduler (3.0.4)
astropy (1.0.6)
autopep8 (1.2.1)
Babel (2.1.1)
backports-abc (0.4)
backports.ssl-match-hostname (3.4.0.2)
BeautifulSoup (3.2.1)
beautifulsoup4 (4.4.1)
brewer2mpl (1.4.1)
certifi (2015.11.20)
cffi (1.3.1)
characteristic (14.3.0)
cloud (2.8.5)
cmd2 (0.6.8)
colorama (0.3.3)
configobj (5.0.6)
cryptography (1.1.1)
cssselect (0.9.1)
cycler (0.9.0)
Cython (0.23.4)
DateTime (4.0.1)
decorator (4.0.5)
display (1.0.0)
distribute (0.7.3)
Django (1.8.6)
docopt (0.6.2)
docutils (0.12)
enum34 (1.0.4)
envisage (4.4.0)
Flask (0.10.1)
frosted (1.4.1)
functools32 (3.2.3.post2)
future (0.15.2)
futures (3.0.3)
Ghost.py (0.2.3)
h5py (2.5.0)
hyperspy (0.7.3-113-gbdba301, d:\umd_research\software\hyperspy)
hyperspy-tools (0.1.0, d:\umd_research\software\hyperspy_tools)
hyperspyUI (0.5, d:\umd_research\software\hyperspyui)
idna (2.0)
ipaddress (1.0.15)
ipnb (0.1.0)
ipykernel (4.2.1)
ipython (3.2.3)
ipython-genutils (0.1.0)
itsdangerous (0.24)
jedi (0.9.0)
Jinja2 (2.8)
jsonschema (2.5.1)
jupyter-client (4.1.1)
jupyter-core (4.0.6)
keyring (5.6)
libtiff (0.4.0)
lxml (3.5.0)
MarkupSafe (0.23)
matplotlib (1.4.0)
mayavi (4.4.3)
MDP (3.3)
measurement (1.8.0)
mechanize (0.2.5)
memory-profiler (0.39)
mistune (0.7.1)
montage-wrapper (0.9.9.dev235, d:\umd_research\software\montage-wrapper)
mpldatacursor (0.6.1)
mpltools (0.2.0)
myfitnesspal (1.5, c:\users\josh\builds\python-myfitnesspal)
networkx (1.10)
nose (1.3.7)
numpy (1.10.1)
numpydoc (0.5)
ordereddict (1.1)
pandas (0.17.1)
path.py (8.1.2)
patsy (0.4.1)
pep8 (1.6.2)
pickleshare (0.5)
pies (2.6.7)
pies2overrides (2.6.7)
Pillow (3.0.0)
pip (7.1.2)
pkginfo (1.2.1)
plotly (1.9.0)
prettyplotlib (0.1.7)
progressbar (2.3, d:\umd_research\software\python-progressbar)
psutil (3.2.2)
py (1.4.30)
pyasn1 (0.1.9)
pyasn1-modules (0.0.8)
pycairo-gtk (1.10.0)
pycparser (2.14)
pycrypto (2.6.1)
pycurl (7.19.5.3)
pyenchant (1.6.6)
pyface (5.0.0)
Pyfig (0.1)
pyflakes (1.0.0)
Pygments (2.0.2)
pygobject (2.28.6)
pygtk (2.22.0)
PyInstaller (3.0)
PyOpenGL (3.1.0)
pyOpenSSL (0.15.1)
pyparsing (2.0.6)
pyqode.core (2.7.0)
pyqode.python (2.7.0)
pyqode.qt (2.7.0)
PyQwt (5.2.1)
pyreadline (2.1)
pyregion (1.1.4)
PySide (1.2.4)
pytest (2.8.3)
python-dateutil (2.4.2)
python-qt-binding (0.2.14)
pytz (2015.7)
PyV8 (1.0)
PyVTK (0.4.85)
pywin32 (218)
pyzmq (15.1.0)
queuelib (1.4.2)
requests (2.8.1)
requests-toolbelt (0.5.0)
rodeo (0.4.4)
scikit-fmm (0.0.7)
scikit-image (0.11.3)
scikit-learn (0.17)
scipy (0.16.1)
Scrapy (1.0.3)
seaborn (0.6.dev0, d:\umd_research\software\seaborn)
selenium (2.48.0)
service-identity (14.0.0)
setuptools (18.6)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.0)
Sphinx (1.3.1)
sphinx-bootstrap-theme (0.4.8)
sphinx-rtd-theme (0.1.9)
spyder (2.3.7)
statsmodels (0.6.1)
sympy (0.7.6.1)
tifffile (0.7.0)
tornado (4.3)
tpbcalcs (0.1.0)
traitlets (4.0.0)
traits (4.5.0)
traitsui (4.5.1)
triangle (2015.3.28)
twill (0.9)
twine (1.6.4)
Twisted (15.4.0)
tzlocal (1.2)
vispy (0.5.0.dev0, d:\umd_research\software\python\vispy)
VTK (6.1.0)
w3lib (1.13.0)
Werkzeug (0.11.2)
wheel (0.26.0)
yolk (0.4.3)
zope.interface (4.1.3)

HyperspyUI will not start with matplotlib==1.5

As it says in the title. HyperspyUI looks for FigureCanvas, which apparently doesn't exist in 1.5:

D:\UMD_Research\SOFC_Project\data\2015-01-30-YMdAP-02 EDS>python D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py
C:\Python279-x64\lib\site-packages\sklearn\lda.py:4: DeprecationWarning: lda.LDA has been moved to discriminant_analysis.LinearDiscriminantAnalysis in 0.17 and will be removed in 0.19
  "in 0.17 and will be removed in 0.19", DeprecationWarning)
C:\Python279-x64\lib\site-packages\sklearn\qda.py:4: DeprecationWarning: qda.QDA has been moved to discriminant_analysis.QuadraticDiscriminantAnalysis in 0.17 and will be removed in 0.19.
  "in 0.17 and will be removed in 0.19.", DeprecationWarning)
Traceback (most recent call last):
  File "D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py", line 93, in <module>
    main()
  File "D:\UMD_Research\Software\hyperspyUI\hyperspyui\launch.py", line 77, in main
    from hyperspyui.mainwindow import MainWindow
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindow.py", line 16, in <module>
    from hyperspyui.mainwindowlayer5 import MainWindowLayer5, tr
  File "d:\umd_research\software\hyperspyui\hyperspyui\mainwindowlayer5.py", line 32, in <module>
    from hyperspyui.mdi_mpl_backend import FigureCanvas
ImportError: cannot import name FigureCanvas

Numpy operations

sum, mean, std, var, min, max.

  • Implement all
  • Icons
  • Method to specify which axes to perform on #42.

Axes calibration dialog/tools

Calibrate scale and offsets

  • For scale: "Pixel" distance -> Actual distance
  • For offset: Given position should be given value (e.g. ZLP = 0).
  • [] Implement scale
  • [] Implement offset
  • [] Icons

Accessing open data from console

This probably isn't the right place to ask for application support, but there's no documentation, so why not? ๐Ÿ˜ (I'd be happy to help)

I have gotten an undergrad researcher going using Hyperspy, and it is nice for him to use hyperspyUI to do some visualization and basic investigation before digging into PCA, NMF, etc.

My question, is is there a way to access the data that is already open in the session from the console? I assume this is possible and I'm just blind, but I couldn't figure it out. This would be really useful to do some operations on the data in place and see their effect in real time.

Thanks again!

Cannot launch HyperspyUI

Hello,

I've been trying to give hyperspyUI another shot, as I have some other group members (that are not so familiar with Python and the command line) who may be interested in using the software so I wanted to see where it stands.

I'm having trouble getting it running, both on my main installation (Windows 8.1 with 64-bit Python 2.7.9), and on a fresh install of v0.8 of hyperspy I did in a virtual machine (Windows XP with 32-bit Python 2.7.10). Hyperspy is working fine, but I cannot get hyperspyUI to launch. On both tests, using both the command line or the desktop shortcut to run the program causes the splash screen to show, and then a flicker of a command line python window, and then nothing. Looking at the task manager, it looks like a pythonw.exe process starts up and then quickly shuts down, but there is no output to the terminal or anything that helps explain what's happening.

Any ideas on how to debug this further, or perhaps get it working?

Migrate to python 3

Possibly: Add function annotations on the most import bits to improve IDE completion.

NEW: BSS

I'm sure blind source separation is in the pipeline, I just like to mention it.

NEW: Dragable square and line

It would be nice to switch between resizable dragable square and dragable square (when willing to select only one spectrum).

When plotting image, it would be nice to sum over a range of energy (between two dragable lines)

NEW: recorder

In parallel with the console, having a script recorder would be great.

Smoothing actions

Most smoothing tools has traitsui dialogs, so simply pop them up.

Branches and version

It would be nice to have a branch of the UI that works with the last release of hyperspy (proably after 0.8 released), a branch that works with the master branch of hyperspy and a branch that works with a "dev" branch that works with a hyperspy/UI branch with the latest modification not yet merged into hyperspy/master

Which version of Hyperspy should we use?

Currently the version of hyperspy needed to make the UI work is vidartf/work_house. Should there be a branch on hyperspy repository that works with the current version of the UI?

Update recording

Make all the code record code. Consider option to record in pure hyperspy code.

  • Make all core parts record as they should
  • Make all plugins record

Remove/replace wrappers

If possible, SignalWrapper/ModelWrapper classes should be replaced with a (singleton) class SignalManager or similar. This will simplify the signal tracking and management in the UI, and reduce the chance of stray references keeping signals from being garbage collected.

NEW: Binning and calibration

Hi Vidartf,

thanks a lot for this GUI. It's really good. I have used it with EDS spectrum image. It works very well. I have a few suggestions for new features. I'll create one Issue per feature.

To start with, EDS data are noisy. Binning (in energy or spatially) can improve a lot PCA. A widget to bin the data and to calibrate the axes_manager would be very nice.

"Create signal" dialog

Dialog to create a signal of arbitrary size/dimensions, and fill with zeros, ones or random data.

Replace `HookedSignal` with hyperspy events

Previously, HookedSignal was introduced to control/monitor hyperspy plotting. Instead, a set of events should be introduced to hyperspy (plotting and plotted), and HookedSignal removed or replaced by a SignalManager class (singleton).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.