Convertion from DICOM to Nifti for multiple dicom series

Hi all, I’m trying to perform the DICOM to NIFTI conversion using 3DSlicer for multiple dicom series. I wonder if there is a way to exploit 3DSlicer converter to perform in a more automatic way this conversion. For example if there is a built-in funcion of the slicer package or an API call that can perform the same conversion I obtained by right clicking on the dicom data and export it as a nii.gz file. Thank you for your attention.