Corrects misalignment of forward/backward scanned lines in images collected using resonant-scanning microscopes.