[vtkusers] How to extract points and lines?

Andrej Gluhov realandron at gmail.com
Thu Apr 1 06:16:03 EDT 2010


In the application the user first selects a value for the filter
(m_iso.SetValue (0, (double) numcontourValue.Value)) Then the screen should
display a certain number of isolines on a certain criterion.
I seem to find the desired filter vtkPolyDataConnectivyFilter.


Jothybasu K Selvaraj wrote:
> 
> 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
>>
>>
> 
> _______________________________________________
> 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
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-extract-points-and-lines--tp28105498p28106752.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list