[Insight-users] resample filter and image origin/spacing setting

Matei Stroila matei.stroila at gmail.com
Wed Dec 27 17:11:29 EST 2006


On 12/27/06, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> You should not attempt to  change the output of filters.
> You don't own those images.

How do I pass the ownership from a filter? Is this enough?

typedef itk::ImageDuplicator<ImageType> DuplicatorType;
DuplicatorType::Pointer duplicatorFilter = DuplicatorType::New();
duplicatorFilter->SetInputImage ( filter->GetOutput());
duplicatorFilter->Update();
ImageType::Pointer pImage = duplicatorFilter->GetOutput();

Or should I also allocate first  ImageType::Pointer pImage = ImageType::New(); ?

>
> If you need to change the origin and/or spacing of an
> image you must use the:
>
>
>      ChangeInformationImageFilter
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html
>

Thank you so much, never used this filter!


> Could you please post to the list the *exact*
> source code where you are using the ResampleImageFilter ?

As I isolated it from my other code, the whole pipeline works fine, so
I don't seem to correctly use the smart pointers.

Thanks,

Matei


More information about the Insight-users mailing list