Pattern formation and localized structures in spatially extended photonic systems