[Insight-users] 3D Registration of two volumes

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 18 13:20:45 EDT 2010


Hi Aya,

1)  The LandmarkBasedTransformInitialize is a good choice for your case,
      since you are gathering the landmarks on both images.

2)  How many landmarks are you using ?

3)  How did you gathered the landmarks ?
     are you sure that they are in the physical
     coordinate system of each image ?

3)  Have you verified that the images have correct values of
     origin, orientation and spacing ?

4)  Please compute the distance between the landmarks
     and their mappings (after passing them through the
     transform), that will give you an idea of the residual
     registration error.

5)  It is not unlikely that Inventor requires the inverse
     matrix instead of the direct matrix...

6)  Verify the overlap between the images by using
     the resample image filter with the Transform
     resulting from the initialization.

     You will find examples on how to do this in almost
     all the files in

                  Insight/Examples/Registration



At this point it is difficult to tell if you have a registration
problem or a visualization problem.  Point (6) and (4)
will help tell the difference.


    Please let us know what you find.


          Regards,


                 Luis



-----------------------------------------------------------------------------
On Sun, Mar 7, 2010 at 11:31 AM, Aya El Gebeely
<aya.elgebeely at symbyo.com> wrote:
> Dear All,
>
> 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..
>
> The output transformation matrix does not map the two volumes correctly..
>
> 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
>
> Pipeline is as follow:
>
> typedef itk::VersorRigid3DTransform<double> TransformType;
>     TransformType::Pointer transform;
>
>  transform= TransformType::New();
>
>  typedef itk::LandmarkBasedTransformInitializer<
> TransformType,FixedImageType, MovingImageType > TransformInitializerType;
>     TransformInitializerType::Pointer initializer;
>
> initializer= TransformInitializerType::New();
>
> TransformInitializerType::LandmarkPointContainer  fixedLandmarks;
>     TransformInitializerType::LandmarkPointContainer movingLandmarks;
>     TransformInitializerType::LandmarkPointType m_point;
>
> initializer->SetFixedLandmarks(fixedLandmarks);
>     initializer->SetMovingLandmarks(movingLandmarks);
>     initializer->SetTransform( transform );
>     initializer->InitializeTransform();
>
>     TransformInitializerType::PointsContainerConstIterator  fitr =
> fixedLandmarks.begin(); //Fixed points iterator
>     TransformInitializerType::PointsContainerConstIterator  mitr =
> movingLandmarks.begin();// Moving points iterator
>
>     typedef TransformInitializerType::OutputVectorType  OutputVectorType;
>
>     while( mitr != movingLandmarks.end() )
>     {
>         transform->TransformPoint( *fitr );
>
>         ++mitr;
>         ++fitr;
>     }
>
>
>     OutputVectorType outputVec= transform->GetTranslation();
>
> VersorType myversor= transform->GetVersor();
>
> SbMatrix transformMatrix;
>
>     SbRotation rotation;
>
>     SbVec3f axis;
>     axis[0]=myversor.GetAxis()[0];
>     axis[1]=myversor.GetAxis()[1];
>     axis[2]=myversor.GetAxis()[2];
>
>     double x= myversor.GetScalar();
>     SbVec3f scaler;
>     scaler[0]=x;
>     scaler[1]=x;
>     scaler[2]=x;
>
>    rotation.setValue(axis,(float)(myversor.GetAngle()));
>
>     transformMatrix.setTransform(translation, rotation,scaler );
>
>
>     return transformMatrix;
>
> 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..
>
> Thanks a lot
> Aya R.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>


More information about the Insight-users mailing list