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

Matei Stroila matei.stroila at gmail.com
Wed Dec 27 13:28:44 EST 2006


Dear all,

I am trying to rotate a 2D image about its center. I don't know what
am I doing wrong.

I use a processing pipeline (crop and dilation) that results in an image,
dilateFilter->GetOutput() . Then, I set the origin and spacing:

GrayITKImageType::PointType origin;
	origin[0] = 0;
	origin[1] = 0;
GrayITKImageType::SpacingType spacing;
	spacing[0] = 1;
	spacing[1] = 1;
	dilateFilter->GetOutput()->SetOrigin(origin);
	dilateFilter->GetOutput()->SetSpacing(spacing);

I want to rotate this image about its center but I am not able to set
the correct transformations, although I follow the ITK User Guide.
Even though the print out of the origin and spacing is correct, the
rotating result is not.

On the other hand, if I write out the image and read it back with a
reader, then everything works fine on reader->GetOutput()

What else should I (re)set, apart from origin and spacing?

Thanks so much for help,

Matei


More information about the Insight-users mailing list