<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've performed registration using "VersorRigid3DTransform", and now want to perform transformation on original moving image with these registration result parameters. For doing that, I tried taking the inverse of the registration then give it to the affine transform type. Here is my partial code:</div><div><br></div><div>**************************************</div><div>typedef itk::AffineTransform&lt; double, 3 &gt; AffineType;<br><br>AffineType::Pointer affine = AffineType::New();<br><br>//finalTransform-&gt;SetParameters( finalParameters );<br><br>affine-&gt;SetMatrix( transform-&gt;GetRotationMatrix() );<br>affine-&gt;SetOffset( transform-&gt;GetOffset() );<br><br>AffineType::Pointer invTransform = affine-&gt;GetInverseTransform();<br><br>AffineType::MatrixType invmatrix =
 invTransform-&gt;GetMatrix();<br>AffineType::OffsetType invoffset = invTransform-&gt;GetOffset();<br><br><br>&nbsp; ResampleFilterType::Pointer invresampler = ResampleFilterType::New();<br><br>&nbsp; invresampler-&gt;SetTransform( invTransform );<br>&nbsp; invresampler-&gt;SetInput( movingImageReader-&gt;GetOutput() );<br><br>&nbsp; FixedImageType::Pointer invImage = movingImageReader-&gt;GetOutput();<br><br>&nbsp; invresampler-&gt;SetSize(&nbsp;&nbsp;&nbsp; movingImageReader-&gt;GetLargestPossibleRegion().GetSize() );<br>&nbsp; invresampler-&gt;SetOutputOrigin(&nbsp; movingImageReader-&gt;GetOrigin() );<br>&nbsp; invresampler-&gt;SetOutputSpacing( movingImageReader-&gt;GetSpacing() );<br>&nbsp; invresampler-&gt;SetOutputDirection( movingImageReader-&gt;GetDirection() );<br>&nbsp; invresampler-&gt;SetDefaultPixelValue( 100 );</div><div><br></div><div>*********************************************</div><div>Then I got this
 error:&nbsp;</div><div><br></div><div>error: conversion from ‘itk::SmartPointer&lt;itk::TransformBase&gt;’ to non-scalar type ‘itk::SmartPointer&lt;itk::AffineTransform&lt;double, 3u&gt; &gt;’ requested<br></div><div><br></div><div>Why the datatype is wrong here? Does affine transform only accept non-scalar type? Besides, is my method correct for what I want to do? <br></div><div><br></div><div>Thank you very much in advance !</div><div>Regards,</div><div>Abayiz</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></body></html>