[Insight-users] resampling problems
Lydia Ng
lng@insightful.com
Mon, 18 Nov 2002 09:08:35 -0800
Hi Jorn,
It is the numerical parameters that looks inverse to you
or the final resampled image?
As you might already be aware, that in registration
we are typically trying to find the transform which maps
a point from the fixed image domain to the moving image
domain - which is the reverse of how people usually think
in terms of transforming images.
--------------------
Have you tried this?
resample->SetInterpolator(interp.GetPointer());
-----------------------
- Lydia
> -----Original Message-----
> From: J. Van Dalen [mailto:j.vandalen@rad.umcn.nl]
> Sent: Monday, November 18, 2002 8:47 AM
> To: insight-users@public.kitware.com
> Subject: [Insight-users] resampling problems
>=20
>=20
>=20
> Dear ITK users,
>=20
> Just recently I started to use ITK, mainly for the purpose of medical
> image registration using mutual information. I am new in this=20
> field (ITK),
> so logically I get into problems... Here are two questions,=20
> on which one
> of you hopefully has some answer.
>=20
> In my code, I use the information from the MIRegistration example. It
> seems that I can perform a registration using MI, i.e., I get=20
> some numbers
> associated with the transformation. However, when I try to=20
> resample, I run
> into problems when I use SetTransform and when I use=20
> SetInterpolator. When
> I use SetTransform in the ResampleImageFilter (see code=20
> below), it looks
> as if the inverse transform is taken, instead of the "real"=20
> transform. Has
> anybody an idea why this can be?=20
>=20
> Furthermore, when I include the line=20
> "resample->SetInterpolator(interp);"
> (see code below) the compilation of the program fails (the=20
> error message
> is: "no matching function for call to=20
> `itk::ResampleImageFilter<main (int,
> char **)::ImageType, main (int, char **)::ImageType>::SetInterpolator
> (itk::SmartPointer<itk::LinearInterpolateImageFunction<main (int, char
> **)::OutputType, double> > &)' ") Can anybody tell me=20
> something more about
> the interpolator function and how it should be used in ITK?
>=20
> Thanks,
> Jorn.
>=20
> // part of my code:
>=20
> // Create a linear interpolation image function
> typedef itk::LinearInterpolateImageFunction<ImageType,=20
> double> resIntType;
> resIntType::Pointer interp =3D resIntType::New();
> interp->SetInputImage(volInMove);
>=20
> // Resample
> itk::ResampleImageFilter< ImageType, ImageType >::Pointer resample;
> resample =3D itk::ResampleImageFilter< ImageType, ImageType =
>::New();
> resample->SetInput(volInMove);
> cout << transform.GetPointer() << "\n";
> resample->SetTransform(transform.GetPointer());
> // resample->SetInterpolator(interp); // gives an error
> resample->SetSize( volInFix->GetLargestPossibleRegion().GetSize() );
> resample->SetOutputOrigin( volInFix->GetOrigin() );
> resample->SetOutputSpacing( volInFix->GetSpacing() );
> resample->SetDefaultPixelValue( 0 );
> resample->Update();
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>=20
>=20