[vtkusers] Problem with vtkLandmarkTransform

vtk learner dandangege99 at yahoo.com
Tue Apr 13 21:37:44 EDT 2004


Hello everyone,

 

I want to use vtkLandmarkTransform to do some linear transformation. I have two sets of landmarks in two different coordinate systems and want to establish the transformation between these two spaces. Basically I gave two sets of landmarks to SetSourceLandmarks and SetTargetLandmarks, and each set has the same number of points. The problem is that I couldn’t get a correct transform matrix. 

            SourceLandmarks = []

            SourceLandmarks = vtkPoints()

            SourceLandmarks.InsertNextPoint(SLandmark1)

            SourceLandmarks.InsertNextPoint(SLandmark2)

            SourceLandmarks.InsertNextPoint(SLandmark3)

            SourceLandmarks.Modified()

 

            TargetLandmarks = []

            TargetLandmarks = vtkPoints()

            TargetLandmarks.InsertNextPoint(TLandmark1)

            TargetLandmarks.InsertNextPoint(TLandmark2)

            TargetLandmarks.InsertNextPoint(TLandmark3)

            TargetLandmarks.Modified()

            

            Transform = vtkLandmarkTransform()

            Transform.SetSourceLandmarks(SourceLandmarks)

            Transfrom.SetTargetLandmarks(TargetLandmarks)

            

            InputX = float(entryInputLandmarkX.get())

            InputY = float(entryInputLandmarkY.get())

            InputZ = float(entryInputLandmarkZ.get())

            InputLandmark = [InputX, InputY, InputZ]

            OutputLandmark = Transform.TransformFloatPoint(InputLandmark)

 

When I print the outputlandmark on the screen, I just got (nan, nan, nan)

Can I get the transform matrix by GetMatrix()? Could anyone help me? If anyone has such a script, could you share it with me? 

 

Thank you very much!

 

vtk learner


		
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040413/6e5cafb4/attachment.htm>


More information about the vtkusers mailing list