Optical path control of solitary waves in dye-doped nematic liquid crystals