[vtkusers] Reading a vti file with vtkStreamingDemandDrivenPipeline

Brugger, Eric brugger1 at llnl.gov
Fri Jul 5 13:48:09 EDT 2013


Hi,

I have a vti file with an image that is a portion of the entire extent (e.g.

ImageData WholeExtent="0 532 0 532 0 0"

and

Piece Extent="0 266 0 266 0 0"

When I read in the image it gives me an array that is 532 x 532 with a piece that is 266 x 266 that is filled in.

How do I have the reader only return an array that is 266 x 266?

I tried using the vtkStreamingDemandDrivenPipeline to do this with no luck.

Thanks,

Eric

Here is the code I am using:

*********************** START CODE FRAGMENT ********************

vtkXMLImageDataReader *reader = vtkXMLImageDataReader::New();
reader->SetFileName("image.vti");

vtkInformation *outInfo = reader->GetExecutive()->GetOutputInformation(0);

int ext[6];
ext[0] = 0; ext[1] = 266; ext[2] = 0; ext[3] = 266; ext[4] = 0; ext[5] = 0;

outInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext, 6);
outInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1);

reader->Update();

dataset = reader->GetOutput();

*********************** END CODE FRAGMENT ********************

Here is the image file without the data:

<VTKFile type="ImageData" version="0.1" byte_order="LittleEndian">
  <ImageData WholeExtent="0 532 0 532 0 0" Origin="0 0 0" Spacing="1 1 1">
    <Piece Extent="0 266 0 266 0 0">
      <CellData Scalars="PNGImage">
        <DataArray type="UInt8" Name="PNGImage" NumberOfComponents="4"
format="appended" RangeMin="254" RangeMax="487.94364429" offset="0"   />
      </CellData>
    </Piece>
  </ImageData>
  <AppendedData encoding="raw">
      ********** THE IMAGE DATA ********
  </AppendedData>
</VTKFile>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130705/99a672b2/attachment.htm>


More information about the vtkusers mailing list