<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.5730.13" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">I asked a similar question on error handling a while ago on this forum. VTK does not support exception handling around Update as ITK does. However I think the idea of handling an exception to Update is not really needed because in fact you shouldn't need to be calling Update in most cases anyway, i.e. it's up to the pipeline to determine when to call Update on each object as data is "pulled" through the pipe. A better way is to check for pipeline errors by adding observers to each pipeline object and checking in the call back if an error has occurred (using AddObserver). As an aside to this, are you also using the ReleaseDataFlag on each output like this, "imageReader.GetOutput().ReleaseDataFlagOn()", this will ensure that memory is released when not needed.<BR><BR>>>> Fireman Fireman <vtkusersneedhelp@yahoo.fr> 08/10/2010 12:19 >>><BR>
<DIV style="COLOR: #000000">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<DIV>Hi, <BR><BR>I'm using the last VTK 5.6.1. <BR><BR>I'm using a vtkDICOMImageReader to read DICOm images. I have got this error <BR><BR>\vtk\common\vtkDataArrayTemplate.txx, line 140 <BR>vtkShortArray (0931BF08): Unable to allocate 129499136 elements of size 2 <BR>bytes. <BR><BR>What's the problem? </DIV>
<DIV> </DIV>
<DIV>How can I catch this exception to avoid the crash of my program <SPAN title="" style="COLOR: #000" closure_uid_r77gy5="96" se="j'ai essayé de faire ceci mais j'ai pas pu catcher cette exception" te="I tried to do this but I could not wrestle this exception"> </SPAN></DIV>
<DIV><SPAN title="" style="COLOR: #000" closure_uid_r77gy5="96" se="j'ai essayé de faire ceci mais j'ai pas pu catcher cette exception" te="I tried to do this but I could not wrestle this exception"></SPAN> </DIV>
<DIV><SPAN title="" style="COLOR: #000" closure_uid_r77gy5="96" se="j'ai essayé de faire ceci mais j'ai pas pu catcher cette exception" te="I tried to do this but I could not wrestle this exception">I tried to do this but I could not cath the exception :<BR><FONT size=2></FONT></SPAN></DIV>
<DIV><SPAN title="" style="COLOR: #000" closure_uid_r77gy5="96" se="j'ai essayé de faire ceci mais j'ai pas pu catcher cette exception" te="I tried to do this but I could not wrestle this exception"><FONT size=2>//-----------------------------------------------</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> try</DIV></FONT></FONT><FONT size=2>
<DIV> {</DIV>
<DIV> dicomReader->Update();</DIV>
<DIV> }</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> catch</FONT></FONT><FONT size=2> (vtkstd::bad_alloc)</DIV>
<DIV> {</DIV>
<DIV> //<SPAN title="" style="COLOR: #000" closure_uid_r77gy5="108" se="Il ne passe pas par ici" te="It does not pass through here">It doesn't pass through here</SPAN></DIV>
<DIV> }</DIV>
<DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2> catch</FONT></FONT><FONT size=2> (...)</DIV>
<DIV> {</DIV>
<DIV> //<SPAN title="" style="COLOR: #000" closure_uid_r77gy5="108" se="Il ne passe pas par ici" te="It does not pass through here">It doesn't pass through here</SPAN></FONT><FONT size=2></DIV>
<DIV> }</DIV>
<DIV>//---------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV>Thank you in davance </DIV></FONT></SPAN></TD></TR></TBODY></TABLE><BR></DIV></BODY></HTML>