Electrodeposition of patterned magnetic nanostructures