<font size="2"><font face="verdana,sans-serif">OK, thank you.<br></font></font><br><div class="gmail_quote">2011/11/29 Johannes Keustermans <span dir="ltr"><<a href="mailto:johannes.keustermans@esat.kuleuven.be">johannes.keustermans@esat.kuleuven.be</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
<br>
When executing an in-place image filter the input is used as output,<br>
meaning that it gets overwritten (allows to save some memory). However,<br>
it is possible that the input to the in-place filter is used by any<br>
other filters. In this case, not the true input would be used, but the<br>
overwritten version of it. Therefore, the input data is released after<br>
the in place filter has finished computing (see the "ReleaseInputs()"<br>
method in "itk::InPlaceImageFilter"). Whenever the input data is needed<br>
by any of the other filters, it needs to be recalculated.<br>
<br>
In case of an "itk::Image", the "ReleaseData()" method results in a call<br>
to "Initialize()" which will reset the buffered region and the pixel<br>
buffer.<br>
<br>
<br>
Kind regards,<br>
<font color="#888888">Johannes<br>
</font><div><div></div><div class="h5"><br>
On Tue, 2011-11-29 at 14:11 +0100, Dženan Zukić wrote:<br>
> Hi all,<br>
><br>
> in the following code excerpt, the last line seems to be crucial.<br>
> Without it, the resulting image has bufferedRegion=[0,0,0] which<br>
> breaks subsequent filters. Can someone explain why is the last line<br>
> required?<br>
><br>
> addFilter->SetInput1(logic.masks);<br>
> addFilter->SetInput2(mask);<br>
> addFilter->InPlaceOn();<br>
> addFilter->Update(); //logic.masks.bufferedRegion==0, other things OK<br>
> logic.masks=addFilter->GetOutput(); //logic.masks.bufferedRegion>0<br>
> (everything OK)<br>
><br>
> Regards,<br>
> Dženan<br>
<br>
<br>
</div></div></blockquote></div><br>