One option is to use 3D Slicer.You get a full featured medical image viewer (including DICOM import/ export, automatic segmentation, registration, measurements, etc.) implemented in VTK, and it also provides a full Python evironment where you can run your Python code, pip install packages, etc.