<div dir="ltr">I did this and I still get all points that contornos returns :( any idea what I'm doing wrong?<div><br></div><div><div> vtkPolyDataConnectivityFilter contornos = new vtkPolyDataConnectivityFilter();</div>
<div> contornos.SetInputConnection(skinextractor.GetOutputPort());</div><div> contornos.SetExtractionModeToLargestRegion();</div><div> contornos.SetColorRegions(1);</div><div><br></div><div>
vtkCleanPolyData removepoints = new vtkCleanPolyData();</div><div> removepoints.SetInput(contornos.GetOutput());</div><div> removepoints.Update();</div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 6:46 PM, Matias Montroull <span dir="ltr"><<a href="mailto:matimontg@gmail.com" target="_blank">matimontg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks, so to which object I need to apply the vtkCleanPolyData? to my vtkpolydata?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 16, 2014 at 6:25 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The vtkPolyDataConnectivityFilter probably only removes cells,<br>
not points. Pass your data through vtkCleanPolyData after the<br>
connectivity filter to get rid of any extra points.<br>
<div><div><br>
On Thu, Jan 16, 2014 at 2:19 PM, Matias Montroull <<a href="mailto:matimontg@gmail.com" target="_blank">matimontg@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I have a problem trying to obtain the inner points of a 3D reconstruction. I<br>
> can visualize just fine but when I save the points and then re open to see<br>
> them, I still see the image as when it was without the DataConnectivity<br>
> Filter. Why that may be? SkinNormals gets the output of the filter..<br>
><br>
> here's the code:<br>
><br>
> vtkContourFilter skinextractor = vtkContourFilter.New();<br>
> skinextractor.SetInputConnection(readerdicom.GetOutputPort());<br>
> skinextractor.GetValues();<br>
> skinextractor.SetValue(0, -800);<br>
><br>
> vtkPolyDataConnectivityFilter contornos = new<br>
> vtkPolyDataConnectivityFilter();<br>
> contornos.SetInputConnection(skinextractor.GetOutputPort());<br>
> contornos.SetExtractionModeToLargestRegion();<br>
> contornos.Update();<br>
> contornos.SetColorRegions(1);<br>
><br>
><br>
> vtkPolyDataNormals skinnormals = vtkPolyDataNormals.New();<br>
> //skinnormals.SetInputConnection(skinextractor.GetOutputPort());<br>
> skinnormals.SetInputConnection(contornos.GetOutputPort());<br>
> skinnormals.SetFeatureAngle(90.0);<br>
> skinnormals.ComputePointNormalsOn();<br>
><br>
> vtkPolyData polys = new vtkPolyData();<br>
> polys = skinnormals.GetOutput();<br>
> polys.Update();<br>
> polys.BuildCells();<br>
> int numberofpoints = polys.GetNumberOfPoints();<br>
><br>
> for (int i = 0; i < polys.GetNumberOfPoints(); i ++)<br>
> {<br>
> double[] p = new double[3];<br>
> p = polys.GetPoint(i);<br>
> POI poi_mesh_individual = new POI();<br>
> poi_mesh_individual.POI_x = Convert.ToDecimal(p[0]);<br>
> poi_mesh_individual.POI_y = Convert.ToDecimal(p[1]);<br>
> poi_mesh_individual.POI_z = Convert.ToDecimal(p[2]);<br>
> POIs_3D.Add(poi_mesh_individual);<br>
> }<br>
><br>
> using (StreamWriter writer = new StreamWriter(@"C:/tracker/" +<br>
> "mesh.poi", false)) // False to overwrite the file; True to append data to<br>
> the file;<br>
> {<br>
> for (int i = 0; i < POIs_3D.Count; i++)<br>
> {<br>
> writer.WriteLine(POIs_3D[i].POI_x + ";" +<br>
> POIs_3D[i].POI_y + ";" + POIs_3D[i].POI_z);<br>
> }<br>
><br>
> }<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>