Utility using GDCM to extract images from DICOM files in Python