[Insight-developers] pipeline fix for DisconnectPipeline and InPlace filters

Miller, James V (Research) millerjv at crd.ge.com
Tue, 2 Mar 2004 12:43:16 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C4007D.D7D1F7B4
Content-Type: text/plain;
	charset="iso-8859-1"

Lydia, 
 
Just an FYI, I fixed the pipeline bug that you had in the
MultiResolutionPDEDeformableRegistrationImageFilter.
I realize that you fixed the problem by disconnecting objects but I fixed
the problem anyway.  There really wasn't anything that you did incorrectly
(I did remove an extra graft from the code that wasn't needed, but the test
would have still crashed).
 
Here is what happened.  By disconnecting the data object from the vector
resample filter, the data object is set up to not have a source (this is
what allowed you to pass it as an input to the registration without having
the pipeline get into a loop).  Then you manually updated the registration
filter and then manually updated the vector resample filter.  The
registration filter ran in place, taking ownership of the input pixel
buffer.  The in place mechanics then created an empty pixel buffer for the
registration filter input and set up the BufferedRegion to be empty.  This
is all appropriate since the input to the registration no longer has a pixel
buffer since the registration filter ran in place.
 
Then you manually updated the vector resample image, which caused a
propagation up the pipeline to find LargestPossibleRegion.  The input to the
registration filter does not have a source, so it defaulted to propagating a
LargestPossibleRegion down the pipeline that was equal to the
BufferedRegion.  Unfortunately, since the registration filter had already
ran, the BufferedRegion was empty, so the LargestPossibleRegion propagated
down the pipeline was empty. 
 
This problem would not have been revealed if you had not called Update() on
the registration filter and only called Update() on the vector resample. But
this particular bug would have been revealed anytime an image without a
source was used and the data was released (either through ReleaseData or
running InPlace) and the consuming pipeline was updated twice.
 
I made a small change to ImageSource so that if a DataObject has no source
and the BufferedRegion is empty, the UpdateOutputInformation call will not
modify the LargestPossibleRegion.  This may sound a little dangerous but I
think it is the best we can do for now.  
 
The bottom line is that the pipeline pattern you were using in the
MultiResolutionPDEDeformableRegistration should now work. 
 
Jim
 
 
 
 
 

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research.ge.com <mailto:millerjv at research.ge.com> 

james.miller at research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 

------_=_NextPart_001_01C4007D.D7D1F7B4
Content-Type: text/html;
	charset="iso-8859-1"

<!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.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=678041817-02032004><FONT size=2>Lydia, </FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>Just an FYI, I fixed the 
pipeline bug that you had in the 
MultiResolutionPDEDeformableRegistrationImageFilter.</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>I realize that you fixed the 
problem by disconnecting objects but I fixed the problem anyway.&nbsp; There 
really wasn't anything that you did incorrectly (I did remove an extra graft 
from the code that wasn't needed, but the test would have still 
crashed).</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>Here is what happened.&nbsp; By 
disconnecting the data object from the vector resample filter, the data object 
is set up to not have a source (this is what allowed you to pass it as an input 
to the registration without having the pipeline get into a loop).&nbsp; Then you 
manually updated the registration filter and then manually updated the vector 
resample filter.&nbsp; The registration filter ran in place, taking ownership of 
the input pixel buffer.&nbsp; The in place mechanics then created an empty pixel 
buffer for the registration filter input and set up the BufferedRegion to be 
empty.&nbsp; This is all appropriate since the input to the registration no 
longer has a pixel buffer since the registration filter ran in 
place.</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>Then you manually updated the 
vector resample image, which caused a propagation up the pipeline to find 
LargestPossibleRegion.&nbsp; The input to the registration filter does not have 
a source, so it defaulted to propagating a LargestPossibleRegion down the 
pipeline that was equal to the BufferedRegion.&nbsp; Unfortunately, since the 
registration filter had already ran, the BufferedRegion was empty, so the 
LargestPossibleRegion propagated down the pipeline was 
empty.&nbsp;</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>This problem would not have 
been revealed if you had not called Update() on the registration filter and only 
called Update() on the vector resample. But this particular bug would have been 
revealed anytime an image without a source was used and the data was released 
(either through ReleaseData or running InPlace) and the consuming pipeline was 
updated twice.</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>I made a small change to 
ImageSource so that if a DataObject has no source and the BufferedRegion is 
empty, the UpdateOutputInformation call will not modify the 
LargestPossibleRegion.&nbsp; This may sound a little dangerous but I think it is 
the best we can do for now.&nbsp; </FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>The bottom line is that the 
pipeline pattern you were using in the MultiResolutionPDEDeformableRegistration 
should now work. </FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2>Jim</FONT></SPAN></DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=678041817-02032004><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv at research.ge.com">millerjv at research.ge.com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james.miller at research.ge.com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C4007D.D7D1F7B4--