Probing the internal structure of nanowires