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

Chris Turner cturnercomplex at googlemail.com
Tue Jul 13 15:57:42 EDT 2010


Hi Bill,

thanks for your answer! But didn't do the trick.
So strange I thought this was a standard question and procedure. And
that there has to be a easy way to do that.

And why don't I even get a error message or something. Even when I
turn on the debug mode there is nothing suspicious.

Anybody has another approach?

Thanks
Chris

On Mon, Jul 12, 2010 at 10:16 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Try,
> voi.SetVOI(0,0,0,511,511,0)
>
> On Mon, Jul 12, 2010 at 10:07 AM, Chris Turner
> <cturnercomplex at googlemail.com> wrote:
>> 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
>>>
>> _______________________________________________
>> 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
>>
>



More information about the vtkusers mailing list