<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">I have confirmed this bug and entered it into <a href="https://issues.itk.org/jira/browse/ITK-3407">tracker</a> along with a DICOM series which reproduces it.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Thanks Shen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 8:41 PM, 沈庄明 <span dir="ltr"><<a href="mailto:zhuangming.shen@sphic.org.cn" target="_blank">zhuangming.shen@sphic.org.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi all,<br>
</p>
<p><br>
</p>
<p>I met a very strange situation when I used ITK 4.8.1. I'd like to read a DICOM series, write it to a DICOM file (i.e. save the volume created by the DICOM series to a .dcm file), and read the DICOM file. Theoretically, the DICOM series and the DCM file should
have the same information, e.g origin, spacing, size. However, My results show me that the information has been changed. When I use other ITK-support file format (e.g. nii, nrrd), the information has not been changed. It seems a bug. <span style="font-size:12pt">My
</span><span style="font-size:12pt">code and results</span><span style="font-size:12pt"> </span><span style="font-size:12pt">are listed</span><span style="font-size:12pt"> as below. Has anyone met the same situation?</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Regards,</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Zhuangming Shen</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><br>
</p>
<p>================ My code =================<br>
</p>
<p><br>
</p>
<div>import itk</div>
<div><br>
</div>
<div>input_dir = "/home/zshen/workspace/Data/testDCM/bbb"</div>
<div>output_filename = "/home/zshen/workspace/Data/bbb2.dcm"</div>
<div><br>
</div>
<div># read DICOM series</div>
<div>dicom_io = itk.GDCMImageIO.New()</div>
<div><br>
</div>
<div>reader = itk.ImageSeriesReader[itk.Image.SS3].New()</div>
<div>reader.SetImageIO(dicom_io)</div>
<div><br>
</div>
<div>name_generator = itk.GDCMSeriesFileNames.New()</div>
<div>name_generator.SetUseSeriesDetails(True)</div>
<div>name_generator.SetDirectory(input_dir)</div>
<div><br>
</div>
<div>series_uid = name_generator.GetSeriesUIDs()</div>
<div><br>
</div>
<div>series_identifier = series_uid[0]</div>
<div><br>
</div>
<div>file_names = name_generator.GetFileNames(series_identifier)</div>
<div><br>
</div>
<div>reader.SetFileNames(file_names)</div>
<div>reader.Update()</div>
<div><br>
</div>
<div>print("**** series DICOM information: *****")</div>
<div>print("size: "+str(reader.GetOutput().GetLargestPossibleRegion().GetSize()))</div>
<div>print("origin: "+str(reader.GetOutput().GetOrigin()))</div>
<div>print("spacing: "+str(reader.GetOutput().GetSpacing()))</div>
<div><br>
</div>
<div>writer = itk.ImageFileWriter[itk.Image.SS3].New()<br>
</div>
<div>writer.SetInput(reader.GetOutput())</div>
<div>writer.SetFileName(output_filename)</div>
<div>writer.Update()</div>
<div><br>
</div>
<div># read again</div>
<div>reader2 = itk.ImageFileReader[itk.Image.SS3].New()</div>
<div>reader2.SetFileName(output_filename)</div>
<div>reader2.Update()</div>
<div><br>
</div>
<div>print("**** DICOM information: *****")</div>
<div>print("size: "+str(reader2.GetOutput().GetLargestPossibleRegion().GetSize()))</div>
<div>print("origin: "+str(reader2.GetOutput().GetOrigin()))</div>
<div>print("spacing: "+str(reader2.GetOutput().GetSpacing()))<br>
</div>
<p><br>
</p>
<p>================= My results ====================<br>
</p>
<div>**** series DICOM information: *****</div>
<div>size: itkSize3 ([512, 512, 118])</div>
<div>origin: itkPointD3 ([-229.5, -96.5, -553])</div>
<div>spacing: itkVectorD3 ([0.896484, 0.896484, 3])</div>
<div>**** DICOM information: *****</div>
<div>size: itkSize3 ([512, 512, 118])</div>
<div>origin: itkPointD3 ([0, 0, 0])</div>
<div>spacing: itkVectorD3 ([0.896484, 0.896484, 1])</div>
<div><br>
</div>
<p><br>
</p>
<p><br>
</p>
</div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>