A study of fundamentals in emulsion templating for the preparation of macroporous polymer foams