I noticed that If I comment out line:<div><div>  seriesWriter-&gt;SetMetaDataDictionaryArray(</div><div>                        reader-&gt;GetMetaDataDictionaryArray() )</div><div><span style="font-family:Calibri,sans-serif;font-size:14px"><br>
</span></div><div><span style="font-family:Calibri,sans-serif;font-size:14px">,values in tag &quot;ImagePositionPatient&quot; were restored correctly</span></div><div><span style="font-family:Calibri,sans-serif;font-size:14px">but &quot;ImageOrientationPatient&quot; was still wrong.</span></div>
<div><span style="font-family:Calibri,sans-serif;font-size:14px"> </span></div><div><span style="font-family:Calibri,sans-serif;font-size:14px">I also tried using the following code to restore tag &quot;</span><span style="font-family:Calibri,sans-serif;font-size:14px">ImageOrientationPatient&quot;, but not working....</span></div>
<div><span style="font-family:Calibri,sans-serif;font-size:14px">the values were still saved as: </span><span style="font-family:Calibri,sans-serif;font-size:14px"> </span><span style="font-family:Calibri,sans-serif;font-size:14px">[1\0\0\0\1\0]</span></div>
<div><div><font face="Calibri, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="Calibri, sans-serif"><span style="font-size:14px">typedef itk::MetaDataDictionary   DictionaryType;</span></font></div>
<div><font face="Calibri, sans-serif"><span style="font-size:14px">DictionaryType::ConstIterator tagItr = dict.Find(&quot;0020|0037&quot;);</span></font></div><div><br></div><div><font face="Calibri, sans-serif"><span style="font-size:14px">typedef itk::MetaDataObject&lt; std::string &gt; MetaDataStringType;</span></font></div>
<div><span style="font-size:14px;font-family:Calibri,sans-serif">MetaDataStringType::ConstPointer entryvalue = dynamic_cast&lt;const MetaDataStringType *&gt;( tagItr-&gt;second.GetPointer() );</span></div><div><font face="Calibri, sans-serif"><span style="font-size:14px"><br>
</span></font></div><div><span style="font-size:14px;font-family:Calibri,sans-serif">std::string tagvalue = entryvalue-&gt;GetMetaDataObjectValue();</span></div><div><font face="Calibri, sans-serif"><span style="font-size:14px">itk::EncapsulateMetaData&lt;std::string&gt;(dict, &quot;0020|0037&quot;, tagvalue );</span></font></div>
</div><div><br></div><div>Any further comments will be greatly appreciated !!</div><div><br></div><div>YIYU</div><div><br></div><br><div class="gmail_quote">On Thu, Aug 16, 2012 at 12:11 PM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">This sounds like the following unresolved issue:<div><br></div><div><a href="https://issues.itk.org/jira/browse/ITK-281" target="_blank">https://issues.itk.org/jira/browse/ITK-281</a></div>
<div><br></div><div>Brad</div><div><div><div class="h5"><br><div><div>On Aug 16, 2012, at 12:04 PM, Johnson, Hans J wrote:</div><br><blockquote type="cite">



<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>
<div>
<div>Are you reading into a 2D image?  A 2D image only stores 2D origin, spacing, etc.</div>
<div><br>
</div>
<div>If you want to preserve the 3rd dimension, you will have to read a single slice into a 3D image.</div>
<div><br>
</div>
<div>I am just guessing that this might be the problem.</div>
<div>
<div>
<div><br>
</div>
<div>Hans</div>
<div>-- </div>
<div>
<div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt">Hans J. Johnson, Ph.D.</span></font></div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt"><a href="mailto:hans-johnson@uiowa.edu" target="_blank">hans-johnson@uiowa.edu</a></span></font></div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt">Assistant Professor of Psychiatry</span></font></div>
<div style="font-family:Calibri;font-size:15px"><span style="font-size:13px;font-family:Arial">University of Iowa Carver College of Medicine</span></div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt"><span style="font-family:Calibri;font-size:15px">
<div><span style="font-size:13px;font-family:Arial">W278 GH, 200 Hawkins Drive</span></div>
</span></span></font></div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt">Iowa City, Iowa 52242</span></font></div>
<div style="font-family:Calibri;font-size:15px"><font face="Arial"><span style="font-size:10pt">Phone:  <a href="tel:319-353-8587" value="+13193538587" target="_blank">319-353-8587</a></span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span>
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">

<span style="font-weight:bold">From: </span>Yi-Yu Chou &lt;<a href="mailto:yiyu.chou@gmail.com" target="_blank">yiyu.chou@gmail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Thursday, August 16, 2012 10:54 AM<br>
<span style="font-weight:bold">To: </span>Xiaofeng Z &lt;<a href="mailto:xf10036@outlook.com" target="_blank">xf10036@outlook.com</a>&gt;<br>
<span style="font-weight:bold">Cc: </span>ITK Users &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>Re: [Insight-users] Bug in DicomSeriesReadSeriesWrite ??<br>
</div>
<div><br>
</div>
<div>
<div>yes. I tried on 2 different datasets, and I got same issues...<br>
<br>
<div class="gmail_quote">On Thu, Aug 16, 2012 at 11:45 AM, Xiaofeng Z <span dir="ltr">
&lt;<a href="mailto:xf10036@outlook.com" target="_blank">xf10036@outlook.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" type="cite">
<div>
<div dir="ltr">REALLY?<br>
<br>
<br>
<br>
<div>
<div></div>
<hr>
Date: Thu, 16 Aug 2012 10:40:26 -0400<br>
From: <a href="mailto:yiyu.chou@gmail.com" target="_blank">yiyu.chou@gmail.com</a><br>
To: <a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a><br>
Subject: [Insight-users] Bug in DicomSeriesReadSeriesWrite ??
<div>
<div><br>
<br>
<div>Dear ITK users,</div>
<div> </div>
<div>I&#39;m playing with DicomSeriesReadSeriesWrite, but I noticed that values in tags
<br>
&quot;ImagePositionPatient&quot; and &quot;ImageOrientationPatient&quot; were not restored correctly.</div>
should be:<br>
(0020,0032) DS [112.81570415012\-115.84296800997\110.38483167658] <br>
(0020,0037) DS [-0.0484719045791\0.99882454638764\2.34458564e-008\-0.1526400678013...<br>
<div>but I got:<br>
(0020,0032) DS [112.81570415012\-115.84296800997\0]    &lt;-- z-value is 0 for all slices<br>
(0020,0037) DS [1\0\0\0\1\0] </div>
<div> </div>
<div>Is it a bug in DICOM IO ?<br>
Any suggestions would be greatly appreciated !!!</div>
Thanks in advance.<br>
YIYU<br>
ps. I&#39;m running itk4.2<br>
<br>
</div>
</div>
_____________________________________ Powered by <a href="http://www.kitware.com/" target="_blank">
www.kitware.com</a> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a> Kitware offers ITK Training Courses, for more information visit:
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a> Please keep messages on-topic and check the ITK FAQ at:
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a> Follow this link to subscribe/unsubscribe:
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</span><br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any
 retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
<hr>
</div>

_____________________________________<br>Powered by <a href="http://www.kitware.com" 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" 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" 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" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div></div><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">========================================================</font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Bradley Lowekamp<span> </span><span> </span></font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Medical Science and Computing for</font></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">Office of High Performance Computing and Communications</font></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica">National Library of Medicine<span> </span></font></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<font face="Helvetica" size="3" style="font:normal normal normal 12px/normal Helvetica"><a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a></font></p><br></span></div></span></span><br>
</div>
<br></div></div></blockquote></div><br></div>