Compress/Compact single image files .dcm into a volume.

Hi everyone, how can I create a volume compacting images .dcm after running CLI module “Create a Dicom Series” in Python?