Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

OpenTissue::gl::CrossSections< grid_type > Class Template Reference

#include <gl_cross_sections.h>

List of all members.

Public Types

typedef grid_type::value_type value_type
typedef
OpenTissue::image::Image
< unsigned char > 
image_type

Public Member Functions

 CrossSections ()
void forward_i_plane ()
void backward_i_plane ()
void forward_j_plane ()
void backward_j_plane ()
void forward_k_plane ()
void backward_k_plane ()
void invalidate ()
void init (grid_type const &grid)
template<typename color_func_type >
void draw (color_func_type const &color_func)

Protected Member Functions

template<typename color_func_type >
void get_i_cut (color_func_type &color_func)
template<typename color_func_type >
void get_j_cut (color_func_type &color_func)
template<typename color_func_type >
void get_k_cut (color_func_type &color_func)
template<typename color_func_type >
void get_bitmaps (color_func_type &color_func)
void allocate ()

Protected Attributes

image_type m_bitmap_i
 A bitmap containing an image of the x-axis cross section.
image_type m_bitmap_j
 A bitmap containing an image of the y-axis cross section.
image_type m_bitmap_k
 A bitmap containing an image of the z-axis cross section.
OpenTissue::texture::texture2D_pointer m_texture_i
 A texture corresponding to the x-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.
OpenTissue::texture::texture2D_pointer m_texture_j
 A texture corresponding to the y-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.
OpenTissue::texture::texture2D_pointer m_texture_k
 A texture corresponding to the z-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.
bool m_changed_i
 Boolan flag indicating whether the x-axis plane have changed its position since the last draw-call.
bool m_changed_j
 Boolan flag indicating whether the y-axis plane have changed its position since the last draw-call.
bool m_changed_k
 Boolan flag indicating whether the z-axis plane have changed its position since the last draw-call.
unsigned int m_i
 A step counter along the x-axis, specifying the current location of that coordinate axis plane.
unsigned int m_j
 A step counter along the y-axis, specifying the current location of that coordinate axis plane.
unsigned int m_k
 A step counter along the z-axis, specifying the current location of that coordinate axis plane.
unsigned int m_max_i
 The maximum number of steps to be taken along the x-axis.
unsigned int m_max_j
 The maximum number of steps to be taken along the y-axis.
unsigned int m_max_k
 The maximum number of steps to be taken along the z-axis.
grid_typem_ptr_grid
 A pointer to the grid volume that should be visualized.

Detailed Description

template<typename grid_type>
class OpenTissue::gl::CrossSections< grid_type >

Cross Section Visualization Class. This class contains functionality for extracting the intersections of a 3D volume and three coordinate axes planes and visualizing the resulting cross sections.


Member Typedef Documentation

template<typename grid_type >
typedef OpenTissue::image::Image<unsigned char> OpenTissue::gl::CrossSections< grid_type >::image_type
template<typename grid_type >
typedef grid_type::value_type OpenTissue::gl::CrossSections< grid_type >::value_type

Constructor & Destructor Documentation

template<typename grid_type >
OpenTissue::gl::CrossSections< grid_type >::CrossSections (  )  [inline]

Member Function Documentation

template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::allocate (  )  [inline, protected]
template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::backward_i_plane (  )  [inline]

Move x-plane. This method should be invoked to move the x-plane one step along the negative direction of the x-axis. One can not move beyond the zero step limit.

template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::backward_j_plane (  )  [inline]

Move y-plane. This method should be invoked to move the y-plane one step along the negative direction of the y-axis. One can not move beyond the zero step limit.

template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::backward_k_plane (  )  [inline]

Move z-plane. This method should be invoked to move the z-plane one step along the negative direction of the z-axis. One can not move beyond the zero step limit.

template<typename grid_type >
template<typename color_func_type >
void OpenTissue::gl::CrossSections< grid_type >::draw ( color_func_type const &  color_func  )  [inline]

Draw Cross Sections. Invoke this method in ones render-loop.

Parameters:
color_func A color function funtor. This functor is used to translate the grid values from the cross sections into color values (RGBA values stored as a (255,255,255,255) color format).
template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::forward_i_plane (  )  [inline]

Move x-plane. This method should be invoked to move the x-plane one step along the positive direction of the x-axis. One can not move beyond the maximum step limit.

template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::forward_j_plane (  )  [inline]

Move y-plane. This method should be invoked to move the y-plane one step along the positive direction of the y-axis. One can not move beyond the maximum step limit.

template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::forward_k_plane (  )  [inline]

Move z-plane. This method should be invoked to move the z-plane one step along the positive direction of the z-axis. One can not move beyond the maximum step limit.

template<typename grid_type >
template<typename color_func_type >
void OpenTissue::gl::CrossSections< grid_type >::get_bitmaps ( color_func_type &  color_func  )  [inline, protected]

