[Insight-users] Image assignment does not work

Dženan Zukić dzenanz at gmail.com
Thu Sep 2 08:48:21 EDT 2010


Hi everyone!

I have the following routine:

void applyFilter(InternalImageType::Pointer image,
itk::ImageToImageFilter<InternalImageType,InternalImageType>::Pointer
filter)
{
if (!checkImageLoaded())
return;
statusbar->showMessage("Applying filter:
"+QString(filter->GetNameOfClass()));
 filter->SetInput( image );
filter->Update();
image=filter->GetOutput();
 updateVisualizing();
resetVisualization();
statusbar->showMessage("Ready");
}

and it is invoked like this:

typedef itk::SmoothingRecursiveGaussianImageFilter < InternalImageType,
InternalImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetSigmaArray(myImage->GetSpacing());
applyFilter(myImage,
(itk::ImageToImageFilter<InternalImageType,InternalImageType>::Pointer)filter);

However, the above code produces no effect (the image does not change). When
content of "applyFilter" is copied to invocation points, it works.

What am I doing wrong?

Regards,
Dženan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100902/b19c9fe4/attachment.htm>


More information about the Insight-users mailing list