Correction to: Nature Methods https://doi.org/10.1038/s41592-020-0882-0, published online 3 August 2020.

In the version of this article initially published online, the gray wavefronts representing acoustic resonance were missing from the right panel of Fig. 1a, and an extra letter A was present to the left of the L2 larva in Fig. 2h. The errors have been corrected in the print, PDF and HTML versions of the article.

Fig. 1
figure 1

Original and corrected.