<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< double, 3 > AffineType;<br><br>AffineType::Pointer affine = AffineType::New();<br><br>//finalTransform->SetParameters( finalParameters );<br><br>affine->SetMatrix( transform->GetRotationMatrix() );<br>affine->SetOffset( transform->GetOffset() );<br><br>AffineType::Pointer invTransform = affine->GetInverseTransform();<br><br>AffineType::MatrixType invmatrix =
invTransform->GetMatrix();<br>AffineType::OffsetType invoffset = invTransform->GetOffset();<br><br><br> ResampleFilterType::Pointer invresampler = ResampleFilterType::New();<br><br> invresampler->SetTransform( invTransform );<br> invresampler->SetInput( movingImageReader->GetOutput() );<br><br> FixedImageType::Pointer invImage = movingImageReader->GetOutput();<br><br> invresampler->SetSize( movingImageReader->GetLargestPossibleRegion().GetSize() );<br> invresampler->SetOutputOrigin( movingImageReader->GetOrigin() );<br> invresampler->SetOutputSpacing( movingImageReader->GetSpacing() );<br> invresampler->SetOutputDirection( movingImageReader->GetDirection() );<br> invresampler->SetDefaultPixelValue( 100 );</div><div><br></div><div>*********************************************</div><div>Then I got this
error: </div><div><br></div><div>error: conversion from ‘itk::SmartPointer<itk::TransformBase>’ to non-scalar type ‘itk::SmartPointer<itk::AffineTransform<double, 3u> >’ 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>