[vtkusers]ask about vtkIterativeClosestPointTransform
m26404030 at john.petra.ac.id
m26404030 at john.petra.ac.id
Fri Sep 14 21:47:47 EDT 2007
hey,i think i have the same problem with u john..
can someone please help us about this problem.
pliz help us...TT
Thanx in advance. =p
Quoting John Doe <vtkuser at yahoo.com>:
> i want to do 2d medical image registration on two images and i think i can
> use vtkIterativeClosestPointTransform to find the correspondence point
> between the two images. the first question is can i use the images as input?
> because i read that the input must be vtkPolyData type.
> i have tried it but still fail to get the right result..
>
> please help me..
> this is part of my code(still wrong)
>
> //
> vtkRenderer *aRenderer = vtkRenderer::New();
> vtkRenderWindow *renWin = vtkRenderWindow::New();
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
> renWin->AddRenderer(aRenderer);
> iren->SetRenderWindow(renWin);
>
> vtkDICOMImageReader *source=vtkDICOMImageReader::New();
> source->SetFileName("source.dcm");
> source->Update();
>
> vtkDICOMImageReader *target=vtkDICOMImageReader ::New();
> target->SetFileName("target.dcm");
> target->Update();
>
>
>
vtkIterativeClosestPointTransform*icp=vtkIterativeClosestPointTransform::New();
> icp->SetSource(source->GetOutput());
> icp->SetTarget(target->GetOutput());
>
> /////////dont understand these parts!! i just copied it from the
> references i found
> icp->SetCheckMeanDistance(1);
> icp->SetMaximumMeanDistance(0.01);
> icp->SetMaximumNumberOfIterations(30);
> icp->SetMaximumNumberOfLandmarks(50);
> icp->GetLandmarkTransform()->SetModeToRigidBody();
> icp->CheckMeanDistanceOn();
> icp->StartByMatchingCentroidsOn();
> icp->Update();
> /////////////////////////////////
>
> vtkTransformPolyDataFilter *filter=vtkTransformPolyDataFilter::New();
> filter->SetTransform(icp);
> filter->SetInput(source->GetOutput());
>
>
> vtkPolyDataMapper *map=vtkPolyDataMapper::New();
> map->SetInput(filter->GetOutput());
>
> vtkActor *actor=vtkActor::New();
> actor->SetMapper(map);
>
> aRenderer->AddActor(actor);
>
> renWin->Render();
> iren->Start();
> //
>
>
>
> thanx a lot =)
>
> Regards, John.
>
>
> ---------------------------------
> Check out the hottest 2008 models today at Yahoo! Autos.
More information about the vtkusers
mailing list