ImedgineSliceViewer Class Reference
[Views]

The viewer used to display pixel image slices. More...

#include <imedgine_slice_viewer.h>

Inherits ImedgineViewer.

Inheritance diagram for ImedgineSliceViewer:

Inheritance graph
[legend]
Collaboration diagram for ImedgineSliceViewer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ImedgineSliceViewer (SlicePixelView *slice_view, QWidget *parent, const char *name=NULL)
virtual ~ImedgineSliceViewer ()
virtual SbBool processSoEvent (const SoEvent *const ev)
bool convertCoordsFromScreenToTexture (SbVec2s const &screen_coords, SbVec2s &texture_coords)
void convertCoordsFromTextureToWorld (SbVec2s const &texture_coords, SbVec2f &space_coords)
void updateSliceStatusInfo (index_type current_slice_index, index_type maximum_slice_index)
void updateDatasetStatusInfo ()
void unsetHybridView ()
void updateSliceSliderPosition (index_type slice_index)
SlicePixelViewgetSlicePixelView ()
SoTranslate1Dragger * getSliceSliderDragger ()
SoTranslate1Dragger * getTransparencySliderDragger ()
bool getIgnoreNextSliceSliderUpdate ()
void setIgnoreNextSliceSliderUpdate (bool ignore_next_slice_slider_update)

Protected Member Functions

virtual void buildPopupMenu ()
virtual void menuSelection (int menu_item_id)
SbVec3f convertCoordsFromWorldToSpace (SbVec2s screen_coords) throw (NullPointerException)

Protected Attributes

SlicePixelViewslice_view_
view_mode_type view_mode_
SoSeparator * popup_button_sep_
SoCube * popup_button_
SoSeparator * status_info_sep_
SoTransform * slice_status_info_transform_
SoText2 * slice_status_info_text_
SoTransform * dataset_status_info_transform_
SoText2 * dataset_status_info_text_
SoSeparator * slice_slider_sep_
SoTranslate1Dragger * slice_slider_dragger_
SoSwitch * transparency_slider_switch_
SoSeparator * transparency_slider_sep_
SoTranslate1Dragger * transparency_slider_dragger_
SoSeparator * region_of_interest_sep_
ROIBaseregion_of_interest_
std::auto_ptr< SoMouseButtonEvent > last_button_click_event_
SbVec2s last_position_
SoQtPopupMenu * popup_menu
SbTime double_click_check_time_
SbVec2s left_mouse_button_press_location_
bool is_hybrid_view_
double mouse_movement_scaling_factor_
bool ignore_next_slice_slider_update_

Detailed Description

The viewer used to display pixel image slices.

Author:
Tobias Gross (tobias.gross@imedgine.org)

Christian Koerner (christian.koerner@imedgine.org)

Alexander Lex (alexander.lex@imedgine.org)

Marc Streit (marc.streit@imedgine.org)

Martin Reininger (martin.reininger@imedgine.org)

Definition at line 71 of file imedgine_slice_viewer.h.


Constructor & Destructor Documentation

ImedgineSliceViewer SlicePixelView slice_view,
QWidget *  parent,
const char *  name = NULL
 

Constructor

Definition at line 40 of file imedgine_slice_viewer.cpp.

References ImedgineSliceViewer::dataset_status_info_text_, ImedgineSliceViewer::dataset_status_info_transform_, SlicePixelView::getDynamicSceneSeparator(), VolumePixelView::getMaxPixelValue(), VolumePixelView::getMinPixelValue(), View::getStaticSceneSeparator(), ImedgineSliceViewer::mouse_movement_scaling_factor_, ImedgineSliceViewer::popup_button_, ImedgineSliceViewer::popup_button_sep_, ImedgineSliceViewer::region_of_interest_sep_, ImedgineSliceViewer::slice_slider_dragger_, ImedgineSliceViewer::slice_slider_sep_, ImedgineSliceViewer::slice_status_info_text_, ImedgineSliceViewer::slice_status_info_transform_, ImedgineSliceViewer::slice_view_, imedgine::sliceSliderPositionChangedCB(), ImedgineSliceViewer::status_info_sep_, ImedgineSliceViewer::transparency_slider_dragger_, ImedgineSliceViewer::transparency_slider_sep_, ImedgineSliceViewer::transparency_slider_switch_, and imedgine::transparencySliderPositionChangedCB().

Here is the call graph for this function:

~ImedgineSliceViewer  )  [virtual]
 

Destructor

Definition at line 177 of file imedgine_slice_viewer.cpp.


Member Function Documentation

void buildPopupMenu  )  [protected, virtual]
 

Implements the buildPopupMenu method of the examiner viewer. All entries are set here. In addition the dataset names are loaded too.

Reimplemented from ImedgineViewer.

Definition at line 517 of file imedgine_slice_viewer.cpp.

References VolumePixelView::getDatasetKey(), Controller::getInstance(), Controller::getLoadedDatasetKeys(), VolumePixelView::getSecondDatasetKey(), ImedgineSliceViewer::popup_menu, and ImedgineSliceViewer::slice_view_.

