Thanks both, that was it.<div><br></div><div>Dženan<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">How about changing the signature to use references, i.e.<br>


<div class="im"><br>
void applyFilter(InternalImageType::Pointer&amp; image,<br>
itk::ImageToImageFilter&lt;InternalImageType,InternalImageType&gt;::Pointer&amp; filter)<br>
<br></div></blockquote></div><br></div>