I'm failing at trying to write a DICOM series in a specified folder.<div>Check out the code below. I'm explicitly setting the folder "extDicom" as output directory.</div><div>Yet, the files are always written to the current working directory where the application is in.</div>
<div>Regardless of the folder I'm telling the NamesGenerator...</div><div>What am I doing wrong?<br><div><br></div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #9e0069">typedef</span><span style="color: #000000"> itk::</span>GDCMImageIO<span style="color: #000000"> </span>ImageIOType<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #9e0069">typedef</span><span style="color: #000000"> itk::</span>GDCMSeriesFileNames<span style="color: #000000"> </span>NamesGeneratorType<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="text-decoration: underline ; color: #9e0069">typedef</span><span style="text-decoration: underline"> </span><span style="text-decoration: underline ; color: #9e0069">unsigned</span><span style="text-decoration: underline"> </span><span style="text-decoration: underline ; color: #9e0069">short</span><span style="text-decoration: underline"> OutputPixelType;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #9e0069">const</span> <span style="color: #9e0069">unsigned</span> OutputDimension = 2;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #9e0069">typedef</span> itk::<span style="color: #006640">Image</span><OutputPixelType, OutputDimension> <span style="color: #006640">Image2DType</span>;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><span style="color: #9e0069">typedef</span><span style="color: #000000"> itk::</span>ImageSeriesWriter<span style="color: #000000"><</span>ItkImageType<span style="color: #000000">, </span>Image2DType<span style="color: #000000">> </span>SeriesWriterType<span style="color: #000000">;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>ImageIOType<span style="color: #000000">::</span>Pointer<span style="color: #000000"> gdcmIO = </span>ImageIOType<span style="color: #000000">::New();</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>SeriesWriterType<span style="color: #000000">::Pointer writer = </span>SeriesWriterType<span style="color: #000000">::New();</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>writer->SetInput(<span style="color: #2400d0">itkImage</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>writer->SetImageIO(gdcmIO);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #006640"><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span>NamesGeneratorType<span style="color: #000000">::</span>Pointer<span style="color: #000000"> namesGenerator = </span>NamesGeneratorType<span style="color: #000000">::New();</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>namesGenerator->SetOutputDirectory(<span style="color: #4e00ff">"extDicom"</span>);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span><span style="color: #9e0069">const</span> <span style="color: #006640">SeriesWriterType</span>::FileNamesContainer & filenames = namesGenerator->GetOutputFileNames();</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>writer->SetFileNames(filenames);</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>writer->SetMetaDataDictionary(<span style="color: #2400d0">itkImage</span>->GetMetaDataDictionary());</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px"><br></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco"><span class="Apple-tab-span" style="white-space:pre">        </span>writer->Update();</p></div></div>