[vtkusers] Extract a slice and save it as jpg/png

Chris Turner cturnercomplex at googlemail.com
Mon Jul 12 10:07:54 EDT 2010


Really? Am I the only one with that problem?

On Fri, Jul 9, 2010 at 5:02 PM, Chris Turner
<cturnercomplex at googlemail.com> wrote:
> Hi Everyone!
>
> I'm trying to extract a slice from a vtkImageData object and save it as picture.
>
> That's how I do it:
>
> voi=vtkExtractVOI()
> voi.SetInput(imageData)
> voi.SetVOI(0,0,0,512,512,1)
> voi.Update()
>
> writer=vtkJPEGWriter()
> writer.SetInput(voi.GetOutput())
> writer.SetFileName("slice.jpg")
> writer.Write()
>
> ImageData is 512x512x40 spacing 1,1,1
>
> The strange thing is I don't get an output nor an error message. So I
> think I'm missing something here.... but it can't figure out what.
>
> So does anybody have an idea or a better solution?
>
> Thanks
> Chris
>



More information about the vtkusers mailing list