[Insight-users] Get Registration Parameters to Perform Transformation

Abayiz abayiz at yahoo.com
Fri Apr 20 07:38:38 EDT 2012


Hello, 


I am trying to perform transformation using rigid registration result parameters. Registration is performed on two data sets, and the transformation is performed on a third different data. The code is compiling and running well, except the result is too weird. So I doubt my coding must be incorrect. Here is how I do it: 


*********************************************  ResampleFilterType::Pointer transresampler = ResampleFilterType::New();

  MovingImageReaderType::Pointer transreader = MovingImageReaderType::New();
  transreader->SetFileName ( argv[3] );
  transreader->Update();

  transresampler->SetTransform( finalTransform );
  transresampler->SetInput( transreader->GetOutput() );

  transresampler->SetSize(    transreader->GetOutput()->GetLargestPossibleRegion().GetSize() );
  transresampler->SetOutputOrigin(  transreader->GetOutput()->GetOrigin() );
  transresampler->SetOutputSpacing( transreader->GetOutput()->GetSpacing() );
  transresampler->SetOutputDirection( transreader->GetOutput()->GetDirection() );
  transresampler->SetDefaultPixelValue( 100 );

  CastFilterType::Pointer  transCaster =  CastFilterType::New();
  WriterType::Pointer        transWriter =     WriterType::New();
  transCaster->SetInput( transresampler->GetOutput() );

  transWriter->SetInput( transCaster->GetOutput()   );
  transWriter->SetFileName ( "result.mha" );
  transWriter->Update();

*********************************************

In it, "finalTransform" is from "VersorRigid3DTransformation". Is there anything wrong here? 

Thank you in advance. 


Abayiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120420/307bd8d7/attachment.htm>


More information about the Insight-users mailing list