Complexity of patterns: cellular automata