[vtkusers] save mhd from QVTKWidget

Dženan Zukić dzenanz at gmail.com
Thu Mar 17 12:18:55 EDT 2011


Are you trying to save 2D or 3D image? I believe your code is attempting to
save rendered framebufferm which is a 2D image. MetaImage is usually used
for 3D data, although it can save 2D data too. This 2D/3D discrepancy might
be your problem.

HTH

On Thu, Mar 17, 2011 at 16:42, G G <greenlander1986 at gmail.com> wrote:

> 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
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110317/326ec496/attachment.htm>


More information about the vtkusers mailing list