[Insight-users] Strange error when reading DICOM

Patrik.Br. patrik.brynolfsson at gmail.com
Tue Jun 16 05:43:41 EDT 2009


Hello,

I am trying to read DICOM series from a folder, much like in example
DicomSeriesReadImageWrite2.cxx. However, I modified the reader so that it
loops over all found series instead of just the first:

SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();
SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();
std::string seriesIdentifier;
typedef std::vector< std::string >   FileNamesContainer;
FileNamesContainer fileNames;

while( seriesItr != seriesEnd )
   {
    seriesIdentifier = seriesItr->c_str();
    fileNames = nameGenerator->GetFileNames( seriesIdentifier );
    reader->SetFileNames( fileNames );
        try{
            reader->Update();
            }
        catch (itk::ExceptionObject &ex)
            {
            std::cout << ex << std::endl;
            return EXIT_FAILURE;
            }
    
       {
        //Some code
       }
 
    seriesItr++;
   } 

However I sometimes get the error 
"Requested region is (at least partially) outside the largest possible
region."
I first thought this was due to one faulty DICOM series, but it happens for
many series, but not all of them. It only happens when I read multiple DICOM
series i.e. when I use the loop, never when I read just one series. Also,
depending on what other series have been read before, some series might or
might not be read correctly without error. What's going on?

-- 
View this message in context: http://n2.nabble.com/Strange-error-when-reading-DICOM-tp3085364p3085364.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list