Controlled deposition of carbon nanotubes on a patterned substrate