<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;"><br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi,<div> </div><div>I have been trying to test the ResampledDICOM ITK example using DCMTK instead of GDCM. I have attached the code below. The code compiles and runs, but does not output the resultant files - which is strange, as all of the expected parameters are good (i.e. number of files, origin of image, image dimensions etc).</div><div><br></div><div>Can anyone possibly comment on any possible reason why the code execute without error, but does not result in any output files?</div><div><br></div><div>Regards, Nick</div><div><br></div><div><br></div><div><br></div><div><div style="margin: 0px;"><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkVersion.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkImage.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkMinimumMaximumImageFilter.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkDCMTKImageIO.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkDCMTKSeriesFileNames.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkNumericSeriesFileNames.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkImageSeriesReader.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkImageSeriesWriter.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkResampleImageFilter.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkShiftScaleImageFilter.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkIdentityTransform.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"itkLinearInterpolateImageFunction.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><itksys/SystemTools.hxx></span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"dcmdata/dcuid.h"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><string></span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">static</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>CopyDictionary<span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span>&fromDict,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span>&toDict);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>main(<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>argc,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">char</span>*<span style="color: rgb(192, 192, 192);"> </span>argv[]<span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;">{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Validate</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">input</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">parameters</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span>(<span style="color: rgb(192, 192, 192);"> </span>argc<span style="color: rgb(192, 192, 192);"> </span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">4</span><span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cerr<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Usage:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>argv[<span style="color: rgb(0, 0, 128);">0</span>]</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">InputDicomDirectory</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">OutputDicomDirectory</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing_x</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing_y</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing_z"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">EXIT_FAILURE</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">unsigned</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>InputDimension<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">3</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">unsigned</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>OutputDimension<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">2</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">signed</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">short</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">PixelType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">Image</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">PixelType</span>,<span style="color: rgb(192, 192, 192);"> </span>InputDimension<span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">Image</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">PixelType</span>,<span style="color: rgb(192, 192, 192);"> </span>OutputDimension<span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">OutputImageType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ImageSeriesReader</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(128, 0, 128);">ReaderType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">DCMTKImageIO</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ImageIOType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">DCMTKSeriesFileNames</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputNamesGeneratorType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">NumericSeriesFileNames</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">OutputNamesGeneratorType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">IdentityTransform</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span>,<span style="color: rgb(192, 192, 192);"> </span>InputDimension<span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">TransformType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">LinearInterpolateImageFunction</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InterpolatorType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ResampleImageFilter</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ResampleFilterType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ShiftScaleImageFilter</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ShiftScaleType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ImageSeriesWriter</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">OutputImageType</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">SeriesWriterType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">////////////////////////////////////////////////</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">1)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Read</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">input</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ImageIOType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>gdcmIO<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ImageIOType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputNamesGeneratorType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>inputNames<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputNamesGeneratorType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>inputNames->SetInputDirectory(<span style="color: rgb(192, 192, 192);"> </span>argv[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">FileNamesContainer</span><span style="color: rgb(192, 192, 192);"> </span>&<span style="color: rgb(192, 192, 192);"> </span>filenames<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>inputNames->GetInputFileNames();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>reader<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>reader-><span style="font-style: italic;">SetImageIO</span>(<span style="color: rgb(192, 192, 192);"> </span>gdcmIO<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>reader->SetFileNames(<span style="color: rgb(192, 192, 192);"> </span>filenames<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">try</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>reader-><span style="font-style: italic;">Update</span>();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">catch</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ExceptionObject</span><span style="color: rgb(192, 192, 192);"> </span>&excp)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cerr<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Exception</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">thrown</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">while</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">reading</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cerr<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>excp<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">EXIT_FAILURE</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">////////////////////////////////////////////////</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">2)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Resample</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InterpolatorType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>interpolator<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InterpolatorType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">TransformType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>transform<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">TransformType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>transform->SetIdentity();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">SpacingType</span>&<span style="color: rgb(192, 192, 192);"> </span>inputSpacing<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>reader->GetOutput()->GetSpacing();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">RegionType</span>&<span style="color: rgb(192, 192, 192);"> </span>inputRegion<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>reader->GetOutput()->GetLargestPossibleRegion();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">SizeType</span>&<span style="color: rgb(192, 192, 192);"> </span>inputSize<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>inputRegion.GetSize();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cout<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"The</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">input</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">directory</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>argv[<span style="color: rgb(0, 0, 128);">1</span>]</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">has</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>filenames.size()<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">files</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">with</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>inputSpacing</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Compute</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">size</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">output.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">The</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">user</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">specifies</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">on</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">command</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">line.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">If</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">0,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">input</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">will</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">be</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">used.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">The</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">size</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(#</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pixels)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">output</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">recomputed</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">using</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">ratio</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">input</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">output</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">sizes.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">SpacingType</span><span style="color: rgb(192, 192, 192);"> </span>outputSpacing;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>atof(argv[<span style="color: rgb(0, 0, 128);">3</span>]);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>atof(argv[<span style="color: rgb(0, 0, 128);">4</span>]);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>atof(argv[<span style="color: rgb(0, 0, 128);">5</span>]);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">bool</span><span style="color: rgb(192, 192, 192);"> </span>changeInSpacing<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">false</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 128, 0);">unsigned</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>i<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;<span style="color: rgb(192, 192, 192);"> </span>i<span style="color: rgb(192, 192, 192);"> </span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">3</span>;<span style="color: rgb(192, 192, 192);"> </span>i++)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span><span style="color: rgb(192, 192, 192);"> </span>(outputSpacing[i]<span style="color: rgb(192, 192, 192);"> </span>==<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0.0</span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSpacing[i]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>inputSpacing[i];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">else</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>changeInSpacing<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">true</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">SizeType</span><span style="color: rgb(192, 192, 192);"> </span>outputSize;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">SizeType</span>::<span style="color: rgb(128, 0, 128);">SizeValueType</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">SizeValueType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">static_cast</span><<span style="color: rgb(128, 0, 128);">SizeValueType</span>>(inputSize[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>*<span style="color: rgb(192, 192, 192);"> </span>inputSpacing[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>/<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>+<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">.5</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">static_cast</span><<span style="color: rgb(128, 0, 128);">SizeValueType</span>>(inputSize[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>*<span style="color: rgb(192, 192, 192);"> </span>inputSpacing[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>/<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>+<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">.5</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">static_cast</span><<span style="color: rgb(128, 0, 128);">SizeValueType</span>>(inputSize[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>*<span style="color: rgb(192, 192, 192);"> </span>inputSpacing[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>/<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>+<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">.5</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ResampleFilterType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>resampler<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ResampleFilterType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetInput</span>(<span style="color: rgb(192, 192, 192);"> </span>reader->GetOutput()<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetTransform</span>(<span style="color: rgb(192, 192, 192);"> </span>transform<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetInterpolator</span>(<span style="color: rgb(192, 192, 192);"> </span>interpolator<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetOutputOrigin</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(192, 192, 192);"> </span>reader->GetOutput()->GetOrigin());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetOutputSpacing</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(192, 192, 192);"> </span>outputSpacing<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetOutputDirection</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(192, 192, 192);"> </span>reader->GetOutput()->GetDirection());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">SetSize</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(192, 192, 192);"> </span>outputSize<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler-><span style="font-style: italic;">Update</span><span style="color: rgb(192, 192, 192);"> </span>();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">////////////////////////////////////////////////</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">3)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Create</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">each</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Copy</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">dictionary</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">first</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">image</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">override</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">specific</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">fields</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">DictionaryRawPointer</span><span style="color: rgb(192, 192, 192);"> </span>inputDict<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>(*(reader->GetMetaDataDictionaryArray()))[<span style="color: rgb(0, 0, 128);">0</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">DictionaryArrayType</span><span style="color: rgb(192, 192, 192);"> </span>outputArray;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">To</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">keep</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">same</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">study</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">as</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">original</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">we</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">need</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">keep</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">same</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">study</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">UID.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">But</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">we</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">need</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">frame</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">reference</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">UID's.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">char</span><span style="color: rgb(192, 192, 192);"> </span>seriesUID[<span style="color: rgb(0, 0, 128);">100</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>dcmGenerateUniqueIdentifier(seriesUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">char</span><span style="color: rgb(192, 192, 192);"> </span>frameOfReferenceUID[<span style="color: rgb(0, 0, 128);">100</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>dcmGenerateUniqueIdentifier(frameOfReferenceUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>studyUID;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>sopClassUID;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::ExposeMetaData<std::string>(*inputDict,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"0020|000d"</span>,<span style="color: rgb(192, 192, 192);"> </span>studyUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::ExposeMetaData<std::string>(*inputDict,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"0008|0016"</span>,<span style="color: rgb(192, 192, 192);"> </span>sopClassUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">gdcmIO->KeepOriginalUIDOn();</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 128, 0);">unsigned</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>f<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;<span style="color: rgb(192, 192, 192);"> </span>f<span style="color: rgb(192, 192, 192);"> </span><<span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">2</span>];<span style="color: rgb(192, 192, 192);"> </span>f++)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Create</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">dictionary</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">this</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">DictionaryRawPointer</span><span style="color: rgb(192, 192, 192);"> </span>dict<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ReaderType</span>::<span style="color: rgb(128, 0, 128);">DictionaryType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Copy</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">dictionary</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">first</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>CopyDictionary<span style="color: rgb(192, 192, 192);"> </span>(*inputDict,<span style="color: rgb(192, 192, 192);"> </span>*dict);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Set</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">UID's</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">study,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">SOP</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">frame</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">reference</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|000d"</span>,<span style="color: rgb(192, 192, 192);"> </span>studyUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|000e"</span>,<span style="color: rgb(192, 192, 192);"> </span>seriesUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|0052"</span>,<span style="color: rgb(192, 192, 192);"> </span>frameOfReferenceUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">char</span><span style="color: rgb(192, 192, 192);"> </span>sopInstanceUID[<span style="color: rgb(0, 0, 128);">100</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>dcmGenerateUniqueIdentifier(sopInstanceUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0008|0018"</span>,<span style="color: rgb(192, 192, 192);"> </span>sopInstanceUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0002|0003"</span>,<span style="color: rgb(192, 192, 192);"> </span>sopInstanceUID);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Change</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">fields</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">that</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">are</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">specific</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">itksys_ios</span>::<span style="color: rgb(128, 0, 128);">ostringstream</span><span style="color: rgb(192, 192, 192);"> </span>value;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>f<span style="color: rgb(192, 192, 192);"> </span>+<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">1</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Image</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Number</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|0013"</span>,<span style="color: rgb(192, 192, 192);"> </span>value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Description</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">-</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Append</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">description</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">current</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">description</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>oldSeriesDesc;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::ExposeMetaData<std::string>(*inputDict,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"0008|103e"</span>,<span style="color: rgb(192, 192, 192);"> </span>oldSeriesDesc);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>oldSeriesDesc<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">":</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Resampled</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">with</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pixel</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">",</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><<<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">",</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><<<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">2</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">This</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">an</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">long</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">string</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">there</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">64</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">character</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">limit</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">standard</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">unsigned</span><span style="color: rgb(192, 192, 192);"> </span>lengthDesc<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>value.str().length();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>seriesDesc(<span style="color: rgb(192, 192, 192);"> </span>value.str(),<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>,lengthDesc<span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">64</span><span style="color: rgb(192, 192, 192);"> </span>?<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">64</span><span style="color: rgb(192, 192, 192);"> </span>:<span style="color: rgb(192, 192, 192);"> </span>lengthDesc);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0008|103e"</span>,<span style="color: rgb(192, 192, 192);"> </span>seriesDesc);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Number</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">1001</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|0011"</span>,<span style="color: rgb(192, 192, 192);"> </span>value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Derivation</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Description</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">-</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">How</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">this</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">image</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">was</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">derived</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">for</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>i<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;<span style="color: rgb(192, 192, 192);"> </span>i<span style="color: rgb(192, 192, 192);"> </span><<span style="color: rgb(192, 192, 192);"> </span>argc;<span style="color: rgb(192, 192, 192);"> </span>i++)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>argv[i]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">":</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">ITK_SOURCE_VERSION</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>lengthDesc<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>value.str().length();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>derivationDesc(<span style="color: rgb(192, 192, 192);"> </span>value.str(),<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>,<span style="color: rgb(192, 192, 192);"> </span>lengthDesc<span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">1024</span><span style="color: rgb(192, 192, 192);"> </span>?<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">1024</span><span style="color: rgb(192, 192, 192);"> </span>:<span style="color: rgb(192, 192, 192);"> </span>lengthDesc);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0008|2111"</span>,<span style="color: rgb(192, 192, 192);"> </span>derivationDesc);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Image</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Position</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Patient:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">This</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">calculated</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">by</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">computing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">physical</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">coordinate</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">first</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pixel</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">each</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">slice.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">PointType</span><span style="color: rgb(192, 192, 192);"> </span>position;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">InputImageType</span>::<span style="color: rgb(128, 0, 128);">IndexType</span><span style="color: rgb(192, 192, 192);"> </span>index;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>index[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>index[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>index[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>f;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>resampler->GetOutput()->TransformIndexToPhysicalPoint(index,<span style="color: rgb(192, 192, 192);"> </span>position);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>position[<span style="color: rgb(0, 0, 128);">0</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"\\"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>position[<span style="color: rgb(0, 0, 128);">1</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"\\"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>position[<span style="color: rgb(0, 0, 128);">2</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|0032"</span>,<span style="color: rgb(192, 192, 192);"> </span>value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Slice</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Location:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">For</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">now,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">we</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">store</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">z</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">component</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Image</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Position</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Patient.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>position[<span style="color: rgb(0, 0, 128);">2</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0020|1041"</span>,<span style="color: rgb(192, 192, 192);"> </span>value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span><span style="color: rgb(192, 192, 192);"> </span>(changeInSpacing)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Slice</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Thickness:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">For</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">now,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">we</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">store</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">z</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value.str(<span style="color: rgb(0, 128, 0);">""</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>value<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>outputSpacing[<span style="color: rgb(0, 0, 128);">2</span>];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0018|0050"</span>,value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Between</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Slices</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(*dict,<span style="color: rgb(0, 128, 0);">"0018|0088"</span>,value.str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Save</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">dictionary</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputArray.push_back(dict);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">////////////////////////////////////////////////</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">4)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Shift</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">data</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">undo</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">effect</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">of</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">rescale</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">intercept</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">by</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">DICOM</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">reader</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>interceptTag(<span style="color: rgb(0, 128, 0);">"0028|1052"</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataObject</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">MetaDataStringType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataObjectBase</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>entry<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>(*inputDict)[interceptTag];</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">MetaDataStringType</span>::<span style="color: rgb(128, 0, 128);">ConstPointer</span><span style="color: rgb(192, 192, 192);"> </span>interceptValue<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">dynamic_cast</span><<span style="color: rgb(128, 128, 0);">const</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">MetaDataStringType</span><span style="color: rgb(192, 192, 192);"> </span>*>(<span style="color: rgb(192, 192, 192);"> </span>entry.GetPointer()<span style="color: rgb(192, 192, 192);"> </span>)<span style="color: rgb(192, 192, 192);"> </span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>interceptShift<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span>(<span style="color: rgb(192, 192, 192);"> </span>interceptValue<span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>tagValue<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>interceptValue->GetMetaDataObjectValue();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>interceptShift<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>-atoi<span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(192, 192, 192);"> </span>tagValue.c_str()<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ShiftScaleType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>shiftScale<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">ShiftScaleType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>shiftScale-><span style="font-style: italic;">SetInput</span>(<span style="color: rgb(192, 192, 192);"> </span>resampler->GetOutput());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>shiftScale-><span style="font-style: italic;">SetShift</span>(<span style="color: rgb(192, 192, 192);"> </span>interceptShift<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 0, 128);">////////////////////////////////////////////////</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">5)</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Write</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">new</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">DICOM</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Make</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">output</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">directory</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">generate</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">file</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">names.</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itksys</span>::<span style="color: rgb(128, 0, 128);">SystemTools</span>::MakeDirectory(<span style="color: rgb(192, 192, 192);"> </span>argv[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Generate</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">file</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">names</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">OutputNamesGeneratorType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>outputNames<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">OutputNamesGeneratorType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>seriesFormat(argv[<span style="color: rgb(0, 0, 128);">2</span>]);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesFormat<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>seriesFormat<span style="color: rgb(192, 192, 192);"> </span>+<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"IM%d.dcm"</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputNames-><span style="font-style: italic;">SetSeriesFormat</span><span style="color: rgb(192, 192, 192);"> </span>(seriesFormat.c_str());</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputNames-><span style="font-style: italic;">SetStartIndex</span><span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(0, 0, 128);">1</span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>outputNames-><span style="font-style: italic;">SetEndIndex</span><span style="color: rgb(192, 192, 192);"> </span>(outputSize[<span style="color: rgb(0, 0, 128);">2</span>]);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cout<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Output</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Size:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cout<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>outputNames->GetFileNames().at(<span style="color: rgb(0, 0, 128);">0</span>)<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">SeriesWriterType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>seriesWriter<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">SeriesWriterType</span>::New();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesWriter->SetInput(<span style="color: rgb(192, 192, 192);"> </span>shiftScale->GetOutput()<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">SetImageIO</span>(<span style="color: rgb(192, 192, 192);"> </span>gdcmIO<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesWriter->SetFileNames(<span style="color: rgb(192, 192, 192);"> </span>outputNames->GetFileNames()<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">SetMetaDataDictionaryArray</span>(<span style="color: rgb(192, 192, 192);"> </span>&outputArray<span style="color: rgb(192, 192, 192);"> </span>);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cout<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">GetImageIO</span>()-><span style="font-style: italic;">GetOrigin</span>(<span style="color: rgb(0, 0, 128);">0</span>)<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">GetImageIO</span>()-><span style="font-style: italic;">GetOrigin</span>(<span style="color: rgb(0, 0, 128);">1</span>)<span style="color: rgb(192, 192, 192);"> </span><<</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">GetImageIO</span>()-><span style="font-style: italic;">GetOrigin</span>(<span style="color: rgb(0, 0, 128);">2</span>)<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">try</span></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>seriesWriter-><span style="font-style: italic;">Update</span>();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">catch</span>(<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">ExceptionObject</span><span style="color: rgb(192, 192, 192);"> </span>&<span style="color: rgb(192, 192, 192);"> </span>excp<span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cerr<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Exception</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">thrown</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">while</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">writing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cerr<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>excp<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">EXIT_FAILURE</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::cout<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"The</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">output</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">series</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">in</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">directory</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>argv[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">has</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span>outputSize[<span style="color: rgb(0, 0, 128);">2</span>]<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">files</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">with</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spacing</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><<<span style="color: rgb(192, 192, 192);"> </span>outputSpacing<span style="color: rgb(192, 192, 192);"> </span><<<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::endl;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">EXIT_SUCCESS</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;">}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>CopyDictionary<span style="color: rgb(192, 192, 192);"> </span>(<span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span>&fromDict,<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span>&toDict)</pre><pre style="margin-top: 0px; margin-bottom: 0px;">{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataDictionary</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">DictionaryType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">DictionaryType</span>::<span style="color: rgb(128, 0, 128);">ConstIterator</span><span style="color: rgb(192, 192, 192);"> </span>itr<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>fromDict.Begin();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">DictionaryType</span>::<span style="color: rgb(128, 0, 128);">ConstIterator</span><span style="color: rgb(192, 192, 192);"> </span>end<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>fromDict.End();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">typedef</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataObject</span><<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">MetaDataStringType</span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">while</span>(<span style="color: rgb(192, 192, 192);"> </span>itr<span style="color: rgb(192, 192, 192);"> </span>!=<span style="color: rgb(192, 192, 192);"> </span>end<span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::<span style="color: rgb(128, 0, 128);">MetaDataObjectBase</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>entry<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>itr->second;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">MetaDataStringType</span>::<span style="color: rgb(128, 0, 128);">Pointer</span><span style="color: rgb(192, 192, 192);"> </span>entryvalue<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">dynamic_cast</span><<span style="color: rgb(128, 0, 128);">MetaDataStringType</span><span style="color: rgb(192, 192, 192);"> </span>*>(<span style="color: rgb(192, 192, 192);"> </span>entry.GetPointer()<span style="color: rgb(192, 192, 192);"> </span>)<span style="color: rgb(192, 192, 192);"> </span>;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span>(<span style="color: rgb(192, 192, 192);"> </span>entryvalue<span style="color: rgb(192, 192, 192);"> </span>)</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>{</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>tagkey<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>itr->first;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span>::<span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span>tagvalue<span style="color: rgb(192, 192, 192);"> </span>=<span style="color: rgb(192, 192, 192);"> </span>entryvalue->GetMetaDataObjectValue();</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">itk</span>::EncapsulateMetaData<std::string>(toDict,<span style="color: rgb(192, 192, 192);"> </span>tagkey,<span style="color: rgb(192, 192, 192);"> </span>tagvalue);</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>++itr;</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><span style="color: rgb(192, 192, 192);"> </span>}</pre><pre style="margin-top: 0px; margin-bottom: 0px;">}</pre><pre style="margin-top: 0px; margin-bottom: 0px;"><br></pre></div></div></div></div></body></html>