[Insight-users] Transformation After Registration

Abayiz abayiz at yahoo.com
Mon May 21 08:44:08 EDT 2012


Hello,

I am going to perform a transformation based on parameters from rigid registration, and my partial code for transformation is as follows: 


****************************************************************
  resampler->SetTransform( finalTransform );
  resampler->SetInput( reader->GetOutput() );

  resampler->SetSize(    reader->GetOutput()->GetLargestPossibleRegion().GetSize() );
  resampler->SetOutputOrigin(  reader->GetOutput()->GetOrigin() );
  resampler->SetOutputSpacing( reader->GetOutput()->GetSpacing() );
  resampler->SetOutputDirection( reader->GetOutput()->GetDirection() );

  resampler->SetInterpolator ( linearInterpolator );
  resampler->SetDefaultPixelValue( 30 );


  CastFilterType::Pointer  caster =  CastFilterType::New();
  WriterType::Pointer       writer =     WriterType::New();
  caster->SetInput( resampler->GetOutput() );

  writer->SetInput( resampler->GetOutput()   );
  writer->SetFileName ( "transformedimage.mha" );
  writer->Update();


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

The code compiles without error, but from the result I can say it is not working correctly. Which part is wrong here?? Do you have any suggestion? 


Thanks in advance. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120521/0b880a08/attachment.htm>


More information about the Insight-users mailing list