[Insight-users] InPlaceOn() requires standard assignment too
Dženan Zukić
dzenanz at gmail.com
Tue Nov 29 08:38:08 EST 2011
OK, thank you.
2011/11/29 Johannes Keustermans <johannes.keustermans at esat.kuleuven.be>
> Hi,
>
>
> When executing an in-place image filter the input is used as output,
> meaning that it gets overwritten (allows to save some memory). However,
> it is possible that the input to the in-place filter is used by any
> other filters. In this case, not the true input would be used, but the
> overwritten version of it. Therefore, the input data is released after
> the in place filter has finished computing (see the "ReleaseInputs()"
> method in "itk::InPlaceImageFilter"). Whenever the input data is needed
> by any of the other filters, it needs to be recalculated.
>
> In case of an "itk::Image", the "ReleaseData()" method results in a call
> to "Initialize()" which will reset the buffered region and the pixel
> buffer.
>
>
> Kind regards,
> Johannes
>
> On Tue, 2011-11-29 at 14:11 +0100, Dženan Zukić wrote:
> > Hi all,
> >
> > in the following code excerpt, the last line seems to be crucial.
> > Without it, the resulting image has bufferedRegion=[0,0,0] which
> > breaks subsequent filters. Can someone explain why is the last line
> > required?
> >
> > addFilter->SetInput1(logic.masks);
> > addFilter->SetInput2(mask);
> > addFilter->InPlaceOn();
> > addFilter->Update(); //logic.masks.bufferedRegion==0, other things OK
> > logic.masks=addFilter->GetOutput(); //logic.masks.bufferedRegion>0
> > (everything OK)
> >
> > Regards,
> > Dženan
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111129/d8e9349e/attachment.htm>
More information about the Insight-users
mailing list