<div><div class="gmail_quote">Hello Mathieu,<span class="Apple-style-span" style="color: rgb(136, 136, 136); "> <span class="Apple-style-span" style="color: rgb(0, 0, 0); ">Thanks for the quick reply!</span></span></div><div class="gmail_quote">
<br></div><div class="gmail_quote">So different DICOM series have different sizes and orientations, is that why it doesn't work? All images within one series have the same orientation and size, and any one series can be read without problem. If I read multiple series in a loop I sometimes run into trouble. Is there a way to "reset" the reader before each new series to avoid the error?</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">2009/6/16 Mathieu Malaterre <span dir="ltr"><<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tue, Jun 16, 2009 at 11:43 AM,<br>
Patrik.Br.<<a href="mailto:patrik.brynolfsson@gmail.com">patrik.brynolfsson@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I am trying to read DICOM series from a folder, much like in example<br>
> DicomSeriesReadImageWrite2.cxx. However, I modified the reader so that it<br>
> loops over all found series instead of just the first:<br>
><br>
> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<br>
> SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<br>
> std::string seriesIdentifier;<br>
> typedef std::vector< std::string > FileNamesContainer;<br>
> FileNamesContainer fileNames;<br>
><br>
> while( seriesItr != seriesEnd )<br>
> {<br>
> seriesIdentifier = seriesItr->c_str();<br>
> fileNames = nameGenerator->GetFileNames( seriesIdentifier );<br>
> reader->SetFileNames( fileNames );<br>
> try{<br>
> reader->Update();<br>
> }<br>
> catch (itk::ExceptionObject &ex)<br>
> {<br>
> std::cout << ex << std::endl;<br>
> return EXIT_FAILURE;<br>
> }<br>
><br>
> {<br>
> //Some code<br>
> }<br>
><br>
> seriesItr++;<br>
> }<br>
><br>
> However I sometimes get the error<br>
> "Requested region is (at least partially) outside the largest possible<br>
> region."<br>
> I first thought this was due to one faulty DICOM series, but it happens for<br>
> many series, but not all of them. It only happens when I read multiple DICOM<br>
> series i.e. when I use the loop, never when I read just one series. Also,<br>
> depending on what other series have been read before, some series might or<br>
> might not be read correctly without error. What's going on?<br>
<br>
</div></div>This means you have DICOM files with:<br>
1. Either different Image Orientation (Patient), (=itk orientation)<br>
2. different dimensions (Columns / Rows).<br>
<br>
You can check that image are compatible with simple command line tool<br>
such as gdcminfo from GDCM 2.x package.<br>
<br>
Ref:<br>
<a href="http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Gdcminfo" target="_blank">http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Gdcminfo</a><br>
<br>
Download:<br>
<a href="http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=GDCM_Release_2.0#GDCM_2.0.12_.282008.2F06.2F12.29" target="_blank">http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=GDCM_Release_2.0#GDCM_2.0.12_.282008.2F06.2F12.29</a><br>
<br>
2cts<br>
--<br>
<font color="#888888">Mathieu<br>
</font></blockquote></div><br></div>