<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">From: Jim Qicun Shi<br class=""><br class="">Hi Todd,<br class=""><br class="">Thanks for the reply. m_spacing[2] or m_spacing[0] (x dimension), m_spacing[1] (y), m_spacing[2] (z) are parameters from 0028|0030 (x, y) and 0018|0050 (z). But my question is how to re-set 0018|0088.<br class=""><br class="">Best wishes,<br class=""><br class="">Jim</div></blockquote><br class=""></div><div>Using GDCM 2.4.x with ITK 4.7.x or ITK 3.20.1, the following works for outputting the value I set for spacing between slices:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">itk</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span>MetaDataDictionary<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">outMetaData</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">;</span></div></div><div> :</div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class="">itk<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::EncapsulateMetaData< </span><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">vcl_string</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> >( </span>outMetaData<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span>“0018|0088"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">, </span>“5.0"<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> );</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> :</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><div style="margin: 0px;" class="">itk::GDCMImageIO<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Pointer</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> dicomIO = </span>itk::GDCMImageIO<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">::</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">New</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">();</span><span class="Apple-tab-span" style="white-space: pre;"> </span></div><div style="margin: 0px; color: rgb(120, 73, 42);" class=""><span style="color: rgb(187, 44, 162);" class="">typedef</span><span style="color: rgb(79, 129, 135);" class=""> </span><span style="color: rgb(79, 129, 135);" class="">itk</span><span style="color: rgb(79, 129, 135);" class="">::</span><span style="color: rgb(112, 61, 170);" class="">ImageFileWriter</span><span style="color: rgb(79, 129, 135);" class="">< TExportImageType > WriterType;</span></div><div style="margin: 0px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typename</span> WriterType::<span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Pointer</span> dcmWriter = WriterType::<span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">New</span>();</div><div style="margin: 0px;" class="">outputImage<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">-></span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetMetaDataDictionary</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">( </span>outMetaData<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> );</span></div><div style="margin: 0px;" class="">dcmWriter-><span style="color: rgb(61, 29, 129);" class="">SetFileName</span>( outputFile.<span style="color: rgb(61, 29, 129);" class="">str</span>() );</div><div style="margin: 0px;" class="">dcmWriter-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetInput</span>( outputImage );</div><div style="margin: 0px;" class="">dcmWriter-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">SetImageIO</span>( dicomIO );</div><div style="margin: 0px;" class="">dcmWriter-><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">Update</span>();</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><br class=""></span></div></div><div><br class=""></div><div><br class=""></div></body></html>