[vtkusers] Annotating an image with text

Jérôme jerome.velut at gmail.com
Wed Dec 9 14:56:43 EST 2009


You are right. Writing a rendering process for annotating an image makes no
sense. The vtkTextActor is not the solution. However, the vtkTextSource
produces a vtkPolyData. I think that you can use this polydata through a
vtkPolyDataToImageStencil in order to mask the image according to the text.

HTH

Jerome

2009/12/9 David Doria <daviddoria+vtk at gmail.com <daviddoria%2Bvtk at gmail.com>
>

> On Wed, Dec 9, 2009 at 2:29 PM, Jérôme <jerome.velut at gmail.com> wrote:
> > You can use SetPosition in vtkTextActor to place a string everywhere in
> the
> > image. For file writing, why not using vtkWindowToImageFilter?
> >
> > BTW, I sent a mail mentioning a segfault caused by vtkTextActor
> > ("vtkTextActor segfaults my render window"). Did you try to use it? Am I
> the
> > only one?
> >
> > Jerome
>
> Jerome,
>
> If there is not already a window then it is quite a process to add
> renders, etc, etc. It seems like there should just be a way to insert
> a string directly into image pixels as vtkImageCanvasSource2D does for
> geometric objects.
>
> To answer your question - this works fine for me:
> http://www.cmake.org/Wiki/Display_text
>
> Thanks,
>
> David
> _______________________________________________
> 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/20091209/653e11c3/attachment.htm>


More information about the vtkusers mailing list