<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello, <br></div><div><br></div><div>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: <br></div><div><br></div><div>*********************************************</div> ResampleFilterType::Pointer transresampler = ResampleFilterType::New();<br><div> MovingImageReaderType::Pointer transreader = MovingImageReaderType::New();<br> transreader->SetFileName ( argv[3] );<br> transreader->Update();</div><div><br></div><div> transresampler->SetTransform( finalTransform );<br> transresampler->SetInput(
transreader->GetOutput() );</div><div><br></div><div> transresampler->SetSize( transreader->GetOutput()->GetLargestPossibleRegion().GetSize() );<br> transresampler->SetOutputOrigin( transreader->GetOutput()->GetOrigin() );<br> transresampler->SetOutputSpacing( transreader->GetOutput()->GetSpacing() );<br> transresampler->SetOutputDirection( transreader->GetOutput()->GetDirection() );<br> transresampler->SetDefaultPixelValue( 100 );</div><div><br></div><div> CastFilterType::Pointer transCaster = CastFilterType::New();<br> WriterType::Pointer transWriter = WriterType::New();<br> transCaster->SetInput( transresampler->GetOutput() );</div><div><br></div><div> transWriter->SetInput( transCaster->GetOutput() );<br> transWriter->SetFileName (
"result.mha" );<br> transWriter->Update();</div><div><br></div><div>*********************************************</div><div><br></div><div>In it, "finalTransform" is from "VersorRigid3DTransformation". Is there anything wrong here? </div><div><br></div><div>Thank you in advance. <br></div><div><br></div><div>Abayiz<br></div></div></body></html>