[Insight-users] Problem with resampling
Luis Ibanez
luis.ibanez at kitware.com
Sun Apr 25 10:44:00 EDT 2010
Hi Motes,
Depending on the optimizer that you are using,
the expression
resampler->SetTransform( registration->GetTransform());
is incorrect, since not all optimizers set the Transform
to be the one holding the last registration parameters.
Please follow what the Examples do in
Insight/Examples/Registration/
transform->SetFixedParameters(
registration->GetTransform()->GetFixedParameters() );
OptimizerType::ParametersType finalParameters =
registration->GetLastTransformParameters();
transform->SetParameters( finalParameters );
resampler->SetTransform( transform );
BTW: looking at the differences between
http://img718.imageshack.us/img718/5899/correct.jpg
http://img203.imageshack.us/img203/8120/wrongd.jpg
It looks like both are oriented the same way, and that the
only difference is the intensity level that you are setting
in the Default value:
resampler->SetDefaultPixelValue( 0 );
Is that black background what you consider to be incorrect ?
Regards,
Luis
-----------------------------------------------------
On Wed, Apr 21, 2010 at 8:00 AM, motes motes <mort.motes at gmail.com> wrote:
> 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.
> >
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100425/21959f72/attachment.htm>
More information about the Insight-users
mailing list