This is a very simple utility to convert any structures found in a DICOM-RT data set to individual PLY files for subsequent surface meshing. This will dump a bunch of PLY files into the current directory:
python dicom2ply.py dicom_dir output_dir
Originally this code was written to quickly calculate descriptive statistics for each structure; some of this information is included in the PLY header.
The saved point clouds can be quite dense, so in some instances it is best to reduce the number of total points prior to meshing. Have a look at MeshLab for meshing and mesh refinement.
- pydicom
- Python Imaging Library
- numpy, scipy, pylab
- convert into a proper Python module
- tidy up the statistics calculations
- remove hard coding of CT data file suffixes and prefixes