What about<br>void applyFilter(InternalImageType:<div>:Pointer & image, itk::ImageToImageFilter<InternalImageType,InternalImageType>::Pointer filter)<br><br></div><span style="white-space: pre-wrap;"></span>image=filter->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"><<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>></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<InternalImageType,InternalImageType>::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->showMessage("Applying filter: "+QString(filter->GetNameOfClass()));</div>
<div><span style="white-space: pre-wrap;">        </span>filter->SetInput( image );</div><div><span style="white-space: pre-wrap;">        </span>filter->Update();</div><div><span style="white-space: pre-wrap;">        </span>image=filter->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->showMessage("Ready");</div>
<div>}</div></div><div><br></div><div>and it is invoked like this:</div><div><br></div><div><div>typedef itk::SmoothingRecursiveGaussianImageFilter < InternalImageType, InternalImageType> FilterType;</div><div>FilterType::Pointer filter = FilterType::New();</div>
<div>filter->SetSigmaArray(myImage->GetSpacing());</div><div>applyFilter(myImage, (itk::ImageToImageFilter<InternalImageType,InternalImageType>::Pointer)filter);</div><div><br></div></div><div>However, the above code produces no effect (the image does not change). When content of "applyFilter" 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>