What about<br>void applyFilter(InternalImageType:<div>:Pointer &amp; image, itk::ImageToImageFilter&lt;InternalImageType,InternalImageType&gt;::Pointer filter)<br><br></div><span style="white-space: pre-wrap;"></span>image=filter-&gt;GetOutput();//here image pointer inside function has been changed, however, the image outside the function does not.<br>
<br><br><br><br><div class="gmail_quote">2010/9/2 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi everyone!<div><br></div><div>I have the following routine:</div><div><br></div><div><div>void applyFilter(InternalImageType::Pointer image, itk::ImageToImageFilter&lt;InternalImageType,InternalImageType&gt;::Pointer filter)</div>


<div>{</div><div><span style="white-space: pre-wrap;">        </span>if (!checkImageLoaded())</div><div><span style="white-space: pre-wrap;">                </span>return;</div><div><span style="white-space: pre-wrap;">        </span>statusbar-&gt;showMessage(&quot;Applying filter: &quot;+QString(filter-&gt;GetNameOfClass()));</div>


<div><span style="white-space: pre-wrap;">        </span>filter-&gt;SetInput( image );</div><div><span style="white-space: pre-wrap;">        </span>filter-&gt;Update();</div><div><span style="white-space: pre-wrap;">        </span>image=filter-&gt;GetOutput();</div>


<div><span style="white-space: pre-wrap;">        </span>updateVisualizing();</div><div><span style="white-space: pre-wrap;">        </span>resetVisualization();</div><div><span style="white-space: pre-wrap;">        </span>statusbar-&gt;showMessage(&quot;Ready&quot;);</div>


<div>}</div></div><div><br></div><div>and it is invoked like this:</div><div><br></div><div><div>typedef itk::SmoothingRecursiveGaussianImageFilter &lt; InternalImageType, InternalImageType&gt; FilterType;</div><div>FilterType::Pointer filter = FilterType::New();</div>


<div>filter-&gt;SetSigmaArray(myImage-&gt;GetSpacing());</div><div>applyFilter(myImage, (itk::ImageToImageFilter&lt;InternalImageType,InternalImageType&gt;::Pointer)filter);</div><div><br></div></div><div>However, the above code produces no effect (the image does not change). When content of &quot;applyFilter&quot; is copied to invocation points, it works.</div>


<div><br></div><div>What am I doing wrong?</div><div><br></div><div>Regards,</div><div>Dženan</div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>