Get Axes Bitmaps and Update Textures. This method determines which coordinate axes planes that have changed. Only for the changed axes are bitmaps retrieved and textures updated.

Parameters:
color_func A color function funtor. This functor is used to translate the grid values from the cross section into color values (RGBA values stored as a (255,255,255,255) color format).
template<typename grid_type >
template<typename color_func_type >
void OpenTissue::gl::CrossSections< grid_type >::get_i_cut ( color_func_type &  color_func  )  [inline, protected]

Get Axis Bitmap and Update Texture. This method retrives the cross intersection with the x-axis plane. The cross intersection is stored in the corresponding axis bitmap and then the corresponding texture is updated with the content of the bitmap.

Parameters:
color_func A color function funtor. This functor is used to translate the grid values from the cross section into color values (RGBA values stored as a (255,255,255,255) color format).
template<typename grid_type >
template<typename color_func_type >
void OpenTissue::gl::CrossSections< grid_type >::get_j_cut ( color_func_type &  color_func  )  [inline, protected]

Get Axis Bitmap and Update Texture. This method retrives the cross intersection with the x-axis plane. The cross intersection is stored in the corresponding axis bitmap and then the corresponding texture is updated with the content of the bitmap.

Parameters:
color_func A color function funtor. This functor is used to translate the grid values from the cross section into color values (RGBA values stored as a (255,255,255,255) color format).
template<typename grid_type >
template<typename color_func_type >
void OpenTissue::gl::CrossSections< grid_type >::get_k_cut ( color_func_type &  color_func  )  [inline, protected]

Get Axis Bitmap and Update Texture. This method retrives the cross intersection with the x-axis plane. The cross intersection is stored in the corresponding axis bitmap and then the corresponding texture is updated with the content of the bitmap.

Parameters:
color_func A color function funtor. This functor is used to translate the grid values from the cross section into color values (RGBA values stored as a (255,255,255,255) color format).
template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::init ( grid_type const &  grid  )  [inline]

Initialization. This method should be invoked before any visualization takes place. The method will allocate and initialize any internal data structures that is needed for the cross section visualization.

Observe that this class is completely bound to one grid. If one has multiple grids that need to be visualized. Then a seperate instance of this class is needed for each visualization wanted.

Parameters:
grid The grid that should be visualized.
template<typename grid_type >
void OpenTissue::gl::CrossSections< grid_type >::invalidate (  )  [inline]

Invalidate Visualization. Invoking this method will force the visualization to re-fetch all cross intersections and store them in textures. The following draw-invokation will then be a complete re-draw of the data.

It is generally a good idea to invoke this method when data stored in the grid volume is altered.


Member Data Documentation

template<typename grid_type >
image_type OpenTissue::gl::CrossSections< grid_type >::m_bitmap_i [protected]

A bitmap containing an image of the x-axis cross section.

template<typename grid_type >
image_type OpenTissue::gl::CrossSections< grid_type >::m_bitmap_j [protected]

A bitmap containing an image of the y-axis cross section.

template<typename grid_type >
image_type OpenTissue::gl::CrossSections< grid_type >::m_bitmap_k [protected]

A bitmap containing an image of the z-axis cross section.

template<typename grid_type >
bool OpenTissue::gl::CrossSections< grid_type >::m_changed_i [protected]

Boolan flag indicating whether the x-axis plane have changed its position since the last draw-call.

template<typename grid_type >
bool OpenTissue::gl::CrossSections< grid_type >::m_changed_j [protected]

Boolan flag indicating whether the y-axis plane have changed its position since the last draw-call.

template<typename grid_type >
bool OpenTissue::gl::CrossSections< grid_type >::m_changed_k [protected]

Boolan flag indicating whether the z-axis plane have changed its position since the last draw-call.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_i [protected]

A step counter along the x-axis, specifying the current location of that coordinate axis plane.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_j [protected]

A step counter along the y-axis, specifying the current location of that coordinate axis plane.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_k [protected]

A step counter along the z-axis, specifying the current location of that coordinate axis plane.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_max_i [protected]

The maximum number of steps to be taken along the x-axis.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_max_j [protected]

The maximum number of steps to be taken along the y-axis.

template<typename grid_type >
unsigned int OpenTissue::gl::CrossSections< grid_type >::m_max_k [protected]

The maximum number of steps to be taken along the z-axis.

template<typename grid_type >
grid_type* OpenTissue::gl::CrossSections< grid_type >::m_ptr_grid [protected]

A pointer to the grid volume that should be visualized.

A texture corresponding to the x-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.

A texture corresponding to the y-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.

A texture corresponding to the z-axis image of the cross-section. This is the GPU stored image. Where as the bitmap are the CPU stored image.


The documentation for this class was generated from the following file: