[vtkusers] vtkIteractiveClosestPoinTransform

dirce dirce at ipn.pt
Wed Feb 14 10:21:22 EST 2007


 

 Hi, all

 

I'm having troubles in implementing the ICP algorithm. I have a structured
dataset and i whant to select slices and register them.

 

In my code strucp is a structured point data set.

 

voi1=vtkExtractVOI::New();//Use to extract slices

      voi2=vtkExtractVOI::New();

      voi1->SetInput(strucp);///

      voi2->SetInput(strucp);///

      voi1->SetVOI(0,31,0,31,2,2);

      voi2->SetVOI(0,31,0,31,5,5);

 

 

icp=vtkIterativeClosestPointTransform::New();

      icp->SetSource(voi1->GetOutput());

      icp->SetTarget(voi2->GetOutput());

      icp->SetMaximumNumberOfIterations(80);

      icp->SetCheckMeanDistance(1);

      icp->SetMaximumMeanDistance(0.0001);

      icp->SetStartByMatchingCentroids(1);

      icp->SetMaximumNumberOfLandmarks(100);

      icp->SetMeanDistanceModeToRMS();

      icp->GetLandmarkTransform()->SetModeToRigidBody();

 

//I try to get the mean distance at it's always zero

 

float nint=icp->GetMeanDistance();

 

 

//To visualize i've try to use

transform=vtkTransformPolyDataFilter::New();

      transform->SetTransform(icp);

transform->SetInput((vtkPolyData*)voi1);

 

//But i can see anything

 

I think the problem is in the icp part. I get zero number of interactions
and zero mean distance.

It seems that the algorithm don't start, i have also use the icp->update()
and the result is the same.

 

PLEASE, i really need help.

If someone knows what's wrong with my code i'll appreciate any commentary.

 

Thank's in advance

Dirce

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070214/909fdff8/attachment.htm>


More information about the vtkusers mailing list