Wavefront correction performed by a deformable mirror of arbitrary actuator pattern within a multireflection waveguide.