Thank you very much. Now things have become a little clearer. Anyway there are a few things which I do not yet understand.

I see now from the source of the Threshold plugin that the data to be processed is actually obtained in three different ways:

vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();

vtkDataArray *inScalars = this->GetInputArrayToProcess(0,inputVector); //inputVector is the input information vector


where the latter seems to be the array containing the actual volume data. The decision if a cell or point goes through the thresholding criteria is made a little later:

keepCell = this->EvaluateComponents( inScalars, ptId );
or
keepCell = this->EvaluateComponents( inScalars, cellId );


This raises two questions:

1) are the ptId and cellId disjunct?
2) if yes, does that mean that the InputArray contains point AND cell data? This clearly would require additional memory which is bad if you are working with big volumes.

Also I see the use of a DataSet which seems to hold all the cells of the volume and each cell seems to contain points ( these must be 8, right? ) I guess these points store coordinates? At least there is still another array containing only IDs. It seems as if there actually is a bunch of redundant information stored when I read structured grid, or at least when executing the Threshold filter.

This would explain why the memory usage skyrockets when manipulating our 700MB (small version!) volume.

I don't want to complain here about anything, that memory issue is another story. More important to me is that I understand the structure of this.


Best regards,
Christian




Moreland, Kenneth wrote:
In a 3D structured grid, there is the concept of points and cells and VTK does in fact differentiate the two. In particular, 8 points make up a hexahedral-shaped voxel cell. As is dictated by the topology, there is one fewer cell than points in each dimension. For example, if the grid has 512x512x128 points, it will have 511x511x127 cells.

The raw image reader simply assumes you want to load the data as point data and creates the grid accordingly. I don’t think there is any way to make it load the data as cells. I can think of three ways to handle this.

   1. Close your eyes, take a deep breath, and find the inner peace to
      simply let ParaView/VTK treat the data as point data. I cannot
      think of any operation on cell data that can not be done on
      point data. You just have to realize that ParaView will also let
      you do some operations that may not be appropriate for cell data
      (particularly those that interpolate the values in the cells).
   2. Make a filter that converts the structured grid that has point
      data to one that has cell data. It would simply create a new
      topology on the output with one more point in every dimension
      and then shallow copy the data as cell data. It should not be
      too hard to implement. No, I am not volunteering.
   3. Make a new reader that reads the data as cell data as it should.


I hope that helps.

-Ken


On 2/26/10 8:45 AM, "Christian Werner" <christian.wer...@rwth-aachen.de> wrote:

    Hello!

    I am studying the Threshold Filter to dive more into the mechanics of
    filtering and I just want to make sure I got the meaning of points and
    cells right, especially when I have a structured grid volume as input.

    Such input comes with some typical raw volume file which consists of,
    lets say, 512x512x128 voxels all of them having some value.

    Is it that this value is actually stored in a vtkPoints list that
    contains uniformly distributed points in the volume? And a vtkCell in
    this case gets the same value as the point because it contains
    only this
    single point in its center? ( with value I mean what you get from
    GetComponent(id,c) )

    So if I had some arbitrary (non-structured) input, a cell's value
    would
    be the average of all points lying inside the cell and changing
    the cell
    layout, i.e. making all cells bigger would accordingly change the
    cell-point relationship and thus the cells value?


    Best regards,
    Christian
    _______________________________________________
    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 ParaView Wiki at:
    http://paraview.org/Wiki/ParaView

    Follow this link to subscribe/unsubscribe:
    http://www.paraview.org/mailman/listinfo/paraview




**** Kenneth Moreland
*** Sandia National Laboratories
***********
*** *** *** email: kmo...@sandia.gov
** *** ** phone: (505) 844-8919
*** web: http://www.cs.unm.edu/~kmorel <http://www.cs.unm.edu/%7Ekmorel>


_______________________________________________
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 ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to