[vtkusers] Strange behavior of vtkImageAlgorithm subclass - empty output

Bill Lorensen bill.lorensen at gmail.com
Fri Jan 29 23:38:12 EST 2010


What results from:
output->Print(std::cout);

On Fri, Jan 29, 2010 at 6:34 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Would someone mind taking a look at this:
> http://www.rpi.edu/~doriad/VTK_List/vtkVoxelizePolyData/
>
> I write a file (inside.vti) of the output at the very end of
> RequestData. This works properly, the file is correct.
>
> However, as soon as I get the output of the filter, I write another
> file, outside.vti. I would expect this to be identical to inside.vti.
> However, it is empty (0 cell, 0 points)!
>
> Here is a potential clue:
>
> I write the ImageData called "grid" (this is the part that produces
> the correct file)
>
>  vtkSmartPointer<vtkXMLImageDataWriter> writer =
>      vtkSmartPointer<vtkXMLImageDataWriter>::New();
>  writer->SetFileName("inside.vti");
>  writer->SetInput(grid);
>  writer->Write();
>
> Then I copy it into the output:
>  output->ShallowCopy(grid);
>
> Then, still from inside RequestData, I try to write the file again,
> this time using "output" instead of "grid":
>  {
>  vtkSmartPointer<vtkXMLImageDataWriter> writer =
>      vtkSmartPointer<vtkXMLImageDataWriter>::New();
>  writer->SetFileName("inside_output.vti");
>  writer->SetInput(output);
>  writer->Write();
>  }
>
> and it segfaults.
>
> Any thoughts on why this might be happening?
>
> Thanks,
>
> David
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list