An application of box counting method for measuring phase fraction