[vtkusers] Extract Polydata points with same scalar value
Sara Rolfe
smrolfe at u.washington.edu
Tue Jun 26 18:15:38 EDT 2012
Actually, I just realized that vtkThresholdPoints appears to have
extracted the points and the connections were lost. So when I run it
though the vtkPolydataConnectivityFilter there is one region for each
point in the polydata. Could you let me know if there's a way to get
vtkThresholdPoints to preserve connectivity, or if there's a better
approach?
I've also tried using the vtkPolydaytaConnectivity filter operating on
the scalar data, but was only able to get it to return the largest
region for each label.
Thanks,
Sara
On Jun 26, 2012, at 2:16 PM, Sara Rolfe wrote:
> Hi Jochen,
>
> I was able to use vtkThresholdPoints to do exactly what I wanted.
> Thanks for your help!
>
> Sara
>
> On Jun 26, 2012, at 1:52 AM, Jochen K. wrote:
>
>> Hi Sara,
>>
>> you may try to separate your polydata by scalar values using a
>> vtkThresholdPoints object:
>>
>> untested snippet:
>> //...
>> vtkSmartPointer<vtkThresholdPoints> threshold =
>> vtkSmartPointer<vtkThresholdPoints>::New();
>> threshold.SetInput(contourPolydata);
>> threshold.SetInputArrayToProcess(
>> 0,
>> 0,
>> vtkDataObject::FIELD_ASSOCIATION_POINTS,
>> vtkDataSetAttributes::SCALARS,
>> "NameOfYourScalarArray");
>> threshold->ThresholdBetween(0, 1); // would give you the
>> points labeled with 1
>> // you may have to experiment with the value range a bit
>> //threshold->ThresholdBetween(1, 2); // would give you the
>> points labeled with 2
>>
>> threshold->Update();
>>
>> vtkSmartPointer<vtkPolyData> part =
>> vtkSmartPointer<vtkPolyData>::New();
>> part->SetInputConnection(threshold->GetOutputConnection());
>> //...
>>
>> best regards
>> Jochen
>> View this message in context: Re: Extract Polydata points with same
>> scalar value
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120626/97f1e931/attachment.htm>
More information about the vtkusers
mailing list