[vtkusers] small question ... how to pass data from vtkPNGreader to a vtkImageData Object ?

David Doria daviddoria at gmail.com
Tue May 19 16:10:17 EDT 2009


On Tue, May 19, 2009 at 3:09 PM, abdalrahman eweiwi <
abdalrahman.eweiwi at googlemail.com> wrote:

>
> hello guys
>
> small question ... how to pass data from vtkPNGreader to a vtkImageData
> Object ?
> --
> Regards
>
> Abdalrahman Eweiwi
> Msc in Media Informatics
> RWTH-AACHEN
> B-it


You mean something like this?

    vtkPNGReader* reader = vtkPNGReader::New();
    reader->SetFileName("Test.png");
    reader->Update();

    vtkImageData* imagedata = reader->GetOutput();

    vtkXMLImageDataWriter* writer = vtkXMLImageDataWriter::New();
    writer->SetInput(imagedata);
    writer->SetFileName("Test.vti");
    writer->Update();

What I don't understand is how to actually load this resulting file in
Paraview. If I open it like I normally do vtp files, it opens in a separate
window rather than in the normal "model space" where everything else opens.
Anyone know how to open it as if it was a slice of a volume data set?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090519/889c9c59/attachment.htm>


More information about the vtkusers mailing list