How to export number of voxels for different colors in CT images after segmentation?

Segment statistics gives you the number of voxels. If you need number of voxels (cross-section area by slice) then you can find a readily usable solution here: Using numpy reslice to get slices of segment