[vtkusers] Re: vtkThreshold Question
Amy Squillacote
amy.squillacote at kitware.com
Fri Mar 31 13:41:12 EST 2006
At 11:54 AM 3/31/2006, Andrea Gavana wrote:
>Hello NG,
>
> >It seems to me (if I have read correctly the doc), that vtkExtractCells
> >requires a vtkDataSet, a file in other words... is that correct?
>
>Sorry, this is wrong. I supposed it because when I call the method as:
>
># grid is a vtkUnstructuredGrid
>
>newgrid = vtk.vtkExtractCells(grid)
>newgrid.SetCellList(mylist)
>
You can't pass in your unstuctured grid to the constructor of
vtkExtractCells. It must be passed to vtkExtractCells using either
SetInput or SetInputConnection. The above code segment should look
something like the following.
vtkExtractCells newgrid = new vtkExtractCells();
newgrid.SetInput(grid);
newgrid.SetCellList(mylist);
- Amy
>it raises an error by saying that input of vtkExtractCells must be a
>string... (!!!!!) a string?? Which string? What I have is a
>vtkUnstructuredGrid and a list of cell Ids... where should I take that string?
>
>Thank you for every suggestion..
>
>Andrea.
>
>
>On 3/31/06, Andrea Gavana
><<mailto:andrea.gavana at gmail.com>andrea.gavana at gmail.com> wrote:
>Hello Goodwin,
>
> thank you very much for your help. It seems to me (if I have
> read correctly the doc), that vtkExtractCells requires a
> vtkDataSet, a file in other words... is that correct?
>Well, I already have a vtkUnstructuredGrid built by reading an
>external file (not VTK format). The idea of extracting cells based
>on Ids implemented in vtkExtractCells is very promising... there is
>nothing similar but without using a vtkDataSet?
>The problem is, I should be able to filter out cells by certain
>criteria: for example, at the moment I am trying to exclude inactive
>cells using this ACTNUM, but I would like to be able to filter out
>the cell based on, i.e., cell centroid depth, cell permeability,
>cell saturations and so on. This seems to me something like a
>vtkFilter*, and if every time I set up a new filter I have to create
>a file and re-read it I will end up in doing slow things. I am too
>newbie to browse in the right doc places...
>
>Thank you very much for your suggestions.
>
>Andrea.
>
>
>On 3/31/06, Goodwin Lawlor
><<mailto:goodwin.lawlor at ucd.ie>goodwin.lawlor at ucd.ie > wrote:
>Andrea Gavana wrote:
> > Hello NG,
> >
> > sorry if this question is simple, but I have searched over the web
> > and I have't found anything close to what I should so. Basically, I have
> > a vtkUnstructuredGrid in which I set the cell data using some property.
> > By switching with a wxPython radiobutton I can change on the fly the
> > property displayed on the grid (like permeability, saturation, cell
> > centroids and so on). Well, my group of data has also a property called
> > "ACTNUM", that tells which cells are active (ACTNUM=1) and which are not
> > active (ACTNUM=0). Active cells should be displayed while inactive cells
> > should be hidden.
> > I have succeeded to use vtkThreshold to filter out inactive cells, but
> > only when I set cell_data=ACTNUM, using something like:
> >
> > grid.GetCellData().SetScalars(ACTNUM)
> >
> > What I would like to do is, whatever property is displayed on screen, to
> > hide inactive cells based on ACTNUM value. For example, I would like to
> > display cell centroids property on the grid filtering out inactive
> > cells. Something like:
> >
> > grid.GetCellData().SetScalars(Whatever)
> > ??? Apply threshold on grid using ACTNUM ???
> >
> > Is there a way to do this?
> >
> > Thank you very much for your help and suggestions.
> >
> > Andrea.
>Hi Andrea,
>
>You could try vtkExtractCells to filter out cells. You would have to
>loop through ACTNUM and create the appropriate vtkIdList to apply to the
>filter. Alternatively, you could try to convert your scalars to RGBA
>values, where ACTNUM determines the A value (the opacity).
>
>hth
>
>Goodwin
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
><http://www.vtk.org/Wiki/VTK_FAQ>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
><http://www.vtk.org/mailman/listinfo/vtkusers>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
>
>--
>"Imagination Is The Only Weapon In The War Against Reality."
>
><http://xoomer.virgilio.it/infinity77/>http://xoomer.virgilio.it/infinity77/
>
>
>
>
>--
>"Imagination Is The Only Weapon In The War Against Reality."
>
><http://xoomer.virgilio.it/infinity77/>http://xoomer.virgilio.it/infinity77/
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the 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/20060331/35d729ab/attachment.htm>
More information about the vtkusers
mailing list