Applying AFM-based nanofabrication for measuring the thickness of nanopatterns: the role of head groups in the vertical self-assembly of omega-functionalized n-alkanethiols.