[OpendTect_Developers] Debugging visualization problems with iv files

Yuancheng Liu yuancheng.liu at dgbes.com
Mon Jan 3 16:39:57 CET 2011


Dear all,

today I would like to share some tricks on how to detect  certain 
display problems on OpendTect.
Sometimes, I receive emails about display problems. For example, the 
intersection of a fault and a horizon goes to infinity, or like if you 
have a time survey, everything is displayed fine in the scene, but when 
you load a horizon or a fault into a transformed Depth scene,  you only 
see a blank/black scene there, the horizon/fault seems disappeared. 
Similar problems may happen here and there.

So, out of the clue, how can we see what is wrong there? The first thing 
I normally do is to see what objects are presented in the scene.
In OpendTect, we use Open Inventor(Coin3) for the visualization, which 
is a set of building blocks based on OpenGL (like a house with several 
rooms and each room has this or that furniture).  The file format of 
Open Inventor is an ascii/binary file with extension .iv, the so called 
iv file. We use ascii iv file in OpendTect.

As you may notice, in OpendTect, we already developed some useful tools 
to check scenes. One is dumping a scene into an iv file (On the left top 
of the scene tree-->right click the Scene 1(or the scene you 
picked)-->Export scene), this tool exports the whole scene into an iv 
file. the other one is so called od_ivfileviewer(compiled executable), 
as you can see from the name, the viewer can load any iv file and 
display it on a scene window.  So, if something is wrong in the iv file, 
the display will be also wrong.

But how is iv file organized? how do we know which is which? Here is 
some introduction about the iv file.
The first line of an iv file is always either  "#Inventor V2.1 ascii" or 
"#Inventor V2.1 binary", it tells you the version of your Open Inventor 
and the file type. Here is how it looks like of a scene.
> #Inventor V2.1 ascii
> Group{
>    Separator{
>            Switch{
>                whichChild -1
>                //Objects you made
>                }
>            Switch{
>                whichChild -3
>                //Objects
>                }
>         // all kinds of stuff in the scene: shape, color, texture, 
> coordinates and other objects
>    }
>    Separator {......}
>    Group {......}
> }
>

So, you will see lots of Group/Separator/Switch etc in the iv file, they 
are actually like  packages you made in the scene, each of them may 
contain other things inside, layer by layer.  Those packages or layers 
may or may not access to each other, depend on what kind of setting you 
have there. For example, the Switch, whichChild could be -1, 0,  -3. If 
it  is -1, then the whole Switch is not used in the scene at all, you 
could simply remove the whole Switch and would not affect the display. 
If  it is 0, then only the first child in it will be used. Similarly, if 
it is -3, then all the children will be used. Of course, in general, 
those nodes (Group/Separator/..) have other ways to access their 
neighbors or their children. For more details, you may want to check the 
book "The Inventor Mentor".

But in our case,  if you dumped the scene, say you have a Horizon A and 
an inline B in it, then the name A and B will be in the iv file and each 
of them will be packed by either a Group or a Separator or some other 
node. If A has problem to display, you could remove the whole B, you can 
also remove all those Switches with whichChild==-1, to simplify  the iv 
file, then you can come closer to your iv file to see which package goes 
wrong.  In many cases, for example, I saw the Coordinate has problems, 
some "nan" were presented there, then I knew the Coordinate settings 
were wrong and I  could go back to my code to debug. Of course, some 
problems could be more complicated, but at least we have something to 
check  first, like texture, color, transform etc.

Here, Kristofer is the expert of Open Inventor, if you have any 
questions or any good experience want to show, please do not hesitate to 
share with us.

Best regards and happy new year,

Yuancheng

-- 


-- dGB Earth Sciences
-- 1 Sugar Creek Center BLVD #935
-- Sugar Land, TX 77478; USA
-- Tel: +1 281-240-3939, Fax: +1 281-240-3944
-- (Skype) +1 281-968-0464






More information about the Developers mailing list