<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>Isabelle, </FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>Second
question first, I believe when you DisconnectPipeline, that changes the state of
the ReleaseDataFlag on the object being disconnected.
DisconnectPipeline</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>forces
the source filter to create an new output and that output will be configured
with the same setting of the ReleaseDataFlag as previous
output.</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>First
question now. There are two things I think that you need to
address:</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>1. Your logic seems a little circular. If someone chooses to
do histogram equalization, you are taking the output of the rescale, running
histogram equalization on it, and then rescaling it AGAIN. If the user
unchecks the histogram equalization, you set the rescaleFilters input to the
original output of the rescale filter and end up rescaling it
AGAIN.</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>2.
Downstream processing: Once you disconnect the output of the rescale filter, a
new output object is created in its place. But if you had other filters
consuming the old output of the rescale filter, they are not rewired to the new
output. So that anything holding a reference to
rescaleFilter->GetOutput() still references the previous image. Then
would have to be redirected towards the new output of the rescale
filter.</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>I
think you can simplify your code using standard pipeline
mechanics:</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>Set up
a pipeline like</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>histeqFilter->SetInput( someInputImage );</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>rescaleFilter->SetInput( someInputImage );</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>note
that both filters are operating on the same image.</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>When
the user wants to use the histogram equalization, simply redefine the input to
the rescaleFilter</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>rescaleFilter->SetInput( histeqFilter->GetOutput()
);</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff size=2>If the
user want to go back to not using histogram equalization, redefine the input to
the rescaleFilter again</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>rescaleFilter->SetInput( someInputImage );</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2>Jim</FONT></SPAN></DIV>
<DIV><SPAN class=644451915-05082005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><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>Renaud Isabelle<BR><B>Sent:</B> Friday, August 05, 2005 10:05
AM<BR><B>To:</B> Luis Ibanez<BR><B>Cc:</B>
insight-users@itk.org<BR><B>Subject:</B> [Insight-users] Help with
DisconnectPipeline()<BR><BR></FONT></DIV>
<DIV>Hi Luis, </DIV>
<DIV> </DIV>
<DIV>I thought I understood how to use DisconnectPipeline() to grab a filter's
output but it seems not to be the case. Could you put light on it
please?</DIV>
<DIV> </DIV>
<DIV>I just wanna offer the possibility to user to apply an histogram
equalization on the displayed image and then return to the older image if
desired. So, one way to do it, would be to keep the old image before any
histogram equalization, thanks to DisconnectPipeline(), and then reuse it
after histogram equalization. Here is what I did:</DIV>
<DIV> </DIV>
<DIV><STRONG>OnButton_HistogramEqualization() <BR>{<BR></STRONG></DIV>
<DIV> <STRONG>if(HistEqBtn.GetCheck())</STRONG> //back to the old
image</DIV>
<DIV>
<STRONG>{<BR>
rescaleFilter->SetInput(oldImage);<BR> }</STRONG></DIV>
<DIV><STRONG> else</STRONG> // activate histogram equalization<BR>
<STRONG>{</STRONG></DIV>
<DIV> </DIV>
<DIV> //save the old
image to return later to it</DIV>
<DIV> <STRONG>
WorkImageType::Pointer oldImage =
rescaleFilter->GetOutput();</STRONG></DIV>
<DIV><STRONG>
oldImage->DisconnectPipeline();</STRONG></DIV>
<DIV><BR>
<STRONG>histeqFilter->SetInput(oldImage);<BR>
histeqFilter->Update();<BR>
rescaleFilter->SetInput(histeqFilter->GetOutput());<BR>
}<BR> <BR> rescaleFilter->Update();<BR>}</STRONG></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>But this doesn't work: my image is still the same before an d after
button clicked. Yet, this code seems to be simple and I can't see what I
miss. </DIV>
<DIV> </DIV>
<DIV>Btw, could you tell me if: </DIV>
<DIV> </DIV>
<DIV> <STRONG>histeqFilter->GetOutput()->ReleaseDataFlagOn();<BR> rescaleFilter->GetOutput()->ReleaseDataFlagOn();</STRONG></DIV>
<DIV> </DIV>
<DIV>could interfere with
rescaleFilter<STRONG>->GetOutput()->DisconnectPipeline()</STRONG>?</DIV>
<DIV> </DIV>
<DIV>I really need your help,</DIV>
<DIV> </DIV>
<DIV>Thanks in advance,</DIV>
<DIV>Isabelle</DIV>
<P>
<HR SIZE=1>
<B><FONT color=#ff0000>Appel audio GRATUIT</FONT> partout dans le monde</B>
avec le nouveau Yahoo! Messenger<BR><A
href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez
le ici !</A> </BLOCKQUOTE></BODY></HTML>