next up previous contents
Next: Main Objects Up: Graphics2D Previous: Graphics2D   Contents

Contents

Here, we present the philosophy and the organisation of the visualisation part of the software.
We present the general concepts and describe how they are implemented to supply an easy and effective way to visualize 2D objects just as well as 3D objects.
Parts of the explanations will be used in the Graphics3D module too.

This module offers the possibility to have 2D views of graphical objects. Of course, these objects might be 2D or 3D objects.
Generally, in case of 3D objects, we will visualize the intersection of the 3D object with a 2D plane of interest.
Some particular 3D objects, called sliceable objects, are defined like a spatial superimposition of 2D data (by example, a 3D image may be considered as a superimposition of 2D images). The visualization of those corresponds to the 2D visualization of the data of each slice, with the possibility to navigate among the slices to select the one we want to visualize.

As said in the introduction, yav++ was first design in order to perform segmentation of medical images based with 3D and 4D Deformable Models. This has involved a general graphical scheme. The basis concept object is the notion of Scene.

After having created a Scene, which is like creating a new space, we may want to add objects (probably of different kind) to the Scene. And usually, the final step will be to create a new Camera and use it to watch the Scene. We may use several Cameras watching the same Scene if we want to use different point of view, by example. Then, if the Scene is activated and if any object of the Scene is supposed to evolve, the time evolution can be activated and the Scene starts the computation in order to actualize the vizualisation.

A scene may contain four types of objects:

For each of the four item, a Scene owns a list with all the objects of this kind belonging to it.

On top of those four object types, we define a UserInterface object which is typically an object which provides a position and can output a force (if it is a force feedback device).

In fact, the main point is the following: What is an activated Scene ?

Of course, if a Scene isn't activated, nothing happens and the objects of the Scene don't evolve.
On the opposite, if it's activated, this causes all Deformable Models of the Scene to iterate if they are activated.
We can control the number of iteration applied each time the routine is called. If there are no Deformable Model, the activation of the scene is stopped.

Figure 12: Scene Graph
\begin{figure}\includegraphics[width=\linewidth]{images/graph-scene.ps}
\end{figure}

The dashed line joining Deformable and Graphical Models or RangeData and Graphical Models means that a Deformable Models or Range Data are not necessary Graphical Models.

Graphical Models

Graphical Models are objects which can be drawn. They own a redraw function called for creation, destruction, updating or just redrawing.
We introduce the notion of centroïd, circumscribing circle and bounding box.

As described in the Camera section, these Models may be viewed in a Camera.
They can be selected by a mouse click and then transformed by translation, rotation, scaling.
We also define the shortest distance from any mouse click in the Camera window to the closest Graphical Model present in this Scene.

Deformable Models

Generally speaking, a Deformable Model is an object, created in a scene, which is supposed to deform in the course of time, due to external and internal contraints.

This object owns an iterate function, a set of position (to control the geometry and the topology of the model) and force constraint (to modify the external force field) and some function to manage its number of iterations and the amount of time spent in the iterate function.
A state variable allow you to activate or desactivate the deformation of the model. When a Scene is activated, which means that you ask to process iterations, iteration callback function of each Deformable Model (iterate functions) handled by the Scene will be called by the Scene to be able to actualize the rendering of the scene (Graphical Models don't have any iteration function but a redraw function).

If a Deformable Model is defined with thanks to a Graphical Model, it may be defined with Active Vertices (Active Triangulation, by example). Active Vertices can be considered as points with a dynamic behaviour. Those vertices can be under several types of forces: INTERNAL, EXTERNAL, EXTERNAL, AVERAGED_EXTERNAL, GLOBAL, GLOBALLY_CONSTRAINED, and TOTAL. Each has a current position, a reference position (control) and a former position.

After an iteration, we apply the computed force associated to this vertex to the current vertex position and this gives a new position for this Active Vertex which will be the current position for the next iteration. Many parameters let you define the caracteristics of the forces and the mobility of the vertex.

Each of them owns a Range Information. This RangeInformation informs about the way to compute the closest point, which is the point of the Range Data Model that we want to associate with the vertex.

Range Data Models

This objects are used by Deformable Models to control the deformations.
They mainly provide a member function that computes the closest data point of the Range Data Model from any point of the Deformable Model.

Furthermore, the object stores a Range Information which is information about the properties of the closest point and the way to find it (maxima of the gradient by example).
This point is used to find the new position of a vertex of the Deformable Model.

Cameras

A Camera is created in a scene and its function is to render all the visibles Graphical Models of the scene. Several Cameras may be looking at the same scene, each having eventually different caracteristics (position, ...). Interaction with mouse and keyboard are supported and can be redefined.

Each visible Graphical Model in the Camera can be selected (by clicking it in the Camera) or unselected. If an Graphical Model is selected, we can apply classical transformations on it: translation, rotation, scaling. For this transformations, two modes of displacement are classicaly defined, depending on the point of view considered: camera or object mode.

The camera displacement mode affects only the localisation of the Camera and doesn't affect the position of the Graphical Models (or of the selected Graphical Model). It means that this mode has a global effect.

When an Graphical Model is selected, the object displacement mode enable to modify the position of the Graphical Model in the scene. This makes possible to position the different Graphical Models independently in the space. The field of view of the Camera may also be modified to adapt the view of the Scene.

It's also possible to record the Camera image in a file if requested, using MPEG format. In order to achieve this, we distinguish the simulation rate (usually defined by the user and associated with Deformable Models iteration step duration) from the frame rate which is the rate of the hardware frame rendering.


next up previous contents
Next: Main Objects Up: Graphics2D Previous: Graphics2D   Contents
Jean-Didier Lemarechal 2002-02-14