title: Not Reading DICOM Image Series Correctly with ITK
body: <p>I want to read a Series of DICOM image to convert them into a 3D image using ITK. I follow the example in the documentation: " Examples/IO/DicomSeriesReadImageWrite2.cxx" . But I am still having problems, I solved some, but I would like to hear any tip, please!</p>
  
  <p>The problem is in the code line underlined, the code is just below here and it’s not so long. It compiles, and the variable ‘seriesItr’ has the value = "1.2.392.200036.9116.2.6.1.48.1214834239.1284941923.42443543.0512512" . But the variable ‘seriesEnd’ is a null pointer! What am I doing wrong?  Thanks for your help in advanced! </p>
  
  <pre><code>// Reading a 2D DICOM Series and Writing a Volume 
    ReaderType::Pointer reader = ReaderType::New();
  
    ImageIOType::Pointer dicomIO = ImageIOType::New();
    reader-&gt;SetImageIO( dicomIO );
    NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();
    nameGenerator-&gt;SetUseSeriesDetails( true ); 
  
    std::string folder;
    folder = "C:\\Documents and Settings\\GTTS\\Mis documentos\\Visual Studio 2008\\Projects\\Reg_mono3D\\Reg_mono3D\\DICOM_SERIES\\T\\";
    nameGenerator-&gt;SetDirectory(folder);
  
    const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();
    SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
    ***SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();***
    while( seriesItr != seriesEnd )
    {
          std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; std::endl;
          seriesItr++;
    }
  
    std::string seriesIdentifier;
    seriesIdentifier = seriesUID.begin()-&gt;c_str();
    FileNamesContainer fileNames;
    fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );
  
    reader-&gt;SetFileNames( fileNames );
  
    try
    {
          reader-&gt;Update();
    }
    catch (itk::ExceptionObject &amp;ex)
    {
          cout &lt;&lt; ex &lt;&lt; std::endl;
    }
  </code></pre>