MeVisLab Toolbox Reference
|
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList More...
#include <View2DSlice.h>
Public Member Functions | |
View2DSlice () | |
constructor | |
~View2DSlice () | |
destructor. | |
void | destroy () |
destroy the slice textures | |
void | setInputImage (SoSFMLImage *img) |
set the input image. | |
SoSFMLImage * | getInputImage () |
get the input image. | |
void | setShaders (View2DShader *shader, View2DShader **overlayShaders) |
sets the shader that should be used for rendering | |
View2DShader * | getShader () |
get the main shader (might be NULL); | |
void | setSliceZ (int z) |
set the slice z position. | |
int | getSliceZ () |
get the slice z position. | |
void | setDrawsData (bool flag) |
enable/disable data loading | |
void | setAspectRatio (float ratio) |
set the aspect ratio | |
float | getAspectRatio () |
get the aspect ratio | |
void | setFilter (View2DTextureFilter filter=FILTER_LINEAR) |
set the filter | |
View2DTextureFilter | getFilter () |
get the filter | |
void | setSliceAlignment (View2DAlignXMode x, View2DAlignYMode y) |
set the alignment of the slice | |
void | setFixedInnerZoom (bool flag, float fixedZoom) |
set the fixed innerzoom | |
void | setDrawSize (float sx, float sy) |
set the slice size for drawing | |
void | getDrawSize (float &sx, float &sy) |
get the slice size for drawing | |
void | setDrawPosition (float x, float y) |
set the slice position for drawing | |
void | getDrawPosition (float &x, float &y) |
get the slice position for drawing | |
void | setSliceOrigin (float x, float y) |
set the inner slice origin | |
void | getSliceOrigin (float &x, float &y) |
get the inner slice origin | |
void | setSliceZoom (float zoom) |
set the inner slice zoom | |
float | getSliceZoom () |
get the inner slice zoom | |
void | setCachingMode (View2DSliceCachingMode mode) |
set data caching mode. | |
View2DSliceCachingMode | getCachingMode () |
get data caching mode. | |
void | getVoxelSize (float &vx, float &vy, float &vz) |
return voxel size | |
void | getVoxelSize (double &vx, double &vy, double &vz) |
return voxel size in doubles | |
void | updateLayout () |
update internal layout | |
void | setLut (View2DLut *lut) |
set the lut | |
void | setBlendMode (int blendMode, float *blendColor=nullptr) |
set blend mode | |
void | setBackgroundColor (float *color) |
set the background color (rgba) | |
void | setTimePoint (int timepoint) |
set the time point | |
int | getTimePoint () |
get the time point | |
void | setUserIndex (int useIndex) |
set the user index | |
int | getUserIndex () |
get the user index | |
void | drawBackground (bool clipBackgroundToImage=false) |
draw background of the slice | |
void | drawSlice (View2DSliceList *dsl, int originX, int originY, int width, int height, SoNodeList *extensions, bool extensionsOnly, bool isSlabRendering) |
draw the slice (originX, originY, width and height are the current viewport position/size) | |
void | drawSliceIn3D (View2DSliceList *dsl, bool extensionsOnly, SoNodeList *extensions, bool reverseDrawingOrder) |
void | drawTexture (View2DTexture *texture, int blendMode) |
draw a View2DTexture (used for Slice drawing and for overlays also) | |
void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor) |
draw a View2DTexture (used for Slice drawing and for overlays also) | |
void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor, View2DTextureFilter filter) |
draw a View2DTexture (used for Slice drawing and for overlays also) | |
void | drawTexture (View2DTexture *texture, float vp1[3], float vp2[3], float vp3[3], int blendMode, float *blendColor) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also) | |
void | drawTexture (View2DTexture *texture, float vp1[3], float vp2[3], float vp3[3], int blendMode, float *blendColor, View2DTextureFilter filter) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also) | |
void | getImageDeviceRect (float &dx1, float &dy1, float &dx2, float &dy2) |
Returns the device rect for the base image. | |
bool | select (float x, float y, float &voxelX, float &voxelY, float &voxelZ) |
Determine whether the slice can be selected, returned position is in voxel coordinates (typically this method is only used by View2DSliceList, please use mapDeviceToVoxel or mapDeviceToWorld instead!) (this returns true if the coordinate is in the visible device rect of the slice, even if it is outside the image) | |
bool | select (float x, float y, SbVec3f &voxel) |
same as above | |
bool | select (const SbVec2f &d, SbVec3f &voxel) |
same as above | |
bool | isSliceHit (float x, float y) const |
Returns if slice is hit at the given device coordinate if the visible device rect of a slice was hit returns TRUE,. | |
void | mapDeviceToNormalizedCoordinateSystem (int x, int y, SbVec2f &normalizedCoordinate) const |
Maps the given device coordinates to normalized View2D coordinates (as used by sliceOrigin and zoomCenter). | |
bool | isValidVoxel (float voxelX, float voxelY, float voxelZ) |
Returns if the given voxel coordinate is inside the image (z is currently ignored) | |
bool | isValidVoxel (const SbVec3f &voxel) |
same as above | |
void | invalidate () |
Invalidate the current slice data. | |
void | invalidateView () |
Sets a flag that the current state of the instance does not correspond to the data on the display. | |
float | millimeterToPixel (float lengthMillimeter) |
calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates). | |
void | mapVoxelToDevice (float voxelX, float voxelY, float voxelZ, float &rx, float &ry) |
maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored! | |
void | mapVoxelToDevice (const SbVec3f &voxelCoord, float &rx, float &ry) |
same as above | |
void | mapVoxelToDevice (const SbVec3f &voxelCoord, SbVec2f &r) |
same as above | |
SbMatrix | getWorldToDeviceMatrix () |
Returns the world to device matrix. | |
void | mapWorldToDevice (float worldX, float worldY, float worldZ, float &rx, float &ry) |
maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice) | |
void | mapWorldToDevice (const SbVec3f &worldCoord, float &rx, float &ry) |
same as above | |
void | mapWorldToDevice (const SbVec3f &worldCoord, SbVec2f &r) |
same as above | |
void | getVisibleDeviceRect (float &dx1, float &dy1, float &dx2, float &dy2) |
returns the visible device rect of the slice (the region the sliceOrigin and sliceZoom shows of the slice) | |
View2DTexture * | getOverlayTexture (void *user=nullptr, int id=0) |
get the overlay texture (is only created on first call and cached afterwards) | |
int | getLutSize () |
get size of lut | |
float | getInnerZoom () |
get the inner zoom | |
void | setDraw3D (bool flag, float devicePixelSize=1) |
enable drawing in 3d | |
bool | is3D () |
check if current rendering is in 3d | |
bool | containsVoxel (const SbVec3f &voxelPos) |
returns if the slice contains the given voxel pos | |
Static Public Member Functions | |
static void | enableBlending (int blendMode) |
enable the given blend mode in GL state. | |
a single slice that is stored in a View2DSliceList, typically created by a View2DSliceList
Definition at line 47 of file View2DSlice.h.
View2DSlice::View2DSlice | ( | ) |
constructor
View2DSlice::~View2DSlice | ( | ) |
destructor.
returns if the slice contains the given voxel pos
void View2DSlice::destroy | ( | ) |
destroy the slice textures
void View2DSlice::drawSlice | ( | View2DSliceList * | dsl, |
int | originX, | ||
int | originY, | ||
int | width, | ||
int | height, | ||
SoNodeList * | extensions, | ||
bool | extensionsOnly, | ||
bool | isSlabRendering ) |
draw the slice (originX, originY, width and height are the current viewport position/size)
void View2DSlice::drawSliceIn3D | ( | View2DSliceList * | dsl, |
bool | extensionsOnly, | ||
SoNodeList * | extensions, | ||
bool | reverseDrawingOrder ) |
void View2DSlice::drawTexture | ( | View2DTexture * | texture, |
float | vp1[3], | ||
float | vp2[3], | ||
float | vp3[3], | ||
int | blendMode, | ||
float * | blendColor ) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also)
void View2DSlice::drawTexture | ( | View2DTexture * | texture, |
float | vp1[3], | ||
float | vp2[3], | ||
float | vp3[3], | ||
int | blendMode, | ||
float * | blendColor, | ||
View2DTextureFilter | filter ) |
draw a View2DTexture in specified device coordinates (may be 3D coordinates also)
void View2DSlice::drawTexture | ( | View2DTexture * | texture, |
int | blendMode ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
void View2DSlice::drawTexture | ( | View2DTexture * | texture, |
int | blendMode, | ||
float * | blendColor ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
void View2DSlice::drawTexture | ( | View2DTexture * | texture, |
int | blendMode, | ||
float * | blendColor, | ||
View2DTextureFilter | filter ) |
draw a View2DTexture (used for Slice drawing and for overlays also)
enable the given blend mode in GL state.
|
inline |
get the aspect ratio
Definition at line 81 of file View2DSlice.h.
View2DSliceCachingMode View2DSlice::getCachingMode | ( | ) |
get data caching mode.
View2DTextureFilter View2DSlice::getFilter | ( | ) |
get the filter
Returns the device rect for the base image.
float View2DSlice::getInnerZoom | ( | ) |
get the inner zoom
SoSFMLImage * View2DSlice::getInputImage | ( | ) |
get the input image.
int View2DSlice::getLutSize | ( | ) |
get size of lut
View2DTexture * View2DSlice::getOverlayTexture | ( | void * | user = nullptr, |
int | id = 0 ) |
get the overlay texture (is only created on first call and cached afterwards)
|
inline |
get the main shader (might be NULL);
Definition at line 67 of file View2DSlice.h.
int View2DSlice::getSliceZ | ( | ) |
get the slice z position.
float View2DSlice::getSliceZoom | ( | ) |
get the inner slice zoom
int View2DSlice::getTimePoint | ( | ) |
get the time point
int View2DSlice::getUserIndex | ( | ) |
get the user index
returns the visible device rect of the slice (the region the sliceOrigin and sliceZoom shows of the slice)
return voxel size in doubles
SbMatrix View2DSlice::getWorldToDeviceMatrix | ( | ) |
Returns the world to device matrix.
void View2DSlice::invalidate | ( | ) |
Invalidate the current slice data.
void View2DSlice::invalidateView | ( | ) |
Sets a flag that the current state of the instance does not correspond to the data on the display.
|
inline |
check if current rendering is in 3d
Definition at line 266 of file View2DSlice.h.
Returns if slice is hit at the given device coordinate if the visible device rect of a slice was hit returns TRUE,.
Returns if the given voxel coordinate is inside the image (z is currently ignored)
void View2DSlice::mapDeviceToNormalizedCoordinateSystem | ( | int | x, |
int | y, | ||
SbVec2f & | normalizedCoordinate ) const |
Maps the given device coordinates to normalized View2D coordinates (as used by sliceOrigin and zoomCenter).
(typically this method is only used by View2DSliceList, please use the corresponding method of View2DSliceList instead)
same as above
void View2DSlice::mapVoxelToDevice | ( | float | voxelX, |
float | voxelY, | ||
float | voxelZ, | ||
float & | rx, | ||
float & | ry ) |
maps the local voxel coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice), Voxel z is currently ignored!
same as above
void View2DSlice::mapWorldToDevice | ( | float | worldX, |
float | worldY, | ||
float | worldZ, | ||
float & | rx, | ||
float & | ry ) |
maps the world coordinate to a device pixel coordinate which may be used in OpenGL (for drawing on the slice)
calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates).
Determine whether the slice can be selected, returned position is in voxel coordinates (typically this method is only used by View2DSliceList, please use mapDeviceToVoxel or mapDeviceToWorld instead!) (this returns true if the coordinate is in the visible device rect of the slice, even if it is outside the image)
set the aspect ratio
Definition at line 78 of file View2DSlice.h.
void View2DSlice::setCachingMode | ( | View2DSliceCachingMode | mode | ) |
set data caching mode.
void View2DSlice::setFilter | ( | View2DTextureFilter | filter = FILTER_LINEAR | ) |
set the filter
void View2DSlice::setInputImage | ( | SoSFMLImage * | img | ) |
set the input image.
void View2DSlice::setShaders | ( | View2DShader * | shader, |
View2DShader ** | overlayShaders ) |
sets the shader that should be used for rendering
void View2DSlice::setSliceAlignment | ( | View2DAlignXMode | x, |
View2DAlignYMode | y ) |
set the alignment of the slice
void View2DSlice::updateLayout | ( | ) |
update internal layout