[vtkusers] ActiViz Points of Polydata in mm or pixels?

Matias Montroull matimontg at gmail.com
Fri Jan 17 08:34:56 EST 2014


Hi,

I've extracted points out of my polydata this way:
My question is:
are these points in mm? pixels?

here's a sample of what I got:

 150.5861 120.1173 7.200073  151.172 120.1173 7.164073  151.172 120.0168
7.200073  151.7579 120.1173 7.146607  151.7579 119.9575 7.200073  152.3439
120.1173 7.123975  152.3439 119.8792 7.200073  152.9298 120.1173 7.107765
152.9298 119.8332 7.200073

  vtkContourFilter skinextractor = vtkContourFilter.New();
            skinextractor.SetInputConnection(readerdicom.GetOutputPort());
            skinextractor.SetValue(0, -800);

            vtkPolyDataConnectivityFilter contornos = new
vtkPolyDataConnectivityFilter();
            contornos.SetInputConnection(skinextractor.GetOutputPort());
            contornos.SetExtractionModeToLargestRegion();
            contornos.SetColorRegions(1);

            vtkCleanPolyData removepoints = new vtkCleanPolyData();
            removepoints.SetInput(contornos.GetOutput());
            removepoints.Update();

            vtkPolyDataNormals skinnormals = vtkPolyDataNormals.New();
            //skinnormals.SetInputConnection(skinextractor.GetOutputPort());
            skinnormals.SetInputConnection(removepoints.GetOutputPort());
            skinnormals.SetFeatureAngle(90.0);
            skinnormals.ComputePointNormalsOn();

            vtkPolyData polys = new vtkPolyData();
            polys = skinnormals.GetOutput();
            polys.Update();



            //polys.BuildCells();
            int numberofpoints = polys.GetNumberOfPoints();

            for (int i = 0; i < polys.GetNumberOfPoints(); i ++)
            {
                double[] p = new double[3];
                p = polys.GetPoint(i);
                POI poi_mesh_individual = new POI();
                poi_mesh_individual.POI_x = Convert.ToDecimal(p[0]);
                poi_mesh_individual.POI_y = Convert.ToDecimal(p[1]);
                poi_mesh_individual.POI_z = Convert.ToDecimal(p[2]);
                POIs_3D.Add(poi_mesh_individual);
            }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140117/344a3cf6/attachment.html>


More information about the vtkusers mailing list