[vtk-developers] is vtkSelectionSource::SetInverse broken?
Jeff Baumes
jeff.baumes at kitware.com
Thu Feb 3 13:22:55 EST 2011
I was able to reproduce this. It was a bug in that filter (actually, the bug
is in vtkConvertSelection). Threshold selections were being double-negated.
The fix is now committed to VTK master.
Jeff
On Thu, Feb 3, 2011 at 11:20 AM, David E DeMarle
<dave.demarle at kitware.com>wrote:
> I am guessing that vtkExtractSelectedRows() has a bug and does not
> respect the inverse flag.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-371-3971 x109
>
>
>
> On Thu, Feb 3, 2011 at 11:13 AM, William McLendon <wcmclen at sandia.gov>
> wrote:
> > Anyone else seeing this? I'm trying to filter out edges in a table that
> are
> > really close or equal to zero using code like this:
> >>
> >> # filter out rows that have 0 area.
> >> areaRowSelection = vtkSelectionSource()
> >> areaRowSelection.SetContentType(vtkSelectionNode.THRESHOLDS)
> >> areaRowSelection.SetFieldType(vtkSelectionNode.ROW)
> >> areaRowSelection.SetInverse(1) # selection should exclude these
> rows
> >> areaRowSelection.SetArrayName('area')
> >> areaRowSelection.AddThreshold(-1E-15, 1E-15) # non-matches=0,
> >> matches=1
> >>
> >> filteredTable = vtkExtractSelectedRows()
> >> filteredTable.SetInputConnection(0, vert_source_csv.GetOutputPort() )
> >> filteredTable.SetInputConnection(1, areaRowSelection.GetOutputPort()
> )
> >> filteredTable.Update()
> >
> > If I understand the selectionsource filter properly, then adding
> > SetInverse(1) should have the threshold filter select rows that are not
> in
> > the threshold range, right? But this is the result I'm getting:
> >>
> >> +-------------+-------------+-------------+-------------+
> >> | area | boundary are| centroid x | centroid y |
> >> +-------------+-------------+-------------+-------------+
> >> | 0 | 0 | -72.8572 | 41.2743 |
> >> | 0 | 0 | -73.8846 | 33.2743 |
> >> | 0 | 0 | -71.8381 | 36.2743 |
> >> | 0 | 0 | -72.8288 | 31.2743 |
> >
> > Am I missing something? I'm going from the doxygen api at:
> >
> >
> http://www.vtk.org/doc/nightly/html/classvtkSelectionSource.html#accd91cdb84f1c13c020a736d521f2686
> >
> > Thanks!
> > -William
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtk-developers
> >
> >
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
--
Jeff Baumes, Ph.D.
Technical Lead, Kitware Inc.
(518) 881-4932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110203/6f6eb5f7/attachment.html>
More information about the vtk-developers
mailing list