<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div><br></div><div>I am going to perform a transformation based on parameters from rigid registration, and my partial code for transformation is as follows: <br></div><div><br></div><div>****************************************************************</div><div> resampler->SetTransform( finalTransform );<br> resampler->SetInput( reader->GetOutput() );<br><br> resampler->SetSize( reader->GetOutput()->GetLargestPossibleRegion().GetSize() );<br> resampler->SetOutputOrigin( reader->GetOutput()->GetOrigin() );<br> resampler->SetOutputSpacing( reader->GetOutput()->GetSpacing() );<br> resampler->SetOutputDirection( reader->GetOutput()->GetDirection() );<br><br> resampler->SetInterpolator (
linearInterpolator );<br> resampler->SetDefaultPixelValue( 30 );</div><div><br></div><div><br></div><div> CastFilterType::Pointer caster = CastFilterType::New();<br> WriterType::Pointer writer = WriterType::New();<br> caster->SetInput( resampler->GetOutput() );<br><br> writer->SetInput( resampler->GetOutput() );<br> writer->SetFileName ( "transformedimage.mha" );<br> writer->Update();<br></div><div><br></div><div>****************************************************************</div><div><br></div><div>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? <br></div><div><br></div><div>Thanks in advance. <br></div></div></body></html>