<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,&nbsp;<div class="">I 'm getting an error &nbsp;trying to write an image with pixel type double to a dicom series.</div><div class=""><div style="margin: 0px; "><br></div></div><div class="">In Mac OS X 10.8.3 with Xcode 4.62 the program runs but the resulting image is "reflected". See the attached image for an example.</div><div class=""><br></div><div class=""><img height="224" width="425" apple-width="yes" apple-height="yes" id="8d6b1440-522f-446b-83be-c3531e3bb3a9" src="cid:E86267B5-1438-4927-86A0-6B6D625B1D6F@unibe.ch"></div><div class=""><br></div><div class="">In windows 7 with Visual Studio, I get an access violation in gdcmRescaler.cxx line 107 or an assert in line 929 of itkGDCMImageIO.cxx, depending on the input image file.&nbsp;</div><div class=""><br></div><div class="">In both environments I am using ITK 4.3.1. Below you can find an excerpt from my code.&nbsp;</div><div class=""><br></div><div class="">The reason for using double is because I&nbsp;am trying to crop a Dicom series maintaining most of the original metadata. The problem is that&nbsp; the resulting Dicom series had always rescaleslope=1, even if the original rescale slope is 0.6 (0028,1052). From the code in itkGDCMImageIO.cxx seems that the rescale is considered only when the pixel type is FLOAT32&nbsp;or FLOAT34 (ln 890 and ln 927).&nbsp;</div><div class="">Do you know how can I resolve this issue?&nbsp;</div><div class=""><br></div><div class="">Thanks&nbsp;</div><div class="">Best regards</div><div class="">Livia Barazzetti&nbsp;</div><div class=""><br></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkVersion.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkImage.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkGDCMImageIO.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkGDCMSeriesFileNames.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkImageSeriesReader.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>"itkImageSeriesWriter.h"</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(120, 73, 42); ">#include&nbsp;</span>&lt;itksys/SystemTools.hxx&gt;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); ">#include&nbsp;<span style="color: rgb(209, 47, 27); ">&lt;string&gt;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="color: rgb(187, 44, 162); ">int</span>&nbsp;main(&nbsp;<span style="color: rgb(187, 44, 162); ">int</span>&nbsp;argc,&nbsp;<span style="color: rgb(187, 44, 162); ">char</span>* argv[] )</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">{</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">const</span>&nbsp;<span style="color: rgb(187, 44, 162); ">unsigned</span>&nbsp;<span style="color: rgb(187, 44, 162); ">int</span>&nbsp;InputDimension =&nbsp;<span style="color: rgb(39, 42, 216); ">3</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">const</span>&nbsp;<span style="color: rgb(187, 44, 162); ">unsigned</span>&nbsp;<span style="color: rgb(187, 44, 162); ">int</span>&nbsp;OutputDimension =&nbsp;<span style="color: rgb(39, 42, 216); ">2</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">typedef</span>&nbsp;<span style="color: rgb(187, 44, 162); ">double</span>&nbsp;PixelType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//typedef signed short PixelType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">typedef</span>&nbsp;<span style="color: rgb(112, 61, 170); ">itk</span>::<span style="color: rgb(112, 61, 170); ">Image</span>&lt;&nbsp;<span style="color: rgb(79, 129, 135); ">PixelType</span>, InputDimension &gt;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; InputImageType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">typedef</span>&nbsp;<span style="color: rgb(112, 61, 170); ">itk</span>::<span style="color: rgb(112, 61, 170); ">Image</span>&lt;&nbsp;<span style="color: rgb(79, 129, 135); ">PixelType</span>, OutputDimension &gt;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; OutputImageType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">typedef</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>itk<span style="color: rgb(0, 0, 0); ">::</span>ImageSeriesReader<span style="color: rgb(0, 0, 0); ">&lt;&nbsp;</span><span style="color: rgb(79, 129, 135); ">InputImageType</span><span style="color: rgb(0, 0, 0); ">&nbsp;&gt;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; ReaderType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">typedef</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>itk<span style="color: rgb(0, 0, 0); ">::</span>GDCMImageIO</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; ImageIOType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">typedef</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>itk<span style="color: rgb(0, 0, 0); ">::</span>GDCMSeriesFileNames</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; NamesGeneratorType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">typedef</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span><span style="color: rgb(112, 61, 170); ">itk</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">ImageSeriesWriter</span><span style="color: rgb(0, 0, 0); ">&lt;&nbsp;</span>InputImageType<span style="color: rgb(0, 0, 0); ">,&nbsp;</span>OutputImageType<span style="color: rgb(0, 0, 0); ">&nbsp;&gt;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; SeriesWriterType;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">if</span>( argc &lt;&nbsp;<span style="color: rgb(39, 42, 216); ">3</span>&nbsp; )&nbsp;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(112, 61, 170); ">cerr</span>&nbsp;&lt;&lt;&nbsp;<span style="color: rgb(209, 47, 27); ">"Usage: "</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt; argv[<span style="color: rgb(39, 42, 216); ">0</span>]</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt;&nbsp;</span>" InputDicomDirectory "</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt;&nbsp;</span>" OutputDicomDirectory "</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(61, 29, 129); ">endl</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">return</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>EXIT_FAILURE<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(112, 61, 170); ">string</span>&nbsp;inputDir = argv[<span style="color: rgb(39, 42, 216); ">1</span>];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(112, 61, 170); ">string</span>&nbsp;outputDir= argv[<span style="color: rgb(39, 42, 216); ">2</span>];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>////////////////////////////////////////////////</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>// Read the input series</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>InputImageType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">Pointer</span><span style="color: rgb(0, 0, 0); ">&nbsp;image =&nbsp;</span>InputImageType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">New</span><span style="color: rgb(0, 0, 0); ">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>ImageIOType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">Pointer</span><span style="color: rgb(0, 0, 0); ">&nbsp;gdcmIO =&nbsp;</span>ImageIOType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">New</span><span style="color: rgb(0, 0, 0); ">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>NamesGeneratorType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">Pointer</span><span style="color: rgb(0, 0, 0); ">&nbsp;namesGenerator =&nbsp;</span>NamesGeneratorType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">New</span><span style="color: rgb(0, 0, 0); ">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; namesGenerator-&gt;<span style="color: rgb(61, 29, 129); ">SetInputDirectory</span>( inputDir.<span style="color: rgb(61, 29, 129); ">c_str</span>() );</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(79, 129, 135); ">ReaderType</span>::<span style="color: rgb(112, 61, 170); ">Pointer</span>&nbsp;reader =&nbsp;<span style="color: rgb(79, 129, 135); ">ReaderType</span>::<span style="color: rgb(61, 29, 129); ">New</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; reader-&gt;<span style="color: rgb(61, 29, 129); ">SetImageIO</span>(&nbsp;<span style="color: rgb(61, 29, 129); ">gdcmIO</span>&nbsp;);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; reader-&gt;<span style="color: rgb(61, 29, 129); ">SetFileNames</span>( namesGenerator-&gt;<span style="color: rgb(61, 29, 129); ">GetInputFileNames</span>());</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">try</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; reader-&gt;<span style="color: rgb(61, 29, 129); ">Update</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">catch</span><span style="color: rgb(0, 0, 0); ">&nbsp;(</span>itk<span style="color: rgb(0, 0, 0); ">::</span>ExceptionObject<span style="color: rgb(0, 0, 0); ">&nbsp;&amp;excp)</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">cerr</span><span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span>"Exception thrown while reading the series"<span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">endl</span><span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(112, 61, 170); ">cerr</span>&nbsp;&lt;&lt; excp &lt;&lt;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(61, 29, 129); ">endl</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">return</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>EXIT_FAILURE<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; image = reader-&gt;<span style="color: rgb(61, 29, 129); ">GetOutput</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(209, 47, 27); ">&nbsp; &nbsp;&nbsp;</span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>///////////////////////////////////////////////</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//&nbsp; Apply the ROIFilter</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//....</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>///////////////////////////////////////////////</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//&nbsp; Create a MetaDataDictionary for each slice.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//...</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>// Write the new DICOM series</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">cout</span><span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span>"Writing the new DICOM series "<span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">endl</span><span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">itksys</span>::<span style="color: rgb(112, 61, 170); ">SystemTools</span>::<span style="color: rgb(61, 29, 129); ">MakeDirectory</span>( outputDir.<span style="color: rgb(61, 29, 129); ">c_str</span>() );</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; namesGenerator-&gt;<span style="color: rgb(61, 29, 129); ">SetOutputDirectory</span>( outputDir.<span style="color: rgb(61, 29, 129); ">c_str</span>() );</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(79, 129, 135); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>SeriesWriterType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">Pointer</span><span style="color: rgb(0, 0, 0); ">&nbsp;seriesWriter =&nbsp;</span>SeriesWriterType<span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">New</span><span style="color: rgb(0, 0, 0); ">();</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; seriesWriter-&gt;<span style="color: rgb(61, 29, 129); ">SetInput</span>(<span style="color: rgb(61, 29, 129); ">image</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; seriesWriter-&gt;<span style="color: rgb(61, 29, 129); ">SetImageIO</span>(&nbsp;<span style="color: rgb(61, 29, 129); ">gdcmIO</span>&nbsp;);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; seriesWriter-&gt;<span style="color: rgb(61, 29, 129); ">SetFileNames</span>(namesGenerator-&gt;<span style="color: rgb(61, 29, 129); ">GetOutputFileNames</span>()) ;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span>//seriesWriter-&gt;SetMetaDataDictionaryArray( &amp;outputArray );&nbsp; //omitted in this example</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp;&nbsp;<span style="color: rgb(187, 44, 162); ">try</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp; seriesWriter-&gt;<span style="color: rgb(61, 29, 129); ">Update</span>();</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(112, 61, 170); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">catch</span><span style="color: rgb(0, 0, 0); ">(&nbsp;</span>itk<span style="color: rgb(0, 0, 0); ">::</span>ExceptionObject<span style="color: rgb(0, 0, 0); ">&nbsp;&amp; excp )</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(112, 61, 170); ">cerr</span><span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span>"Exception thrown while writing the series "<span style="color: rgb(0, 0, 0); ">&nbsp;&lt;&lt;&nbsp;</span><span style="color: rgb(112, 61, 170); ">std</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(61, 29, 129); ">endl</span><span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(112, 61, 170); ">cerr</span>&nbsp;&lt;&lt; excp &lt;&lt;&nbsp;<span style="color: rgb(112, 61, 170); ">std</span>::<span style="color: rgb(61, 29, 129); ">endl</span>;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">return</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>EXIT_FAILURE<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; ">&nbsp;&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(120, 73, 42); "><span style="color: rgb(0, 0, 0); ">&nbsp; &nbsp;&nbsp;</span><span style="color: rgb(187, 44, 162); ">return</span><span style="color: rgb(0, 0, 0); ">&nbsp;</span>EXIT_SUCCESS<span style="color: rgb(0, 0, 0); ">;</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">}</div><div><br></div></div></body></html>