Here is the call graph for this function:

bool convertCoordsFromScreenToTexture SbVec2s const &  screen_coords,
SbVec2s &  texture_coords
 

Convert the screen coordinates (which are pixel coordinates) to texture coordinatens (of the current slice). The method uses ray picking for getting the texture coordinates which are hit by the ray.

Parameters:
screen_coords The screen coordinates in pixel
texture_coords The result of the ray picking action in texture coordinates
Returns:
Bool that indicates if a object is hit. Returns false if nothing is hit by the ray.

Definition at line 467 of file imedgine_slice_viewer.cpp.

References SlicePixelView::getRenderArea(), SlicePixelView::getSlicePlane(), SlicePixelView::getSliceResolution(), ImedgineSliceViewer::slice_view_, X_DIMENSION, and Y_DIMENSION.

Here is the call graph for this function:

void convertCoordsFromTextureToWorld SbVec2s const &  texture_coords,
SbVec2f &  space_coords
 

Convert texture coordinates (of the current slice) to world space coordinates.

Parameters:
texture_coords Texture coordinates (of the current slice)
space_coords The result of the conversion in world space coordinates.

Definition at line 498 of file imedgine_slice_viewer.cpp.

References SlicePixelView::getSlicePlane(), SlicePixelView::getSliceResolution(), ImedgineSliceViewer::slice_view_, X_DIMENSION, and Y_DIMENSION.

Here is the call graph for this function:

SbVec3f convertCoordsFromWorldToSpace SbVec2s  screen_coords  )  throw (NullPointerException) [protected]
 

Converts screen coordinates (in pixel) to world space coordinates.

Parameters:
screen_coords Pixel coordinates in the render area.
Returns:
World space coordinates of the 2D screen coordinates.

Definition at line 675 of file imedgine_slice_viewer.cpp.

References X_DIMENSION, and Y_DIMENSION.

void menuSelection int  menu_item_id  )  [protected, virtual]
 

Overload the menu selection method of the examiner viewer. The method is called by the menu selection callback method. If a dataset is selected in the hybrid view submenu the proper actions are executed (add second dataset, remove second dataset, change second dataset).

Parameters:
menu_item_id The ID of the selected menu item.

Reimplemented from ImedgineViewer.

Definition at line 579 of file imedgine_slice_viewer.cpp.

References Controller::getInstance(), Controller::getLoadedDatasetKeys(), VolumePixelView::getSecondDatasetKey(), ImedgineSliceViewer::is_hybrid_view_, ImedgineSliceViewer::popup_menu, SlicePixelView::setSecondDataset(), ImedgineSliceViewer::slice_view_, ImedgineSliceViewer::transparency_slider_switch_, and SlicePixelView::unsetSecondDataset().

Here is the call graph for this function:

SbBool processSoEvent const SoEvent *const   ev  )  [virtual]
 

Overload the event handling of the examiner viewer. All the event handling for the 2D slice views happens here.

Parameters:
ev A const pointer to the caught event

Reimplemented from ImedgineViewer.

Definition at line 186 of file imedgine_slice_viewer.cpp.

References ImedgineSliceViewer::last_button_click_event_, ImedgineSliceViewer::last_position_, ImedgineViewer::processSoEvent(), ImedgineSliceViewer::view_mode_, and Y_DIMENSION.

Here is the call graph for this function:

void unsetHybridView  ) 
 

Hide the texture of the second dataset.

Definition at line 667 of file imedgine_slice_viewer.cpp.

References ImedgineSliceViewer::transparency_slider_switch_.

void updateDatasetStatusInfo  ) 
 

Update the status information of the dataset that is currently represented in the render area. This status information consists of the dataset keys (names) of the loaded dataset. In case of a hybrid view (this means two dataset are rendered at the same time) both dataset keys are shown.

Definition at line 650 of file imedgine_slice_viewer.cpp.

References VolumePixelView::getDatasetKey(), VolumePixelView::getSecondDatasetKey(), and ImedgineSliceViewer::slice_view_.

Here is the call graph for this function:

void updateSliceSliderPosition index_type  slice_index  ) 
 

Updates the slice slider position if the current slice changed..

Definition at line 695 of file imedgine_slice_viewer.cpp.

References SlicePixelView::getNumSlices(), ImedgineSliceViewer::ignore_next_slice_slider_update_, ImedgineSliceViewer::slice_slider_dragger_, and ImedgineSliceViewer::slice_view_.

Here is the call graph for this function:

void updateSliceStatusInfo index_type  current_slice_index,
index_type  maximum_slice_index
 

Update the slice status information that is represented as text in the render area. The slice status info is of the format "current slice index / number of slices".

Parameters:
current_slice_index The current slice index that is rendered in the render area.
maximum_slice_index The total number of slices of the dataset. This depends on the view (dimension).

Definition at line 637 of file imedgine_slice_viewer.cpp.

References ImedgineSliceViewer::slice_status_info_text_.


Member Data Documentation

SoText2* dataset_status_info_text_ [protected]
 

