[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] Geometric mask over vtkImageData
From:       "=?ISO-8859-1?Q?Jes=FAs_Sp=ED=ADnola?=" <jspinola () gmail ! com>
Date:       2007-01-31 11:34:04
Message-ID: 672a2e90701310334l7ba308dfo8ab6342814baa477 () mail ! gmail ! com
[Download RAW message or body]

Hello,

I'm using vtkImageViewer2 and I want to apply a geometric mask to its input
data ( vtkImageData ). The mask could be a rectangle, a circle, a polygon or
a combination of any of the three shapes. The mask will be applied to all
the images on the vtkImageData stack.

Searching over the mailing list and the online documentation I found
vtkPolyDataToImageStencil can be the key class to get what I need but I'm
not familiar with the vtk*Stencil* classes and I need some help.

Which is the correct pipeline to achieve what I need? I guess it could be
the following, but I'm not quite sure

First set the input for vtkPolyDataToImageStencil, ( a vtkPolyData object
with the desired shape ). Then set the output port of
vtkPolyDataToImageStencil to the input connection of vtkImageStencilData.
Third, SetStencil and SetBackgroundInput to vtkImageStencil with the
vtkImageStencilData and vtkImageData respectively. And finally set the input
of vtkImageViewer2 with the output of the vtkImageStencil.

Is that ok or there's an easier way to do it?

Another question I have is regarding the coordinate space. My mask shapes
will be defined in pixel space, where I have to indicate this in the
pipeline?
The last question is, how I define the color of my mask?

Thanks in advance!

[Attachment #3 (text/html)]

Hello,<br><br>I&#39;m using vtkImageViewer2 and I want to apply a geometric mask to \
its input data ( vtkImageData ). The mask could be a rectangle, a circle, a polygon \
or a combination of any of the three shapes. The mask will be applied to all the \
images on the vtkImageData stack.  <br><br>Searching over the mailing list and the \
online documentation I found vtkPolyDataToImageStencil can be the key class to get \
what I need but I&#39;m not familiar with the vtk*Stencil* classes and I need some \
help.<br> <br>Which is the correct pipeline to achieve what I need? I guess it could \
be the following, but I&#39;m not quite sure<br><br>First set the input for \
vtkPolyDataToImageStencil, ( a vtkPolyData object with the desired shape ). Then set \
the output port of vtkPolyDataToImageStencil to the input connection of \
vtkImageStencilData. Third, SetStencil and SetBackgroundInput to vtkImageStencil with \
the vtkImageStencilData and vtkImageData respectively. And finally set the input of \
vtkImageViewer2 with the output of the vtkImageStencil. <br><br>Is that ok or \
there&#39;s an easier way to do it?<br><br>Another question I have is regarding the \
coordinate space. My mask shapes will be defined in pixel space, where I have to \
indicate this in the pipeline?<br> The last question is, how I define the color of my \
mask?<br><br>Thanks in advance!<br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic