[vtkusers] Missing update extent request in vtkExtractVOI?

Karsten Tausche karsten.tausche at student.hpi.uni-potsdam.de
Sat Oct 11 08:10:54 EDT 2014


Hi everyone,

I tried to use vtkExtractVOI to decrease the resolution of a 
vtkImageData/vtkStructuredPoints data set. This works fine when I set 
the sample rate before I connect the filter to the pipeline. But 
changing the sample rate while rendering always results in an error like 
this:

"ERROR: In 
..\..\..\Common\ExecutionModel\vtkStreamingDemandDrivenPipeline.cxx, 
line 857
vtkCompositeDataPipeline (0000000005D6E1A0): The update extent specified 
in the information for output port 0 on algorithm 
vtkExtractVOI(0000000005D92710) is 0 10 0 10 0 0, which is outside the 
whole extent 0 9 0 10 0 0."

This behavior also depends on the initial sample rate. With the defaults 
(1, 1, 1), the error message pops up after changing the rate, and the 
filter seems produce the expected result. When I set different initial 
values and increase them while rendering, I get the error message above, 
but the filter result seems correct. When decreasing the sample rate, I 
don't get an error, but the filter decreases the size of the rendered 
image.

I'm using the current VTK master. I appended a small example the 
produces this error; it doesn't render any visible points but I didn't 
know how to enforce the required updates without adding the filter to a 
rendering pipeline.

BTW the error also occurs with vtkStructuredGrid+vtkExtractGrid.

Thanks,
Karsten

-------------- next part --------------

#include <vtkSmartPointer.h>
#include <vtkStructuredPoints.h>
#include <vtkExtractVOI.h>
#include <vtkImageToPolyDataFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkImageMapper.h>
#include <vtkActor.h>

#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>

#define VTK_CREATE(CLASS, NAME) vtkSmartPointer<CLASS> NAME = vtkSmartPointer<CLASS>::New();

int main()
{
    VTK_CREATE(vtkStructuredPoints, grid);
    grid->SetExtent(0, 10, 0, 10, 0, 0);

    VTK_CREATE(vtkExtractVOI, extract);
    extract->SetInputData(grid);
    
    VTK_CREATE(vtkImageToPolyDataFilter, polyData);
    polyData->SetInputConnection(extract->GetOutputPort());
    VTK_CREATE(vtkPolyDataMapper, mapper);
    mapper->SetInputConnection(polyData->GetOutputPort());
    VTK_CREATE(vtkActor, actor);
    actor->SetMapper(mapper);

    VTK_CREATE(vtkRenderer, renderer);
    renderer->AddActor(actor);

    VTK_CREATE(vtkRenderWindow, rw);
    rw->AddRenderer(renderer);

    VTK_CREATE(vtkRenderWindowInteractor, interactor);
    rw->SetInteractor(interactor);
    interactor->Initialize();
    interactor->Render();

    extract->SetSampleRate(5, 1, 1);

    interactor->Start();

    return 0;
}


More information about the vtkusers mailing list