The text that contains the dataset status information (i.e. the names). In case of a second dataset loaded two dataset names are held.

Definition at line 242 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoTransform* dataset_status_info_transform_ [protected]
 

Transformation of the dataset status information to the desired position. At the moment the upper right corner of the render area.

Definition at line 235 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SbTime double_click_check_time_ [protected]
 

Time stamp of the last mouse click. The time is important for recognizing double clicks.

Definition at line 314 of file imedgine_slice_viewer.h.

bool ignore_next_slice_slider_update_ [protected]
 

Flag prevents field sensor to update the slice position in the view and therefore avoids an endless update loop. Maybe this is not optimal -> find a better solution!

Definition at line 342 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::getIgnoreNextSliceSliderUpdate(), ImedgineSliceViewer::setIgnoreNextSliceSliderUpdate(), and ImedgineSliceViewer::updateSliceSliderPosition().

bool is_hybrid_view_ [protected]
 

Flag that indicates if a second dataset is loaded

Definition at line 326 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::menuSelection().

std::auto_ptr<SoMouseButtonEvent> last_button_click_event_ [protected]
 

Event of the last button click. This is used for the user interaction handling.

Definition at line 295 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::processSoEvent().

SbVec2s last_position_ [protected]
 

Pixel coordinates of the last event that is caught.

Definition at line 301 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::processSoEvent().

SbVec2s left_mouse_button_press_location_ [protected]
 

The pixel coordinates of the last left mouse button click.

Definition at line 320 of file imedgine_slice_viewer.h.

double mouse_movement_scaling_factor_ [protected]
 

The scaling factor used to compensate resolution differences between different datasets. Using this factor e.g. with intensity/level changes will result in the same amount of change independent of the pixel stride of the dataset

Definition at line 334 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoCube* popup_button_ [protected]
 

The cube on that the popup button texture is rendered.

Definition at line 209 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoSeparator* popup_button_sep_ [protected]
 

Seperator that contains all popup relevant scene graph nodes.

Definition at line 203 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoQtPopupMenu* popup_menu [protected]
 

A pointer to the popup menu

Definition at line 307 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::buildPopupMenu(), and ImedgineSliceViewer::menuSelection().

ROIBase* region_of_interest_ [protected]
 

A pointer to the ROI.

Definition at line 288 of file imedgine_slice_viewer.h.

SoSeparator* region_of_interest_sep_ [protected]
 

Separator node that cointains the region of interests.

Definition at line 282 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoTranslate1Dragger* slice_slider_dragger_ [protected]
 

The dragger of the slice slider.

Definition at line 254 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::getSliceSliderDragger(), ImedgineSliceViewer::ImedgineSliceViewer(), and ImedgineSliceViewer::updateSliceSliderPosition().

SoSeparator* slice_slider_sep_ [protected]
 

Separator node that cointains the slider for changing the slice.

Definition at line 248 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoText2* slice_status_info_text_ [protected]
 

The text that contains the slice number status information.

Definition at line 228 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer(), and ImedgineSliceViewer::updateSliceStatusInfo().

SoTransform* slice_status_info_transform_ [protected]
 

Transformation of the slice status information to the desired position. At the moment the lower left corner of the render area.

Definition at line 222 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SlicePixelView* slice_view_ [protected]
 

A pointer to the slice view that is rendered in the viewer (render area).

Definition at line 191 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::buildPopupMenu(), ImedgineSliceViewer::convertCoordsFromScreenToTexture(), ImedgineSliceViewer::convertCoordsFromTextureToWorld(), ImedgineSliceViewer::getSlicePixelView(), ImedgineSliceViewer::ImedgineSliceViewer(), ImedgineSliceViewer::menuSelection(), ImedgineSliceViewer::updateDatasetStatusInfo(), and ImedgineSliceViewer::updateSliceSliderPosition().

SoSeparator* status_info_sep_ [protected]
 

Seperator that contains all status information nodes.

Definition at line 215 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoTranslate1Dragger* transparency_slider_dragger_ [protected]
 

The dragger of the transparency slider.

Definition at line 276 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::getTransparencySliderDragger(), and ImedgineSliceViewer::ImedgineSliceViewer().

SoSeparator* transparency_slider_sep_ [protected]
 

Separator node that cointains the slider for changing the transparency of the two loaded datasets. The transparency value of the first dataset is always the complement of the transparency value of the second dataset (e.g. 1st dataset 0.2, 2nd dataset 0.8)

Definition at line 270 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer().

SoSwitch* transparency_slider_switch_ [protected]
 

A switch node that makes the hiding of the second dataset texture possible.

Definition at line 261 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::ImedgineSliceViewer(), ImedgineSliceViewer::menuSelection(), and ImedgineSliceViewer::unsetHybridView().

view_mode_type view_mode_ [protected]
 

Holds the current view mode that controls the user interaction.

Definition at line 197 of file imedgine_slice_viewer.h.

Referenced by ImedgineSliceViewer::processSoEvent().


The documentation for this class was generated from the following files:
Generated on Sun Aug 13 18:20:05 2006 for iMEDgine by  doxygen 1.4.6