Nonperturbative modal tomography inversion. Part I. Theory