1

I have a a sereies of Dicom images for each patient and I would like to stack them and save them as one Volumetric Dicom image, Any idea of how to do that?

from glob import glob
import dcmstack
import dicom

src_paths = glob('...../*.dcm')
my_stack = dcmstack.DicomStack()
for src_path in src_paths:
    src_dcm = dicom.read_file(src_path)
    my_stack.add_dcm(src_dcm)
 # but did not how to save the stacked image somewhere in my desktop. 
desertnaut
  • 57,590
  • 26
  • 140
  • 166
Mrmr
  • 35
  • 4
  • By "Volumetric Dicom image" do you mean a Nifti file? This is described in the [help](https://dcmstack.readthedocs.io/en/v0.6.1/Introduction.html) for dcmstack. – MrBean Bremen Mar 18 '22 at 14:22
  • No 3D image.. but in DICOM format... instead of a series of slices, I would like to stack all of them together – Mrmr Jul 03 '22 at 18:50
  • So you want to make a multi-frame DICOM from multiple single-frame DICOM files? This depends on the SOP class, but is not trivial - you have to know the DICOM standard pretty well. If you don't or don't want to invest a lot of time into this, I would not recommend it. I don't know any tools that do this, and a quick search only turned up a [project in progress](https://www.na-mic.org/wiki/Project_Week_25/Conversion_of_DICOM_Single_Frame_MR_to_Enhanced_Multiframe) for MR images. – MrBean Bremen Jul 03 '22 at 18:59

0 Answers0