1. A computerized method for orienting an image of a device under test (DUT) using a computing system, comprising: obtaining an optical image of the DUT from an optical system; obtaining a computer aided design (CAD) data having CAD layers of the DUT; constructing a CAD image of the DUT by overlaying the CAD layers; operating on the CAD image to generate a synthetic image simulating an optical image of the DUT; generating a difference image by comparing the optical image to the synthetic image; varying parameters of the synthetic image so as to minimize the difference image.