[vtkusers] vtkIteractiveClosestPoinTransform
Tim Hutton
tim.hutton at gmail.com
Tue Feb 20 07:08:34 EST 2007
Hi Dirce,
ICP is really only for surface meshes and similar, so applying it to
volume images is probably not what you want. It does accept
vtkDataSets so it looks more general than this, but sadly this is not
the case.
You probably want an image alignment routine, I suggest trying some of
the classes in ITK.
Tim
On 14/02/07, dirce <dirce at ipn.pt> wrote:
>
>
>
>
>
>
> 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
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
Tim Hutton - http://www.sq3.org.uk
Take the Organic Builder challenge -
http://www.sq3.org.uk/Evolution/Squirm3/OrganicBuilder/
More information about the vtkusers
mailing list