Created 'function analyse_dataset':

The main analysis has been moved to this new function.
This is a preparation for the automatic optimisation.
Prepared SR-EELS_characterisation for automatic optimisation:

I rearranged to code to be prepared for the next step.
The loop at line 61 will be the origin for the optimisation.
Generate statistics about the used threshold methods:

A txt file is created, that shows the mean r² and the stdv of r² for each used threshold method.
Updated SR-EELS_characterisation.ijm:

The threshold method 'Li' performs best for this task. I decided to use only this method. That is why I removed some code I added yesterday (r² comparison).
Added links to sample files:

I added 2 links to zip files I uploaded to my webspace.
Both files contain a SR-EELS series that can be used to test SR-EELS_characterisation.ijm.
Extended SR-EELS_characterisation.ijm by an Gaussian fit:

The Gaussian fit is used to estimate the region (rectangle selection) that is used to run the threshold.
Additionally the region is used at the next iteration to fit the Gaussian. Because there are high counts at the first iteration, there is only a low risk for this method to fail.
For bad fit result the code 'sigma_weighed = sigma_weighting * gauss_sigma / pow(Fit.rSquared(), 2);' will increase the width of the region.
Merge pull request #7 from EFTEMj/scripts+macros

Merge Scripts+macros to update  Scripts+Macros/SR-EELS_characterisation.ijm.