Message: Re: Manipulate Single Voxel (Touchable) to have different color Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Manipulate Single Voxel (Touchable) to have different color 

Forum: Medical Applications
Re: Question Manipulate Single Voxel (Touchable) to have different color
Date: 23 Apr, 2014
From: John Allison <John Allison>

On Wed, 23 Apr 2014 07:29:54 GMT, geant4president wrote: ...
> What I already tried is navigating to a voxel touchable, asking for the
> logical volume and setting the VisAttributes. This does not work,
> changes have no effect on the drawn geometry. I assume the reason for
> this is the "ComputeMaterial" function, which - as far as I read (?) -
> is called during visualisation and therefore updating the color to the
> original material one.

The problem is that the parameterised volumes actually share a single logical volume. The vis attributes are a property of a logical volume. Hence all parametrised volumes have the same colour.

> As only visualization change is needed, I assume there should be a way
> to manipulate the scene. The OGL interface view also has a "scene tree",
> in which all the phantom voxels are clickable and color-manipulable.
> Therefore it "should" be doable programmatically.

You have discovered that with the Qt viewer you can indeed change the colour (and visibility) of individual touchables. We are working on a way to capture that information. For now you would have to do it by hand. Unfortunately this doesn't seem to work on the Qt viewer. (You can change colours with the mouse on Qt but not with the commands below - don't know why; we will look into it.) So, with tests/test202, using the OGLSX viewer:

/vis/viewer/set/culling global false # Make sure you are not missing invisible layers /vis/drawTree # To see what you are doing /vis/scene/create # To prepare for a simplified picture, a close-up of one sub-detector /vis/scene/add/volume tube_phys /vis/sceneHandler/create OGLSX /vis/set/touchable expHall_P 0 tube_phys 0 divided_tube_phys 1 divided_tube_inset_phys 0 sub_divided_tube_phys 2 daughter_box_phys 0 grand_daughter_box_phys 0 /vis/touchable/set/colour green /vis/ogl/printEPS

The result is one little green box - see attachment.

Clearly this is very tedious if you have lots of touchables you want to change.

> However, if anybody has an idea (maybe even another approach) to
> visualize 3D regions in the geometry without affecting geometry itself,
> I would highly appreciate sharing it with me.

An alternative might be to make the voxels invisible as far as normal drawing is concerned and draw the voxels yourself in a "user vis action" - see examples/extended/visualisation/userVisAction. You would have to loop over the indices of the three dimensions and draw each voxel at the right place in your chosen colour. Mmm. Good luck.

Can't think of anything else right now. Tricky.

> Thanks in advance!

You're welcome.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2014/04/23/09.24-8046-G4OpenGL_0.eps

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Ok: Re: Manipulate Single Voxel (Touchable) to have different color   (geant4president - 02 May, 2014)
 Add Message Add Message
to: "Re: Manipulate Single Voxel (Touchable) to have different color"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]