[Paraview] Create Cell or Point Data out of Image

Christian Werner christian.werner at rwth-aachen.de
Thu Mar 11 04:15:32 EST 2010


Hello!

I'd like to use the Threshold filter on some image data I have (2d and 
3d). 2d images would be any loadable .jpg .tif .png and 3d images come 
from ITK and are converted back to VTK.

The filter is greyed out, and volume rendering is not possible:

Error:

Cannot volume render since no point (or cell) data available, even if I 
try to render the 3d volume from ITK.


On the other hand I am able to access process my point- and cell-less 
data in a custom filter like that:


    input->GetDimensions(dim);
    int numvox  = dim[0]*dim[1]*dim[2];
    int numcomp = input->GetNumberOfScalarComponents();
   
    vtkDataArray* inarray  = input->GetPointData()->GetScalars();
    vtkDataArray* outarray = output->GetPointData()->GetScalars();
   
    unsigned char in=255;
    unsigned char out=0;
   
    for (int component=0; component < numcomp; component++) { ...


This is an extract of the SimpleExecute  function I overwrite from 
vtkSimpleImageToImageFilter. So  here I am working on PointData... ?


Is there a way to convert the data such that I have proper cell and 
point data?


Best regards,
Christian







More information about the ParaView mailing list