[Insight-users] Strange error when reading DICOM
Mathieu Malaterre
mathieu.malaterre at gmail.com
Tue Jun 16 05:57:04 EDT 2009
On Tue, Jun 16, 2009 at 11:43 AM,
Patrik.Br.<patrik.brynolfsson at gmail.com> wrote:
>
> 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?
This means you have DICOM files with:
1. Either different Image Orientation (Patient), (=itk orientation)
2. different dimensions (Columns / Rows).
You can check that image are compatible with simple command line tool
such as gdcminfo from GDCM 2.x package.
Ref:
http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Gdcminfo
Download:
http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=GDCM_Release_2.0#GDCM_2.0.12_.282008.2F06.2F12.29
2cts
--
Mathieu
More information about the Insight-users
mailing list