<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Hi Luis, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Yes, In my code I reuse the same reader several times.<o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Now as you said I use "reader->UpdateLargestPossibleRegion()" instead of "reader->Update()" and the code is working fine.<o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Thank you Luis very much for your prompt reply and help.</SPAN></DIV>
<DIV><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Juliette<o:p></o:p></SPAN></DIV>
<DIV><BR><BR>--- En date de : <B>Lun 30.11.09, Luis Ibanez <I><luis.ibanez@kitware.com></I></B> a écrit :<BR></DIV>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; PADDING-LEFT: 5px; MARGIN-LEFT: 5px"><BR>De: Luis Ibanez <luis.ibanez@kitware.com><BR>Objet: Re: Exception thrown while reading a cropped file !<BR>À: "Juliette Deniau" <juliette.deniau@yahoo.fr><BR>Cc: "insight" <insight-users@itk.org><BR>Date: Lundi 30 Novembre 2009, 13h33<BR><BR>
<DIV id=yiv690462833>
<DIV><BR></DIV>Hi Juliette,
<DIV><BR>
<DIV><BR></DIV>
<DIV>1) What File Format are you using ?</DIV>
<DIV><BR></DIV>
<DIV>2) It looks that you are you reusing a reader class instance,</DIV>
<DIV> that you have used before for reading a previous image in</DIV>
<DIV> your program. Presumably the same reader that you used</DIV>
<DIV> for loading the input image that you cropped.</DIV>
<DIV><BR></DIV>
<DIV>3) It is ok to reuse a reader, but, when you do so, instead </DIV>
<DIV> of calling </DIV>
<DIV><BR></DIV>
<DIV> "reader->Update()" </DIV>
<DIV><BR></DIV>
<DIV> you must call the method</DIV>
<DIV><BR></DIV>
<DIV> "reader->UpdateLargestPossibleRegion()"</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> in order to trigger the recomputation of the regions to be read.</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> Please let us know how it goes.</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> Thanks</DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV> Luis</DIV>
<DIV><BR></DIV>
<DIV><BR>-----------------------------------------------------------------------------------------------------------<BR>
<DIV class=gmail_quote>On Mon, Nov 30, 2009 at 8:08 AM, Juliette Deniau <SPAN dir=ltr><<A href="http://fr.mc282.mail.yahoo.com/mc/compose?to=juliette.deniau@yahoo.fr" rel=nofollow target=_blank ymailto="mailto:juliette.deniau@yahoo.fr">juliette.deniau@yahoo.fr</A>></SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>
<TABLE border=0 cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD vAlign=top>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Hi,</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>I have a reading problem of a cropped volume. The error I get is as follows:</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Exception thrown while reading the cropped file</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>itk::ExceptionObject (013DFA88)</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Location: "void __thiscall itk::ImageFileReader<class itk::Image<unsigned char,3>,class itk::DefaultConvertPixelTraits<unsigned char> >::EnlargeOutputRequestedRegion(class itk::DataObject *)"</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>File: c:\mytools\insight\insighttoolkit-3.10.0\code\io\itkImageFileReader.txx</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Line: 341</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Description: itk::ERROR: ImageFileReader(02616CA8): ImageIO returns IO region that does not fully contain the requested regionRequested region: ImageRegion (013DFC74)</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Dimension: 3</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Index: [13, 13, 13]</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Size: [25, 25, 25]</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>StreamableRegion region: ImageRegion (02616D8C)</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Dimension: 3</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Index: [0, 0, 0]</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri><SPAN> </SPAN>Size: [25, 25, 25]</FONT></FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>// end error</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>The cropped volume is obtained by cropping the original volume using<SPAN> </SPAN>Bounding Box Index [13, 13, 13]and Bounding Box size [25, 25, 25]of a segmented object contained in the original volume.</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>The original volume is as following:</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>inputSize= 64, 64, 64</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>inputOrigin= 0, 0, 0</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>inputSpacing= 1, 1, 1</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>inputStart= 0, 0, 0</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>I could not understand the above error especially I can view the cropped volume using<SPAN> </SPAN>Volview without any problem! But I can’t read it !</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Could anyone help me on this matter? </FONT></DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Many thanks</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri>Juliette.</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt" class=MsoNormal><FONT size=3 face=Calibri> </FONT></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV></TD></TR></TBODY></TABLE><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></td></tr></table><br>