Hi Jim<br> I didn't well understand your answer but i think it's too important because i still have a similar problem :<br> <br> <span style="font-weight: bold;">ITK exception caught in main</span><br style="font-weight: bold;"> <br style="font-weight: bold;"> <span style="font-weight: bold;">itk::InvalidRequestedRegionError (0x82004f8)</span><br style="font-weight: bold;"> <span style="font-weight: bold;">Location: "Image::PropagateRequestedRegion()"</span><br style="font-weight: bold;"> <span style="font-weight: bold;">File: /usr/local/InsightToolkit-2.4.0/Code/Common/itkDataObject.cxx</span><br style="font-weight: bold;"> <span style="font-weight: bold;">Line: 397</span><br style="font-weight: bold;"> <span style="font-weight: bold;">Description: Requested region is (at least partially) outside the largest possible region.</span><br> <br> What should i add, did i forget something?<br> thx in advance<br><br><b><i>"Miller, James V (GE, Research)" <millerjv@crd.ge.com></i></b>
a écrit :<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta content="MSHTML 6.00.2900.2802" name="GENERATOR"> <div><span class="299351918-02022006"><font color="#0000ff" face="Arial" size="2">Amir, </font></span></div> <div><span class="299351918-02022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div> <div><span class="299351918-02022006"><font color="#0000ff" face="Arial" size="2">You should need both the call to Update() and UpdateLargestPossibleRegion(). The call to UpdateLargestPossibleRegion() should be fine.</font></span></div> <div><span class="299351918-02022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div> <div><span class="299351918-02022006"><font color="#0000ff" face="Arial" size="2">jim</font></span></div> <blockquote> <div class="OutlookMessageHeader" align="left"
dir="ltr"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> charfeddine amir [mailto:charfeddine_amir@yahoo.fr]<br><b>Sent:</b> Thursday, February 02, 2006 2:24 AM<br><b>To:</b> Miller, James V (GE, Research); insight insight<br><b>Subject:</b> RE: [Insight-users] ITK exception caught in main :itk::InvalidRequestedRegionError (0x82cb748)<br><br></font></div>Hi Jim,<br>thx very much<br>i just add a call to the<span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"> </font></span><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2">UpdateLargestPossibleRegion() <span style="color: rgb(0, 0, 0);">method , and every thing was ok</span>:</font></span><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"><br> .<br> .<br></font></span> m_ImageReader->SetFileName( FileNamesItr->c_str());<br> m_ImageReader->Update();<br><span
class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"> m_ImageReader->UpdateLargestPossibleRegion()<br> .<br> .<br> <span style="color: rgb(0, 0, 0);">Regards, <br> Amir.<br></span></font></span><br><b><i>"Miller, James V (GE, Research)" <millerjv@crd.ge.com></i></b> a écrit : <blockquote class="replbq" style="border-left: 2px solid; padding-left: 5px; margin-left: 5px;"> <meta content="MSHTML 6.00.2900.2802" name="GENERATOR"> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2">The problem is probably in your LoadNextImage() method. </font></span></div> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2">What ImageType is ImageFileReader loading? Is it a 2D or 3D image?</font></span></div> <div><span
class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2">When a pipeline is run the first time, it establishes a set of region requests at each stage in the pipeline. The last filter places a request on the filter before ! it, that filter places a request on the filter before it, ... When you changed the filename on the reader, the reader may no longer satisfy the request cached between it and the downstream filters. When you change a parameter like the slice to visualize (or the amount to shrink an image), you need to call UpdateLargestPossibleRegion() instead of Update() on the pipeline to renogiate the regions and ignore the previous cached versions.</font></span></div> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2"></font></span> </div> <div><span class="906544221-01022006"><font color="#0000ff" face="Arial" size="2">Jim</font></span></div> <blockquote> <div class="OutlookMessageHeader" align="left" dir="ltr"><font face="Tahoma" size="2">-----Original Message-----<br><b>From:</b> insight-users-bounces+millerjv=crd.ge.com@itk.org! [mailto:insight-users-bounces+millerjv=crd.ge.com@itk.org]<b>On Behalf Of </b>charfeddine amir<br><b>Sent:</b> Wednesday, February 01, 2006 10:37 AM<br><b>To:</b> insight insight<br><b>Subject:</b> [Insight-users] ITK exception caught in main :itk::InvalidRequestedRegionError (0x82cb748)<br><br></font></div>HI all<br>i have this error and the program crash while triying to visualize Dicom Image.<br>this program read all Dicom files belonging to the same serie, from a given directory.<br>each file contain
many slice of a fantom.<br>I take the ShapeDetectionLevelSet program from the InsightApplications and edit it do that.<br>i start with pushing the Load Button, I select a dicom directory containing files, then program read all the Dicom files belonging to the same serie( the first one found), and read the first Dicom file, then i can visualize it when i click on the Display Button (under Load button),<br>then i move to the next Dicom file! in serie with a counter (like fltk slider), and when i reclick on display, the program crash with the following message:<br><br>ITK exception caught in main <br><br>itk::InvalidRequestedRegionError (0x82cb748)<br>Location: "Image::PropagateRequestedRegion()"<br>File: /usr/local/InsightToolkit-2.4.0/Code/Common/itkDataObject.c! xx<br>Line: 397<br>Description: Requested region is (at least partially) outside the largest possible region.<br><br>this is
part of code i add:<br><br><span style="font-style: italic; text-decoration: underline;">//function for loading the first serie in the directory dirname</span><br><span style="font-weight: bold;">void</span><br style="font-weight: bold;"><span style="font-weight: bold;">ShapeDetectionLevelSetBase </span><br style="font-weight: bold;"><span style="font-weight: bold;">::<span style="text-decoration: underline;">LoadInputDir</span>( const char * dirname )</span><br>{<br><br>if( !dirname )<br> {<br> return;<br> }<br> nameGenerator->SetDirectory( dirname );<br> seriesUID = nameGenerator->GetSeriesUIDs();<br> <br> seriesIdentifier = seriesUID.begin()->c_str();<br> <br> <br> fileNames = nameGenerator->GetFileNames( seriesIdentifier );<!-- br--> FileNamesBegin =
fileNames.begin();<br> FileNamesItr = fileNames.end();<BBR> FileNamesEnd = fileNames.end();<br> <br> ListCardinal=0;<br> ListPosition=1;<br> while( FileNamesItr != FileNamesBegin )<br> {<br> ListCardinal++;<br> FileNamesItr--;<br> }<br> <br> LoadCurrentImage();<br>}<br><br><span style="font-style: italic; text-decoration: underline;">//function for! reading the first file in serie</span><br><span style="font-weight: bold;">void</span><br style="font-weight: bold;"><span style="font-weight: bold;">ShapeDetectionLevelSetBase </span><br style="font-weight: bold;"><span style="font-weight: bold;">::<span style="text-decoration: underline;">LoadCurrentImage</span>()</span><br style="font-weight: bold;">{<br> <br>
m_ImageReader->SetFileName( FileNamesItr->c_str());<br> m_ImageReader->Update();<br> m_InputImage=m_ImageReader->GetOutput();<br><br> // Allocate an image of seeds of the same size<br> InputImageType::RegionType region <br> = m_ImageReader->GetOutput()->GetLargestPossibleRegion();<br><br> InputImageType::SizeType size = region.GetSize();<br><br> for(unsigned int i=0; i<ImageDimension; i++)<br> {<br> if( size[i] < 10 )<br> {<br> this->ShowStatus("Image must be 3D and with at least 10 pixels along each Dimension.");<br> itk::ExceptionObject excp;<br> excp.SetDescription("Image must be 3D and with at least
10 pixels along each Dimension.");<br> throw ! excp;<br> }<br> }<br><br><br> m_SeedImage->SetRegions( region );<br> m_SeedImage->Allocate();<br> m_SeedImage->FillBuffer( itk::NumericTraits<SeedImageType::PixelType>::Zero );<br><br> m_FastMarchingFilter->SetOutputSize( region.GetSize() );<br><br><br> m_InputImageIsLoaded = true;<br>}<br><br><span style="font-style: italic; text-decoration: underline;">//function for reading the next file in serie</span><br><span style="font-weight: bold;">void</span><br style="font-weight: bold;"><span style="font-weight: bold;">ShapeDetectionLevelSetBase </span><br style="font-weight: bold;"><span style="font-weight: bold;">::<span style="text-decoration: underline;">LoadNextImage</span>( )</span><br>{<br>if ( FileNamesItr != FileNamesEnd
)<br>{<br>FileNamesItr++;<br>ListPosition++;<br>m_ImageReader->SetFileName( FileNamesItr->c_str() );<br>m_ImageReader->Update();<br>m_InputImage=m_ImageReader->GetOutput();<br>}<br><br>//this->ShowInputImage();<br><br>InputImageType::RegionType region <br> = m_ImageReader->GetOutput()->GetLargestPossibleRegion();<br><br> InputImageType::SizeType size = region.GetSize();<br><br> for(unsigned int i=0; i<ImageDimension; i++)<br> {<br> if( size[i] < 10 )<br> {<br> this->ShowStatus("Image must be 3D and with at least 10 pixels along each Dimension.");<br> itk::ExceptionObject excp;<br> excp.SetDescription("Image must be 3D and with at
least 10 pixels along each Dimension.");<br> throw excp;<br> }<br> }<br><br><br> m_SeedImage->SetRegions( region );<br !=""> m_SeedImage->Allocate();<br> m_SeedImage->FillBuffer( itk::NumericTraits<SeedImageType::PixelType>::Zero );<br><br> m_FastMarchingFilter->SetOutputSize( region.GetSize() );<br>}<br><br><span style="font-style: italic; text-decoration: underline;">//function for reading the previous file in serie</span><br><span style="font-weight: bold;">void</span><br style="font-weight: bold;"><span style="font-weight: bold;">ShapeDetectionLevelSetBase </span><br><span style="font-weight: bold;">::<span style="text-decoration: underline;">LoadPrevImage</span>( )</span><br>{<br><br>if ( FileNamesItr != FileNamesBegin
)<br>{<br>FileNamesItr--;<br>ListPosition--;<br>m_ImageReader->SetFileName( FileNamesItr->c_str() );<br>m_ImageReader->Update();<br>mm_IInputImage=m_ImageReader->GetOutput();<br>}<br><br>//this->ShowInputImage();<br><br>InputImageType::RegionType region <br> = m_ImageReader->GetOutput()->GetLargestPossibleRegion();<br><br> InputImageType::SizeType size = region.GetSize();<br><br> for(unsigned int i=0; i<ImageDimension; i++)<br> {<br> if( size[i] < 10 )<br> {<br> this->ShowStatus("Image must be 3D and with at least 10 pixels along each Dimension.");<br> itk::ExceptionObject excp;<br> excp.SetDescription("Image must be 3D and with at
least 10 pixels along each Dimension.");<br> throw excp;<br> }<br> }<br><br><br> m_SeedImage->SetRegions( region );<br> m_SeedImage->Allocate();<br> m_SeedImage->FillBuffer( itk::NumericTraits<SeedImageType::PixelType>::Zero );<!-- br--> <br> m_FastMarchingFilter->SetOutputSize( region.GetSize() );<br><br>}<br>/*********************************************************************************************/<br><br><br>any comment is welcome<br>thx<br>Amir,<br> </BBR><div></div> <hr size="1"> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. <a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com">Téléchargez</a> la version
beta.</blockquote></blockquote><br> <div> </div><hr size="1"> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international. <a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com">Téléchargez</a> la version beta.</blockquote></blockquote><br><p>
                <hr size=1> Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.beta.messenger.yahoo.com">Téléchargez</a> la version beta.