<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">My pipeline is as below,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT 
face="Bookman Old Style">reader---&gt;ShapeDetectoionLevelSet----&gt;BinaryThresholdImageFilter</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">I call 
BinaryThresholdImageFilter-&gt;Update() to trigger the pipeline. I use 
Observer&nbsp;CommandIterationUpdate_ShapeDetection to observe the result of 
each iteration of LevelSet. I want to halt the iteration when I observe the 
result has reach my requirement and set the&nbsp;flag enableHalt to true. I do 
as below&nbsp;</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV>
<DIV><FONT face="Bookman Old Style">class CommandIterationUpdate_ShapeDetection 
: public itk::Command <BR>{</FONT></DIV>
<DIV><FONT face="Bookman Old Style">.............<BR></DIV></FONT><FONT 
face="Bookman Old Style">
<DIV>&nbsp; void Execute(itk::Object *caller, const itk::EventObject &amp; 
event)</DIV>
<DIV>&nbsp;{</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; levelSetPointer levelSet = 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dynamic_cast&lt; levelSetPointer 
&gt;( caller );<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( typeid( event ) != typeid( 
itk::IterationEvent ) )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
return;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR><BR></DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(this-&gt;enableHalt)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;  
levelSet-&gt;AbortGenerateDataOn();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
return;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;}<BR><BR>............&nbsp;<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>However, exception&nbsp;is thrown. The reason maybe that levelset 
abort&nbsp;generating the data instead&nbsp;of passing the&nbsp;data to next 
filter.&nbsp;Which method should&nbsp;I&nbsp;use to halt the iteration?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Yixun Liu<BR>&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;</FONT><FONT 
face="Bookman Old Style"></FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT>&nbsp;</DIV></BODY></HTML>