[vtkusers] vtkPolyData point coordinates

Sercani sercanimailgroups at gmail.com
Fri Jul 17 11:57:51 EDT 2009


Hi folks;
I  need to know what is the coordinate system of vtkPolyData's point 
coordinates... My code is like this:
   vtkPolyData poly = new vtkPolyData();
   spline.GetPolyData(poly); //spline is vtkSplineWidget
   double pcoords[] = new double[3];
        for (int i = 0; i < poly.GetNumberOfCells(); i++) {
            vtkCell cell = new vtkCell();
            cell = poly.GetCell(i);
            for (int j = 0; j < cell.GetNumberOfPoints(); j++) {
                Point3D temp = new Point3D(cell.GetPoints().GetPoint(j));
                splinePoints.InsertNextPoint(temp.getAll());
                int ijk[] = new int[3];
//                vtkCoordinate coor = new vtkCoordinate();
//                coor.SetCoordinateSystemToViewport();
//                coor.SetValue(temp.getAll());
//                
temp.setAll(coor.GetComputedWorldValue(this.GetRenderer()));
                
reader.GetOutput().ComputeStructuredCoordinates(temp.getAll(), ijk, 
pcoords);
                System.out.println("Structured Coordinates = " + ijk[0] 
+ ", " + ijk[1] + ", " + ijk[2]);
              }
        }

I'm trying to get the vtkSplineWidget's polyData's point coordinates and 
according to these coordinates, i must get the underlying image pixel's 
structured coordinates...But i think point coordinates of vtkPolyData is 
not in world coordinate system, so i tried viewport coordinate system, 
but i'm still getting wrong results(negative structured coordinates etc.)...

Thanks for your help already.
Yours sincerely.
Sercan.



More information about the vtkusers mailing list