Removal of threading dislocations from patterned heteroepitaxial semiconductors by glide to sidewalls