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 class="Apple-tab-span" style="white-space:pre">        </span>if (!checkImageLoaded())</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>statusbar->showMessage("Applying filter: "+QString(filter->GetNameOfClass()));</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>filter->SetInput( image );</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>filter->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>image=filter->GetOutput();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>updateVisualizing();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resetVisualization();</div><div><span class="Apple-tab-span" style="white-space:pre">        </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>