[vtkusers] Writing a JPEG from vtkActor

Marlos Fabris marlos.fabris at gmail.com
Tue Dec 20 11:04:34 EST 2005


Szczerba,

I tested your code with my data and I got two diminished spots (more
or less what I already have). So I tried to change the SetScale in
vtkImageShiftScale and I got what I want, obviously without any
mathematic. I'll examine more this function, but I think this could be
the way. Try this:

iss-->SetScale((range[1] - range[0]) / range[1]);

Marlos

On 12/20/05, Dominik Szczerba <domi at vision.ee.ethz.ch> wrote:
> > I got an error in compilation. I can't figure out how to make the
> > conversion, because if I'm going to write directly the
> > vtkStructuredPoints data to the file, I'm going to get only a
> > grayscale image.
>
> could you pls post your code? i would be glad even with grayscale (get a
> black image). Anyway, I have not been succesful with custom color tables
> in vtk at all.
>
> bye
> --dsz
>
> >
> >
> >>I try to do the same with vtkPNGWriter (...)
> >
> > When I used directly the vtkJPEGWriter, I needed to use the
> > vtkImageShiftScale class to compile, but I got a black image.
> >
> > Marlos Fabris
> > IT Analyst
> > Institute of Technology for Development
> > Curitiba - Paraná - Brazil
> >
> > On 12/20/05, Dominik Szczerba wrote:
> >
> >>What is the error? I try to do the same with vtkPNGWriter ending up with:
> >>
> >>vtkPNGWriter (0x8058948): PNGWriter only supports unsigned char and
> >>unsigned short inputs
> >>
> >>Meanwhile I try to figure out how to do the appropriate convertion in vtk.
> >>--dsz
> >>
> >>Marlos Fabris wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm trying to write a jpeg file (using vtkJPEGWriter) from a vtkActor
> >>>but I can't accomplish this. I have a vtk file with structured points
> >>>data and I wish to transform to vtkPolyData and color it with my
> >>>vtkLookupTable.
> >>>
> >>>Is there a way to convert only my vtkActor to a vtkImageData, without
> >>>the frameborders of vtkWindowToImageFilter?
> >>>
> >>>Or is there a way to trim my image?
> >>>
> >>>Thank you in advance,
> >>>
> >>>Marlos Fabris
> >>>_______________________________________________
> >>>This is the private VTK discussion list.
> >>>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> >>>Follow this link to subscribe/unsubscribe:
> >>>http://www.vtk.org/mailman/listinfo/vtkusers
> >>
> >>--
> >>Dominik Szczerba, Dr.
> >>ETZ C110 CO-ME/BIWI CH-8092 Zurich
> >>http://www.vision.ee.ethz.ch/~domi
> >>_______________________________________________
> >>This is the private VTK discussion list.
> >>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> >>Follow this link to subscribe/unsubscribe:
> >>http://www.vtk.org/mailman/listinfo/vtkusers
> >>
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
> --
> Dominik Szczerba, Dr.
> ETZ C110 CO-ME/BIWI CH-8092 Zurich
> http://www.vision.ee.ethz.ch/~domi
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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