[ITK] Problem with Writing Dicom Series

Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] zivrafael.yaniv at nih.gov
Wed Jun 21 10:41:05 EDT 2017


Hello Sara,

Please take a look at this example on readthedocs (part of the Examples found in the SimpleITK source):
http://simpleitk.readthedocs.io/en/latest/Examples/DicomSeriesReadModifyWrite/Documentation.html

Writing a valid DICOM series which contains all of the tag information you need may be tricky, depending on the information you need to encode in the meta-data dictionary (private tags etc.).

As a side note, the problem you have with the series writer is that it is writing each of the images into its own series.

      hope this helps
              Ziv

From: Sara Gh <sg.ele.eng at gmail.com>
Date: Wednesday, June 21, 2017 at 10:19 AM
To: "community at itk.org" <community at itk.org>
Subject: [ITK] Problem with Writing Dicom Series

Hello,

I have a question regarding writing Dicom series using SimpleITK in Python. I read a 3D scan, resampled it, and stored it as a Dicom series. However, when I try to read the stored data, I am unable to load the whole 3D images and it only displays one of the slices. It seems that the header is corrupted. I would be thankful if someone could help me to fix this issue.

Here is my write method:

def WriteDicomSeries(imagein,outDir):
    writer = sitk.ImageSeriesWriter()
    filenames = [ outDir+'MR_{0:04}.dcm'.format(i) for i in range(imagein.GetSize()[2])]
    writer.SetFileNames(filenames)
    writer.Execute(imagein)

Thanks,
Sara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170621/ed1aa53c/attachment-0001.html>


More information about the Community mailing list