1. Open the stand-alone STEM Corrector tool. Check the expiration date of the app via its Menu: About: Expiration.

2. Click "LOAD" button at the left-lower corner. Holding CNTR, choose BOTH files consisting of the STEM in the original and rotated orientation.  Read the names of loaded images at the top of the tool to ensure that the original orientation image is at the LEFT while the rotated one is at the RIGHT. If it is not the case, switch them by clicking  the "Exchange" button in between frames.

Alternatively, you may load each file into the corresponding left or right frame by clicking "load O" and "load R" buttons.

Images appear in the as-scanned orientation. That means the right image is rotated clockwise relative the left one. To visualise it better, click the red knob "rotate" under the right frame. Now both images are oriented same.

3. Decide how you are going to control correction. For HRSTEM images, turn "use FFT" switch ON. For more accurate correction, press "STICK" button and align two points you believe are the same in in the left and right images.

4. Press "LINEAR" correction button and observe both images aligned relative each other. Their shape is restored (affine transformation) according the assumption of a linear shift between their acquisition.

Now you can choose to see the deformed images in various frames: in the initial frame size, larger frames including all deformed pixels or in smaller frame showing only a rectangular without empty space. Toggle among these three viewing modes by clicking the "Frames" button in between images.

5. Press  "NON LINEAR" correction button to try the next step of correction.  The irregular scan variation within each frame will be hopefully relaxed.  

6. In case, you wish to treat a number of similar images as a package, name them with the standard names and press the knob "S" in between the frames. Then you choose the FOLDER (not individual files) where all your files are located. Scroll among images and apply consequent correction to like described above. You still have to press the correction knobs for every image. 


IMPORTANT: the linear correction depends crucially on the way of correction. The HRSTEM usually require the "use FFT" switch ON while the images with no atomic structure should be processed with this switch OFF. For better results, use the manual setting of the corresponding points via button "STICK".

Notes about specific learning examples:  

→ "cube drift left-down/left-up/right-down original/rotated.dm3" files require correction with the "use FFT" switch OFF. The message "drift is unusually high" can appear. Just ignore it; these images were intentionally acquired under the situation of extremen drift.

→ "lattice drift left-down/right-down/right-up original/rotated.dm3" files require correction with the "use FFT" switch ON. The message "drift is unusually high" can eventually appear

→  "interface original/rotated" require correction with the "use FFT" switch ON. Note the clear sealing of the shear distortion in the upper phase after the non-linear correction.

→ "sumulated original/rotated.npy" files require correction with the "use FFT" switch ON. Here, the linear shift of 16 pixels in the x-direction and eventual in-frame distortions of 5 pixels were synthetically induced. The correction deforms the images towards the undistorted ones, however, 
as in real cases, not ideally. This example allows to evaluate the accuracy of correction. Maybe, with further development of the algorithms, it become even better. 

→ "rotated series" folder with 8 original/rotated pairs can be loaded by by pressing the "S" (Series) knobs in between the frames. You can scroll among pairs and correct each of them till the required state. It is possible to store the series as one file (press "Store" know in the left-down panel). I can open the series later and continue the correction or export the desired images in to other formats.  All images require correction with the "use FFT" switch ON.


The success of the non-linear correction is not guaranteed as distortions can be wild. We are continuously working on it. If your images show unappropriated results, we would greatly appreciate sharing data with us to improve our algorithms. 