This tool applies sparse denoising techniques to STM images, and is available both for Matlab and Gwyddion.
Matlab version:
· 1/02/2015: RestoreSTM.zip
Gwyddion module:
· 13/04/2015: imageprocessing.py
Gwyddion module is written in Python. So before installing the module make sure you have Gwyddion installed with Pygwy – python interface (please refer to Gwyddion’s documentation on how to install it).
Please note that numpy and scipy must be installed.
Detailed instructions for Windows users:
1. Install Gwyddion 32 bits version
Pygwy only works on the 32bit version.
2. Install Python (version 2.7.x)
3. Install numpy
Install
most recent version. Use the superpack package (ex:
numpy-1.9.2-win32-superpack-python2.7.exe)
(Match the python version installed!)
4. Install scipy
Install
most recent version. Use the superpack package (ex:
scipy-0.15.1-win32-superpack-python2.7.exe)
(Match the python version installed!)
5. Install Gtk+ (32bits – all in one bundle)
Add
the gtk/bin directory to your windows path environment variable:
(Control Panel -> System -> Advanced -> Click on Environment
Variables. Add ;c:\gtk\bin if you installed gtk on c:\gtk)
6. Install PyGObject
Install
most recent version and match the installed python version.
7. Install PyCairo
Install
most recent version and match the installed python version.
8. Install PyGTK
Install
most recent version and match the installed python version.
After you have Gwyddion with pygwy working, just copy the module file (imageprocessing.py) to the following location:
· Mac/Linux: ~/.gwyddion/pygwy/
· Windows: c:\Users\ <your home directory> \gwyddion\pygwy\
The following steps illustrate the usage of this module in order to get the denoised image of the paper.
1. Start by downloading the following files:
STM_image.STP – the STM image
STM_image_mask.mat
– Matlab file with mask for STM_image.STP
2. Start Gwyddion
3. Open the STM image (STM_image.STP)
4. Pre-process the image:
Level data by mean plane subtraction
(Click on the icon under Data Process: )
Correct lines by matching height median (Click on the icon under Data Process: )
5. Remove outliers:
Data Process -> Correct Data ->
Mask of Outliers
Data Process -> Correct Data -> Remove Data Under Mask
6. Open the Sparse Denoise Tool
Data Process -> Image Processing Tools -> Sparse Denoise
7. Select Load Mask and choose the file STM_image_mask.mat
8. Select Learn, and in the following window choose Defaults
9. Click OK to train the dictionary. (please wait while the algorithm works)
10. You can see the learned patches by selecting View
11. Select Denoise, and in the following window set the number of atoms to 4, and choose Estimate Error (you should see a value of approximately 8.14)
12. Click Ok to denoise. (please wait while the algorithm works)
13. The denoised image is added as a new channel.
This is the main window of the algorithm.
In this window you can set the various parameters of the learning dictionary algorithm (see paper for details).
The “Default” button fill in default values of the parameters that work reasonable well for various different images.
In this window you can view the atoms (the basis) of the trained dictionary.
In this window you can set the parameters of the denoising algorithm.
The button “Estimate error” estimates the error tolerance from the noisy image (see the paper for details).