texture from probe

David Gobbi dgobbi at irus.rri.on.ca
Tue Aug 10 22:49:19 EDT 1999


Hi Ken,

This sounds very similar to something that we do, though we use
an entirely different method.  What you want is to simply 
cut a data volume with a plane, and then texture map the 
resulting interpolated data onto the plane, right?  Basically
3D texture-mapping?

I wrote the vtkImageReslice filter (in vtk/contrib) primarily
for this purpose.  It can extract an arbitrary slice (or arbitrary
sub-volume) from any vtkImageData or vtkStructuredPoints data.
The resulting output can be used directly as a texture map. 

So, here's a short diagram:

(volume data)        vtkTransform       vtkPlaneSource (single quad)
      |                    |                      |
vtkImageReslice  <---------+               vtkTextureMapToPlane
      |                    |                      |
  vtkTexture        (via SetUserMatrix)       vtkDataSetMapper
      |                    v                      |
      +--------------->  vtkActor  <--------------+

The big advantage of doing is this way is that vtkImageReslice
is an order of magnitude faster at interpolation than vtkProbeFilter.
The only tricky part is setting the OutputSpacing, OutputOrigin, and
OutputExtent of the vtkImageReslice filter so that the bounds of the
output image match the bounds of the vtkPlaneSource.  Once that is
correct, the vtkTransform transformation will take care of itself.

 - David

--David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Tue, 10 Aug 1999, Kenneth Wang wrote:

> Hi,
> 
> I'm trying to use the result obtained with vtkProbeFilter as a texture
> map.  What I'd like to do is something like this:
> 
> 
>    vtkPlaneSource      vtkTransform
> (hi res for sampling)     |
>          |                +---------------------------------+
>          V                V                                 |
>      vtkTransformPolyDataFilter                             |
>                  |                                          |
>                  V                                          |
>  (data)---> vtkProbeFilter             vtkPlaneSource       |
>                  |                (single quad for vis)     |
>                  |                          |               |
>                  V                          V               V
>        vtkCastToConcrete (*)           vtkTransformPolyDataFilter
>                  |                                 |
>                  V                                 V
>              vtkTexture                  vtkTextureMapToPlane
>                  |                                 |
>                  |                                 V
>                  |                         vtkCastToConcrete
>                  +-------+                         |
>                          |          +--------------+
>                          V          V
>          lut--------> vtkPolyDataMapper
>                               |
>                               V
>                            vtkActor
> 
> 
> But, as you can see, this is problematic because the (*)'d cast to
> concrete can not produce the structured points that we require for
> textures.  While I understand that vtkPlaneSource is a poly data
> source, I'm wondering if there is an easy way to get
> vtkStructuredPoints from this probe since vtkPlaneSource produces an
> array of points.
> 
> What I'm trying to do right now is to take the poly data output of the
> probe filter (i.e. via cast to concrete) and then copy scalar data
> from the probe over to a vtkStructuredPoints that I build from
> scratch.  However, this feels like a definite kludge, and I'm not even
> sure it will work.  Does anyone has any advice?
> 
> Thanks,
> Ken Wang
> 
> 
> 
> 
> ------------------------------------------------------------------------
> Kenneth C. Wang			E-mail: kenwang at stanford.edu
> Electrical Engineering Dept.	Voice:  (650) 725-0458
> Stanford University		Fax:    (650) 725-7731
> CIS 214, Stanford, CA 94305	Web:    http://www.stanford.edu/~kenwang
> ------------------------------------------------------------------------
> 
> 
> -----------------------------------------------------------------------------
> This is the private VTK discussion list.  Please keep messages on-topic.
> Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at gsao.med.ge.com>.  For help, send message body containing
> "info vtkusers" to the same address.     Live long and prosper.
> -----------------------------------------------------------------------------
> 



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list