virtual microscopy and other system may benefit from a system that can build the large mosaic by stitching images , and overcoming positioning error of stages used to provide the images . in particular , these systems may benefit from scan order optimization and virtual slide stitching techniques . a method can include analyzing , by a machine , a low resolution image of a sample . the method can also include determining , by the machine , a scan pattern for the sample based on analysis of the low resolution image of the sample . the method can further include controlling , by the machine , the scan based on the scan pattern , wherein the scan pattern is configured to minimize an amount of back - stitching of scans in the scan pattern .