This DigitalMicrograph plugin makes Multivariate Statistical Analysis of STEM EELS or EDX data cubes. The core of the package is Principal Component Analysis (PCA) that extracts several components with the highest variance from raw data. In this way the dimensionality of data is greatly reduced and  data sets are denoised. For better interpretation,  obtained PCA components can be further rotated in the factor space using Varimax or ICA methods. PCA results can also be casted in endmembers spectra. These easy-to-interpret spectra are found by the manupulations in the factor space.  For  datasets with the complicated internal data distribution the package offers clustering data in the factor space.

Lecture introducing into the MSA stuff delivered in the EELS school in July 2019:
Multivariate Statistical Analysis to denoise EELS spectrum-images

This lecture explains how to denoise spectrum images treats the central problem of PCA – truncation of principal components. A new simple and robust method for automatic truncation is invented: Automatic Truncation of Principal Components

How to use temDM MSA:

open pdf basic version
open pdf advanced version

open pdf MSA scripting

temDM MSA 2.37 basic version (open source, Anscomb transform debugged):


temDM MSA 2.36 (some bugs are fixed) advanced version with acceleration:

This trial version is valid till 31.12.2022.

get advanced version

comparison among MSA programs


Example of simulated EELS datacube:

free download

Example – Mag*I*Cal EELS datacube:

free download

Example – Mag*I*Cal XEDS datacube:

free download

Example – Velox XEDS superalloy:

free download

Example – synthetic STEM XEDS spectrum-images of a CMOS device:

free download

YouTube tutorials


20 Replies to “temDM MSA”

  1. Hi Fengyuan,
    I assume you opened a spectrum-image and tried to do directly PCA by clicking a “PCA” knob. You should first prepare a container for PCA. The correct treatment involves pressing the knobs in a certain sequence: from top to bottom of the tool. First “container” having spectrum-image in front, then “PCA” having a container (MSA matrix) in front, then “reconstruct”. You might follow the video:
    It is already a bit old (I should refresh it) but still can be instructive.
    best, Pavel

  2. Hi,
    Error message “Must be a MSA matrix in front of it”

  3. The problem is not in bugs but in the corrupted personal tags. Try following:
    i) Open “Filter” with holding the SHIFT key
    ii)If does not help, type “MSA112_delete()” in the script window and press Execute.
    Good luck,

  4. Hi,

    I had the 1.96 version and I had a bug with the “Filtering” window that didn’t want to open anymore with a message in the output :
    “MSA filtering 817 initialized
    MSA import 833 initialized
    tool shown 0
    MSA filtering 877 destroyed”

    I’ve decided to come here and to download the lastest version but the same thing is happenning. What should I do to fix this issue ?

    Thank you

  5. Hi Steph(a?)n,
    That is a bug. Will be fixed in the nearest update of temDM MSA. But I would not use ICA for spectrum-images, it seldom output anything reasonable.
    By the way, as a bug finder, you can get a 10% discount in case you decide to purchase the advanced version of the program. Just let me know your full name and email and I ll include you into the bug finders list.

  6. Hi, pavel,
    Your view results tool makes error when. Press iteration of ICA resilts

  7. I guess you are using GMS3.4 and you mean the issue with the hdf5_GMS2X_amd64.dll. DigitalMicrograph claims incompatibility during the start. That is because this dll was compiled for the older versions of GMS. You can safely ignore this message, the plugin in fact works. Alternatively you can get rid of this boring message by removing hdf5_GMS2X_amd64.dll from the plugin folder. However you then would not be able to import Velox spectrum-images. The “incompartable” dll is not from temDM, it was written by Tore Niermann (TU Berlin). I have already asked Tore to recompile it, lets hope he will manage nearest time.

  8. Hi, I loaded your dll and got an error message on start.

  9. As some temDM MSA users mentioned, the problem with reading Velox 2.4 arised from the changed format of metadata. The problem is fixed in the temDM MSA 1.93 version.

  10. In the meantime I found out that the “img2str” method was creating the problem (FEI changed the metadata field size in x direction from 1 to 2).

  11. Thank you for your message. The importing tool was tested with the version 2.3 only. It seems (not unexpectedly) that a new version makes changes. To tune the tool I would appreciate getting an examplary dataset. It should not be anything critical but must consist of recognizable pattern like C-grid. In case, someone dont mind to share it, please contact through pavel@temdm.com.

  12. It seems that your test data contains only one entry in the “SpectrumStream” branch, whereas in my file there are 4 (“counts”, “net counts”, “wt%” and “at%”, I guess, as it is in the Velox software version 2.4). Not all of them contain data, especially if you haven’t conducted any quantification. The result is that the Graz script is complaining about empty labels in TagGroups. I checked the path names and their names seem unchanged. I think the 4 sub paths create some kind of ambiguity, so that your script does not know which one (“counts”, “net counts”, “wt%” and “at%”) to import.

  13. Indeed, FEI changes their format too often. If this is the only change of path, temDM MSA can acommodate for that:
    Go to DigitalMicrograph Global Info/Global Tags/_temDM-Scripts/MSA/Velox and find there the editable standard pathes.Those should be compared with the actual pathes in your Velox version. The meaning of all pathes is explained in the text of “Read EDX Velox Spectrum-image” script free downloadable at https://www.felmi-zfe.at/dm-script/dm-script-database.
    Alternatively, you might send me your (not-confidential) Velox data and I will try to figure out what goes wrong.

  14. Velox import does work for the test data being provided, however, it doeas not for new acquired data. The script just shows the TagEditor and states “failed or stopped” in the import dialog. Maybe FEI changed the Velox format a bit in the meantime (I use Velox v. 2.4) so that the script is not able to find the correct data location within the Velox file anymore.

  15. temDM MSA tries to remember all your last applied settings. It can happen that your tool window was set at the crazy position last time. A universal solution for such problems: open a new script window and type there MSA112_delete(). Execute the script. All temDM MSA tags will be deleted and the next time the program will start from the default settings.

  16. When I load the Import tool from temdm msa menu it does not appear. Whats wrong?

  17. Barney, you are 100% right. This EELS set was not good because 1) sample was thick 2) some Tridiem and Quantum GIFs degrade at the end of their energy range due to the shifted cross-over (I didnot optimize crossover, it was not my instrument). I need this set just as an example that the slight signal can be enhanced by PCA. Pavel.

  18. Hi Pavel. Your MagiCAL EELS data is of bad quality, The sample should consist of about 80% Si but the Si K edge is almost not seen!

Leave a Reply

Your email address will not be published.