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

Dear experts

I segmented the human Brain with the editor modules for 100 slices of CT images, manually, now, I need to extract the number of voxels for each color with python or …, how can I do that?
Thanks

Are you interested in the volume of a segment?

Dear Andras,
I exactly need to know the number of voxels(row and column) of each color(segmented parts in each slice), because, I used these CTs as geometry and I have the distributed energy in each voxel of each slice in a text file. Now,I want to calculate the energy distributed in each part.

Have you tried Segment Statistics already? It returns a lot of information including number of voxels of each segment in a segmentation. You can find it under “Quantification” and all you have to do is select which volume you are working on and which segmentation and it will produce a table with the results.

1 Like

If you can save this information in nrrd file format (a plain binary volume and a text file that describes size, position, spacing, etc.) then you can nicely visualize it in Slicer and if you set that as input for Segment Statistics module then you’ll get statistics, such as mean/max/average energy per segment.

1 Like

Thanks for your help and sorry for the late reply,
but the “Quantification” just gave me the volume of that segment, not the number of voxels !!! which one should I use? segment statistic?

Thanks for your help,
yes, I save these segments in .nrrd file format, and I converted these binary files as .png file with python, but i could not get good result, is there another way to analyze these data which can find the number of voxels for each segment in each slice?

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