We have fabricated by e-beam lithography periodic arrays of rectangular shaped trenches of different widths into Si substrates. The trenches were filled with iron oxide nanoparticles, 20 nm in diameter, by spin-coating them onto the Si substrate. The trenches have the purpose to assist the self-assembly of the iron oxide nanoparticles. Using x-ray scattering techniques, we have analyzed the structure factor of the trenches before and after filling in order to determine the filling factor. We present a theoretical analysis of the x-ray scattering function within the distorted-wave Born approximation and we present a quantitative comparison between theory and experiment. © 2014 AIP Publishing LLC.