Can you post the entire program please?<br><br><div class="gmail_quote">On Sat, Oct 6, 2012 at 9:04 PM, suicheng gu <span dir="ltr">&lt;<a href="mailto:gusuch@yahoo.com" target="_blank">gusuch@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>I used the following code to obtain the coronal view, but the orientation tag is still 1\0\0\0\1\0</span></div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><span>And one more problem is that some dcm files are with size of 0.</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span></span> </div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><span>itk::OrientImageFilter&lt;InputImageType,InputImageType&gt;::Pointer orienter
 =<br>itk::OrientImageFilter&lt;InputImageType,InputImageType&gt;::New();<br>orienter-&gt;UseImageDirectionOn();</span></div><div><span>orienter-&gt;SetDesiredCoordinateOrientationToCoronal();</span></div><div><span>orienter-&gt;SetInput(reader-&gt;GetOutput());<br>
orienter-&gt;Update();</span></div><div><br></div>  <div style="font-family:times new roman,new york,times,serif;font-size:12pt"> <div style="font-family:times new roman,new york,times,serif;font-size:12pt"> <div dir="ltr">
 <font face="Arial"><div class="im"> <div style="margin:5px 0px;padding:0px;border:1px solid rgb(204,204,204);min-height:0px;line-height:0;font-size:0px" readonly></div>  <b><span style="font-weight:bold">From:</span></b> Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;<br>
 <b><span style="font-weight:bold">To:</span></b> suicheng gu &lt;<a href="mailto:gusuch@yahoo.com" target="_blank">gusuch@yahoo.com</a>&gt; <br><b><span style="font-weight:bold">Cc:</span></b>
 &quot;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&quot; &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt; <br> </div><b><span style="font-weight:bold">Sent:</span></b> Sunday, October 7, 2012 4:33 AM<div class="im">
<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Insight-users] Unable to write dicom tag using GDCMImageIO<br> </div></font> </div> <br>
<div><div class="im">You can use itkOrientImageFilter to change the direction of the volume. Then when you write the IDCOM with itk, the direction cosines will be correct.<br><br></div><div><div class="im">On Sat, Oct 6, 2012 at 11:24 AM, suicheng gu <span dir="ltr">&lt;<a href="mailto:gusuch@yahoo.com" rel="nofollow" target="_blank">gusuch@yahoo.com</a>&gt;</span> wrote:<br>

</div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div style="font-family:times new roman,new york,times,serif;font-size:12pt">
<div class="im"><div><span>Thanks very much.</span></div>
<div style="font-size:16px;font-style:normal;background-color:transparent"><span style="background-color:transparent">what I want to do is to reconstruct the coronal and saggittal views and save them as dcm files.</span></div>

<div style="font-size:16px;font-style:normal;background-color:transparent"><span>I can manually change the direction of the volume data</span></div><div style="font-size:16px;font-style:normal;background-color:transparent">

If I can&#39;t change these tags, can I just create one dictionary? such as the example:
 ImageReadDicomSeriesWrite.cxx</div><div style="font-size:16px;font-style:normal;background-color:transparent"><br></div><div>  </div>
</div><div style="font-size:12pt"><div> </div><div style="font-size:12pt"><div class="im">
<div> <div dir="ltr"> <font face="Arial"> <div style="margin:5px 0px;padding:0px;border:1px solid rgb(204,204,204);min-height:0px;line-height:0;font-size:0px" readonly></div>  <b><span style="font-weight:bold">From:</span></b> Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" rel="nofollow" target="_blank">bill.lorensen@gmail.com</a>&gt;<br>

 <b><span style="font-weight:bold">To:</span></b> suicheng gu &lt;<a href="mailto:gusuch@yahoo.com" rel="nofollow" target="_blank">gusuch@yahoo.com</a>&gt; <br><b><span style="font-weight:bold">Cc:</span></b> &quot;<a href="mailto:insight-users@itk.org" rel="nofollow" target="_blank">insight-users@itk.org</a>&quot; &lt;<a href="mailto:insight-users@itk.org" rel="nofollow" target="_blank">insight-users@itk.org</a>&gt; <br>

 <b><span style="font-weight:bold">Sent:</span></b> Saturday, October 6, 2012 11:07 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Insight-users] Unable to write dicom tag using GDCMImageIO<br>
 </font> </div></div></div><div><div> <br>
<div><div class="im">If I recall, tags that are related to orientation and spacing cannot be changed. You must change the orientation of the data before you write the dicom file. The writer will output the proper tag that goes with the data.<br>



<br></div><div><div class="im">On Sat, Oct 6, 2012 at 5:21 AM, suicheng gu <span dir="ltr">&lt;<a href="mailto:gusuch@yahoo.com" rel="nofollow" target="_blank">gusuch@yahoo.com</a>&gt;</span> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div class="im">


<div><div style="font-size:12pt"><div>Hi,</div><div> </div><div>I was trying to chage the image orientation tag using</div><div>itk::EncapsulateMetaData&lt;std::string&gt;(dict1,&quot;0020|0037&quot;, &quot;1\\0\\0\\0\\0\\1&quot;); </div>



<div>But the image orientation was still 1\0\0\0\1\0</div><div> </div><div> </div><div> </div><div>I also tested the provided exmaple: </div><div>InsightToolkit-4.1.0\Examples\IO\DicomImageReadChangeHeaderWrite.cxx</div>


<div>
 </div><div>It works for some tags, such as the instance number:  DicomImageReadChangeHeaderWrite $infile$ $outfile$ 0020|0013 10</div><div> </div><div>But it failed on the image orientation: DicomImageReadChangeHeaderWrite $infile$ $outfile$  0020|0037 1\0\0\0\0\1 </div>



<div> </div><div> </div><div> </div><div>Anyone can help?</div><div>Thanks in
 advance.</div><span><font color="#888888"><div>Suicheng</div><div> </div></font></span></div></div><br>_____________________________________<br></div>
Powered by <a href="http://www.kitware.com/" rel="nofollow" target="_blank">http://www.kitware.com/</a><div class="im"><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>
<br></div></blockquote></div><div class="im"><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div></div><br><br> </div></div></div> </div>  </div></div></blockquote></div><div class="im"><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>
</div></div><br><br> </div> </div>  </div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>