Statistics for Templated Synthesis of Magnetic Nanoparticles through the Self-Assembly of Polymers and Surfactants