Large commit: Comments correctly doxygen formatted.  Bug fix for complex pattern generation. Can now save two kind of patterns also, layered and slice selection