A procedure is presented for image correction of scanning probe microscopy data that is distorted by linear thermal drift. The procedure is based on common ideas for drift correction, which the authors combine to a comprehensive step-by-step description of how to measure drift velocities in all three dimensions and how to correct the images using these velocities. The presented method does not require any knowledge about size or shape of the imaged structures. Thus, it is applicable to any type of scanning probe microscopy image, including images lacking periodic structures. Besides providing a simple, ready-to-use description of lateral and vertical drift correction, they derive all formulas needed from the model of linear drift. (C) 2010 American Vacuum Society. [DOI: 10.1116/1.3360909]