Nanostructured magnetic materials