[vtkusers] Injecting VTKImageData into another VTKImageData

David Doria daviddoria at gmail.com
Fri Oct 22 19:40:52 EDT 2010


On Fri, Oct 22, 2010 at 7:21 PM, Alexis Cheng <acheng_1221 at hotmail.com>wrote:

>  Hi,
>
> I'm attempting to inject a 2D vtkImageData object into a specific portion
> of another 2D vtkImageData object. i.e. Have the first vtkImageData object
> be displayed in a specified polygon within the second vtkImageData object.
>
> I've tried using the blend function, but that doesn't seem to provide me
> with the option to specify the desired location.
>
> I've also tried applying the images as textures onto polygons and
> repositioning these actors with respect to each other. The render window
> displays the desired merged image, but is there a way of converting this
> render window to a vtkImageData object?
>
> I require the output to be a vtkImageData object as I intend to send it via
> an igtl link to Slicer.
>
> Are either of these methods capable of the prescribed task? Are there any
> other methods that could be able to accomplish this? Thanks in advance!
>
> Alexis Cheng
> Electrical Engineering
> University of British Columbia
>

I believe this is the idea of "stenciling". I tried to make a demo, but I
wasn't exactly sure what was going on. Maybe you can start from here and
figure it out and fix the example :)
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageStencil

You could also do it in ITK very easily:
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/Images/ImageStencil>
http://www.vtk.org/Wiki/ITK/Examples/Images/PasteImageFilter
<http://www.vtk.org/Wiki/ITK/Examples/Images/PasteImageFilter>
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101022/ae553f59/attachment.htm>


More information about the vtkusers mailing list