[Insight-users] Problem with resampling

motes motes mort.motes at gmail.com
Wed Apr 21 08:00:34 EDT 2010


Arg problem is still the same. I was previewing the moving image and
not the registered image so any suggestions are still most welcome!



On Wed, Apr 21, 2010 at 1:24 PM, motes motes <mort.motes at gmail.com> wrote:
> After running an AffineTransform registration process I am trying to
> compute the registered image using the following:
>
> // ....
>    try {
>      registration->Update();
>    }
>    catch( itk::ExceptionObject & err ) {
>      std::cerr << "ExceptionObject caught !" << std::endl;
>      std::cerr << err << std::endl;
>      return;
>    }
>
>    resampler->SetInput(imageM);
>    resampler->SetInterpolator( registration->GetInterpolator() );
>    resampler->SetTransform( registration->GetTransform());
>    resampler->SetSize( imageF->GetLargestPossibleRegion().GetSize() );
>    resampler->SetOutputSpacing( imageF->GetSpacing() );
>    resampler->SetOutputOrigin( imageF->GetOrigin() );
>    resampler->SetDefaultPixelValue( 0 );
>    resampler->Update();
>
>    CopyImageToImage<typename FixedImageType::Pointer,
> FixedImageType>(resampler->GetOutput(), imageR);
>    display_image<FixedImageType, Volume, short>(imageR);
>
>
> When I print the parameters after the registration I get:
>
> 25 = 1.06962 : [0.990631, 0.0905022, -0.0294116, -0.0802955, 1.00481,
> -0.035022, 0.0491173, -0.00658597, 0.910021, -3.12388, 6.25156,
> -21.9981]
>
> these I know are the correct parameters and should produce this image:
>
> http://img718.imageshack.us/img718/5899/correct.jpg
>
> after running the above resampler. But instead I get:
>
> http://img203.imageshack.us/img203/8120/wrongd.jpg
>
>
> Any ideas on what might go wrong in the resampler, it looks like the
> rotation is messed up for some reason?
>
> I have checked that the fixed and moving images are correct just
> before running the resampler.
>


More information about the Insight-users mailing list