[vtkusers] save mhd from QVTKWidget

G G greenlander1986 at gmail.com
Thu Mar 17 11:42:01 EDT 2011


Hi everyone,
I have some problem. I would like to save *.mhd file from
QVTKWidgetcomponent. I tried to seach on google, but any solution.

        qVTK3->setAutomaticImageCacheEnabled(true);
        vtkSmartPointer<vtkMetaImageWriter> writer =
vtkSmartPointer<vtkMetaImageWriter>::New();
        qVTK3->saveImageToCache();
        writer->SetInput(qVTK3->cachedImage());
        writer->SetFileName(fileName);
        std::string  str = fileName + ".raw";
        writer->SetRAWFileName(str.c_str());
        writer->Write();

qVTK3 is QVTKWidget.

This code save empty files...
I have to recomend, that I loaded *.mha or *.mhd files.
I will be very happy for each help...
Thanks a lot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110317/28641cb6/attachment.htm>


More information about the vtkusers mailing list