 X-ray computed tomography, CT, is a widely used technique for studying the internal structure of foam concrete, as its quality is dependent on the uniformity of its porosity within local volumes, LV. This paper proposes an algorithm designed in MathCAD to analyze the data collected from CT scans of foam concrete samples, allowing for the estimation of the distribution of mean values and standard deviations of porosity across different LVs. The results demonstrate that foam concrete with thermally modified PET, TMP, exhibits higher quality than conventional foam concrete, suggesting that the algorithm could be used to improve the technology for producing high-quality foam concretes and other porous materials. This article was authored by Sergey Osipov and Inga Praskepa.