<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Shen,</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">GDCM version was updated recently. It now complains that short type is unsupported, and works correctly with char type. I attached an example which rescales the intensity and works correctly.</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">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 3:17 AM, 沈庄明 <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 <span style="font-family:Calibri,sans-serif;font-size:15px;background-color:rgb(255,255,255)">
Dženan</span>,<br>
</p>
<p><br>
</p>
<p>I'd like to know if the <a href="https://issues.itk.org/jira/browse/ITK-3407" target="_blank">bug</a><a href="https://issues.itk.org/jira/browse/ITK-3407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel" target="_blank"></a> regarding 3D DICOM writer has been fixed. When
I tried to run the same code but using ITK 4.9.1, I still got the same results, i.e. the output DICOM file does not properly record original image's origin and spacing. <br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Regards,<br>
</p>
<p><br>
</p>
<p>Zhuangming Shen<br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Dženan Zukić <<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>><br>
<b>Sent:</b> Saturday, December 26, 2015 1:44 AM<br>
<b>To:</b> 沈庄明<br>
<b>Cc:</b> <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
<b>Subject:</b> Re: [ITK-users] Strange situation when ITK writes DICOM file</font>
<div> </div>
</div><div><div class="h5">
<div>
<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" target="_blank">
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()<br>
</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>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>