[vtkusers] Save images of a volume in 1: 1

Sankhesh Jhaveri sankhesh.jhaveri at kitware.com
Thu Jul 9 16:15:07 EDT 2015


Hi Jose,

vtkWindowToImageFilter grabs a screenshot of the render window.
To write the image out, you will need to pass the image to the writer.

Something like,
writer->SetInputData(<image>)



Warm Regards,

Sankhesh Jhaveri
Research & Development Engineer
Kitware, Inc.
*Phone*: (518) 881 4417
*Fax*: (518) 371 4573



On Tue, Jul 7, 2015 at 8:22 AM, Jose Barreto <jose.de.paula at live.com> wrote:

> I'm using a vtkVolume to display a DICOM volume.
>
> How should I proceed to save the image generated by this vtkVolume ensuring
> its size in 1: 1? And if possible with a dpi of 300?
>
> I saw the way to save is to be ...
>
> Void UCModulo3D::WindowToJPG(vtkRenderWindow * rw, const char * filename)
> {
>         vtkWindowToImageFilter * filter = vtkWindowToImageFilter::New();
>         filter->SetInput(rw);
>         filter->Update();
>
>         vtkSmartPointer<vtkMetaImageWriter> writer =
> vtkSmartPointer<vtkMetaImageWriter>::New();
>         writer->SetFileName(filename);
>         writer->SetInputData(filter->GetOutput());
>         writer->Write();
>         writer->Delete();
>         filter->Delete();
> }
>
> But in this way the size is taken into consideration the vtkrenderwindo
> size.
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Save-images-of-a-volume-in-1-1-tp5732742.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150709/07dc9037/attachment.html>


More information about the vtkusers mailing list