Nanoparticle assembly into a patterned template by controlling the surface wettability