Due to an unknown microscope instability, the individual lines in the STEM image are shifted by some pixels against each other. Is there any program being able to just correct for these shifts?
that looks pretty awkward. To my mind that does not look like a repeating deterministic shift pattern for the individual image rows.
Please see the attached pictures with two detail areas of your image. I am not able to identify a repeating shift pattern for the rows in these images. I might be wrong, cant recognize it, or maybe the shift is arbitrarily, but I am not sure if you can just "automatically correct these shifts".
Well, of course you could just blur the image, but I doubt thats what you are looking for ...
If the image you posted is the "raw result image" from the device, in my opinion it looks more like something sensor related: maybe the sensor is skipping rows during acquisition, maybe an error in sensor-internal data (pre)processing, maybe misconfigured sensor parameters, or the device might need (re)calibration ... maybe something completely different.
I would suggest to focus troubleshooting on the sensor first, instead of looking for a solution how to fix the resulting images. If that does not solve the problem, it may be helpful to do consecutive scans of reference sample / pattern to further explore the shift.