[Insight-users] About TransformPoint

Steven ITK itklearner at gmail.com
Thu Aug 30 20:44:16 EDT 2007


Hi, ITK Users,

I have a compiling error when using TransformPoint:

Error 1 error C2664:
'itk::MatrixOffsetTransformBase<TScalarType,NInputDimensions,NOutputDimensions>::TransformPoint'
: *cannot convert* parameter 1 from *'PointType' to 'const
itk::Point<TCoordRep,NPointDimension> &' .*

What I am trying to do is testing the example of Iterative Closest Point
Registration method (PointSetToPointSetRegistrationMethod). The registration
is working, but I had the problem to transform the moving pointset to
registered pointset using the transformation matrix obtained from the
reigstration.

Here is my code:
//type define
 typedef itk::PointSet< float, Dimension >   PointSetType;
 PointSetType::Pointer fixedPointSet  = PointSetType::New();
 PointSetType::Pointer movingPointSet = PointSetType::New();
 PointSetType::Pointer registeredPointSet = PointSetType::New();
 typedef PointSetType::PointType     PointType;
 PointType fixedPoint;
 PointType movingPoint;
 PointType registeredPoint;
 typedef PointSetType::PointsContainer  PointsContainer;
 PointsContainer::Pointer fixedPointContainer  = PointsContainer::New();
 PointsContainer::Pointer movingPointContainer = PointsContainer::New();
 PointsContainer::Pointer registeredPointContainer = PointsContainer::New();

//Read in moving pointset and fixed pointset

//do the registration

got the transformation stored in *'transform'*

// transform moving pointset

 for(i = 0; i<movingPointSet->GetNumberOfPoints(); i++)
 {
  movingPointSet->GetPoint( i, &movingPoint );
  *registeredPoint =   transform->TransformPoint( movingPoint );//error here
*
  registeredPointContainer->InsertElement( i, registeredPoint );
 }
 registeredPointSet->SetPoints(registeredPointContainer);
==============================================================
I also tried this, got the similar error:
 typedef itk::TransformMeshFilter<PointSetType, PointSetType, TransformType>
TransformFilterType;
 TransformFilterType::Pointer transformfilter= TransformFilterType::New();
 transformfilter->SetInput(movingPointSet);
 transformfilter->SetTransform(transform);
 try
 {
  transformfilter->Update();
 }
 catch( itk::ExceptionObject & e )
 {
  DisplayITKError(e);
  return -1;
 }
 registeredPointSet = transformfilter->GetOutput();

===============================================================

Can you help me out of this? Thank you.

Steven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070831/afb92574/attachment.htm


More information about the Insight-users mailing list