<!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> </DIV>
<DIV><FONT face="Bookman Old Style">My pipeline is as below,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT
face="Bookman Old Style">reader--->ShapeDetectoionLevelSet---->BinaryThresholdImageFilter</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">I call
BinaryThresholdImageFilter->Update() to trigger the pipeline. I use
Observer 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 flag enableHalt to true. I do
as below </FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </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> void Execute(itk::Object *caller, const itk::EventObject &
event)</DIV>
<DIV> {</DIV>
<DIV> levelSetPointer levelSet =
<BR> dynamic_cast< levelSetPointer
>( caller );<BR> if( typeid( event ) != typeid(
itk::IterationEvent ) )<BR>
{<BR>
return;<BR> }<BR><BR></DIV>
<DIV>
if(this->enableHalt)<BR> {<BR>
levelSet->AbortGenerateDataOn();<BR>
return;<BR>
}<BR> }<BR><BR>............ <BR>}</DIV>
<DIV> </DIV>
<DIV>However, exception is thrown. The reason maybe that levelset
abort generating the data instead of passing the data to next
filter. Which method should I use to halt the iteration?</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV> </DIV>
<DIV>Yixun Liu<BR> </DIV>
<DIV> <BR> </FONT><FONT
face="Bookman Old Style"></FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV></BODY></HTML>