<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr">Dear All,<br><br>I'm trying to register a 3D volume of a dental scan prosthesis to be mapped on patient scan 3D volume, by taking landmarks from both the scan prosthesis (moving image) and from the patient (fixed image), I've used itk::VersorRigid3DTransform, where I get the translation and rotation from the transform, after looping on each landmark and transform moving point to fixed point..<br>
<br>The output transformation matrix does not map the two volumes correctly.. <br><br>Taking into consideration that landMarks were taken from axial view of dicom data, that 3D volume was generated from , also I've used Open Inventor SbMatrix to initialize transformation 4*4 matrix
<br><br><b>Pipeline is as follow:</b><br><br>typedef itk::VersorRigid3DTransform<double> TransformType;<br> TransformType::Pointer transform;<br><br> transform= TransformType::New();<br><br> typedef itk::LandmarkBasedTransformInitializer< TransformType,FixedImageType, MovingImageType > TransformInitializerType;<br>
TransformInitializerType::Pointer initializer;<br><br>initializer= TransformInitializerType::New();<br><br>TransformInitializerType::LandmarkPointContainer fixedLandmarks;<br> TransformInitializerType::LandmarkPointContainer movingLandmarks;<br>
TransformInitializerType::LandmarkPointType m_point;<br><br>initializer->SetFixedLandmarks(fixedLandmarks);<br> initializer->SetMovingLandmarks(movingLandmarks);<br> initializer->SetTransform( transform );<br>
initializer->InitializeTransform();<br><br> TransformInitializerType::PointsContainerConstIterator fitr = fixedLandmarks.begin(); //Fixed points iterator<br> TransformInitializerType::PointsContainerConstIterator mitr = movingLandmarks.begin();// Moving points iterator<br>
<br> typedef TransformInitializerType::OutputVectorType OutputVectorType;<br><br> while( mitr != movingLandmarks.end() )<br> {<br> transform->TransformPoint( *fitr );<br><br> ++mitr;<br> ++fitr;<br>
}<br> <br> <br> OutputVectorType outputVec= transform->GetTranslation();<br><br>VersorType myversor= transform->GetVersor();<br><br>SbMatrix transformMatrix; <br><br> SbRotation rotation;<br><br> SbVec3f axis;<br>
axis[0]=myversor.GetAxis()[0];<br> axis[1]=myversor.GetAxis()[1];<br> axis[2]=myversor.GetAxis()[2];<br> <br> double x= myversor.GetScalar();<br> SbVec3f scaler;<br> scaler[0]=x;<br> scaler[1]=x;<br>
scaler[2]=x;<br> <br> rotation.setValue(axis,(float)(myversor.GetAngle()));<br> <br> transformMatrix.setTransform(translation, rotation,scaler );<br> <br><br> return transformMatrix;<br><br>I want to know if the problem from the pipeline, the input , the way I initialize the output SbMatrix, or I'm using the wrong type of registration.. <br>
<br>Thanks a lot<br>Aya R.<br>
</div>
</div><br></div>