How to overlay a DICOM volume on a nii.gz segmentation image for editing in segment editor?

Operating system: MAC
Slicer version: 4.81.

I want to edit my segmentation which is saved as nii.gz on basis of a dicom file.
How I can modify the dicim and the nii.gz to edit the segmentation?
Thanks for your help.

Load the DICOM volume using Slicer’s DICOM module. Load the nii.gz file using Add data function - and in the Add data dialog, click Show Options, scroll to the right, and make sure that LabelMap checkbox is selected.

Hi @lassoan. I want to achieve the same result but using python script. Can you please give me idea or example code to achieve that. I used pydicom to load dcm series and nibabel module to read nii.gz file.

Thank you in advance :slight_smile:

See examples in the script repository:

Thank you @lassoan. But When 3D slicer overlay nifti file over .dcm files, does it convert dicom series to nifti ? Otherwise how does the overlay transformation happens? can you please explain the principal/way this nifti on dicom series overlay ?

Slicer can load images from a wide variety of file formats, including DICOM, nifti, nrrd, metaimage. Once an image is loaded, it can be displayed in slice viewer layers. Images can be saved in any file format, regardless of what format they were loaded from.