[vtkusers] How to extract points and lines?
Jothybasu K Selvaraj
jothybasu at gmail.com
Thu Apr 1 05:56:19 EDT 2010
Why don't you independently set the values required like
setValue(0,50),setValue(1,60).
Jothy
2010/4/1 Andrej Gluhov <realandron at gmail.com>
> I use vtkContourFilter on DICOM-Image. The filter generates several
> isolines. How to extract points and lines for each isolines or is it
> impossible? I want to remove some isolines, but do not know how.
>
> vtkDICOMImageReader DicomReader = new vtkDICOMImageReader();
> DicomReader.SetFileName(m_strFilePath);
> DicomReader.Update();
>
> vtkContourFilter m_iso = new vtkContourFilter();
> m_iso.SetInputConnection(DicomReader.GetOutputPort());
> m_iso.SetValue(0, (double)numcontourValue.Value);
> m_iso.Update();//generate several isolines,but some need to
> remove
>
> vtkPolyData PD = m_iso.GetOutput();
> int NumberOfPoints = PD.GetNumberOfPoints();
>
> using (FileStream fs = new FileStream("Points.txt",
> FileMode.Create))
> {
> using (StreamWriter sw = new StreamWriter(fs))
> {
> for (int i = 0; i < NumberOfPoints; i++)//points for
> all isolines
> {
> double[] xyz = PD.GetPoint(i);
> sw.Write(xyz[0].ToString() + " " +
> xyz[1].ToString() + " " + xyz[2].ToString() + "\r\n");
> sw.Flush();
> }
> }
> }
> --
> С Уважением,
> Андрей.
> Best regards, Andrew
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100401/e0fc0862/attachment.htm>
More information about the vtkusers
mailing list