SetOrigin() bug?

Elizabeth Bullitt bullitt at med.unc.edu
Thu Dec 9 16:17:02 EST 1999


Hi Lisa--

> From your later question, I assume you are using the texture
> mapping volume mapper, right? If you switch to the ray caster, does it
> change at all? 

Actually, I'm using the ray caster volume mapper.
------------------------------

>Can you start from one of the standard examples (such as
> volTexSimple.tcl), change the spacing and origin of the data, and
> demonstrate this problem (perhaps by adding an outline filter and showing
> that the outline doesn't match with the volume rendering)?

I haven't done this with volTexSimple.tcl--am not using tcl. However I
have experimented with 4 MRAs under simplified conditions in which the
ray source and focal point are immoveably set and the SetOrigin() call
is used to translate the box (and another, surface-rendered object
having the same voxel coordinate system) along a single axis.
SetUserMatrix() was not used. The spacings of the volume were changed in
various ways.
	
	The value of the multiplier required to correct the offset values sent
to SetOrigin() for the volume does change with changes in (xstep, ystep,
zstep). At the time I was guessing that the value could be derived from
some ratio or combination of the stepsizes, but was unable to figure out
the relationship. I eventually gave up, as it was simpler to just get
around the problem by avoiding SetOrigin() and incorporating the initial
offset into a final matrix given to SetUserMatrix().
	I'm sorry I can't be more helpful.
	One other possibly relevant point is that I initially had difficulty
sizing the box. I had expected the combination of SetDimensions(xnum,
ynum,znum) and SetSpacing(xstep, ystep, zstep) to produce a volume of
size (xnum *xstep, ynum*ystep, znum*zstep). This didn't work, so I ended
up creating the box with SetSpacing(1,1,1) and using SetScale (xstep,
ystep, zstep) on the actor. The volume then has the correct dimensions.
Am not sure how SetScale() might or might not additionally interact with
SetOrigin() here, although it logically should not and there is no
problem with structured datasets of true unitary spacing and with the
values sent to SetScale() as multiples of 1. 
	
	--------------------------------- 

> Yes, you can render more than one region at a time, provided those regions
> do not overlap in 3D space. 

This info is helpful--there was indeed partial overlap.

	-------------------

>If you are using the texture mapping volume
> mapper, then make sure to add a vtkFrustumCoverageCuller to the renderer
> with back-to-front sorting on (if you are using a recent version of VTK
> that automatically creates a vtkFrustumCoverageCuller, then you can set
> this flag on the culler or remove it and add a new one)

Thanks.
--------------------------

> As for the black textures - this is a known problem at the moment that I
> have not been able to solve yet. At first glance it seemed simple - 2D
> texturing was being turned off in the volume texture mapper and it should
> not have been. But removing that did not seem to solve the problem. You can
> try removing the  glDisable( GL_TEXTURE_2D ); line from your
> vtkOpenGLVolumeTextureMapper2D.cxx file and see if it helps you.


Will try. Thanks for your help.
Liz


-----------------------------------------------------------------------------
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