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 More... | |
~View2DSlice () | |
destructor. More... | |
void | destroy () |
destroy the slice textures More... | |
void | setInputImage (SoSFMLImage *img) |
set the input image. More... | |
SoSFMLImage * | getInputImage () |
get the input image. More... | |
void | setShaders (View2DShader *shader, View2DShader **overlayShaders) |
sets the shader that should be used for rendering More... | |
View2DShader * | getShader () |
get the main shader (might be NULL); More... | |
void | setSliceZ (int z) |
set the slice z position. More... | |
int | getSliceZ () |
get the slice z position. More... | |
void | setDrawsData (bool flag) |
enable/disable data loading More... | |
void | setAspectRatio (float ratio) |
set the aspect ratio More... | |
float | getAspectRatio () |
get the aspect ratio More... | |
void | setFilter (View2DTextureFilter filter=FILTER_LINEAR) |
set the filter More... | |
View2DTextureFilter | getFilter () |
get the filter More... | |
void | setSliceAlignment (View2DAlignXMode x, View2DAlignYMode y) |
set the alignment of the slice More... | |
void | setFixedInnerZoom (bool flag, float fixedZoom) |
set the fixed innerzoom More... | |
void | setDrawSize (float sx, float sy) |
set the slice size for drawing More... | |
void | getDrawSize (float &sx, float &sy) |
get the slice size for drawing More... | |
void | setDrawPosition (float x, float y) |
set the slice position for drawing More... | |
void | getDrawPosition (float &x, float &y) |
get the slice position for drawing More... | |
void | setSliceOrigin (float x, float y) |
set the inner slice origin More... | |
void | getSliceOrigin (float &x, float &y) |
get the inner slice origin More... | |
void | setSliceZoom (float zoom) |
set the inner slice zoom More... | |
float | getSliceZoom () |
get the inner slice zoom More... | |
void | setCachingMode (View2DSliceCachingMode mode) |
set data caching mode. More... | |
View2DSliceCachingMode | getCachingMode () |
get data caching mode. More... | |
void | getVoxelSize (float &vx, float &vy, float &vz) |
return voxel size More... | |
void | getVoxelSize (double &vx, double &vy, double &vz) |
return voxel size in doubles More... | |
void | updateLayout () |
update internal layout More... | |
void | setLut (View2DLut *lut) |
set the lut More... | |
void | setBlendMode (int blendMode, float *blendColor=nullptr) |
set blend mode More... | |
void | setBackgroundColor (float *color) |
set the background color (rgba) More... | |
void | setTimePoint (int timepoint) |
set the time point More... | |
int | getTimePoint () |
get the time point More... | |
void | setUserIndex (int useIndex) |
set the user index More... | |
int | getUserIndex () |
get the user index More... | |
void | drawBackground (bool clipBackgroundToImage=false) |
draw background of the slice More... | |
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) More... | |
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) More... | |
void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor) |
draw a View2DTexture (used for Slice drawing and for overlays also) More... | |
void | drawTexture (View2DTexture *texture, int blendMode, float *blendColor, View2DTextureFilter filter) |
draw a View2DTexture (used for Slice drawing and for overlays also) More... | |
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) More... | |
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) More... | |
void | getImageDeviceRect (float &dx1, float &dy1, float &dx2, float &dy2) |
Returns the device rect for the base image. More... | |
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) More... | |
bool | select (float x, float y, SbVec3f &voxel) |
same as above More... | |
bool | select (const SbVec2f &d, SbVec3f &voxel) |
same as above More... | |
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,. More... | |
void | mapDeviceToNormalizedCoordinateSystem (int x, int y, SbVec2f &normalizedCoordinate) const |
Maps the given device coordinates to normalized View2D coordinates (as used by sliceOrigin and zoomCenter). More... | |
bool | isValidVoxel (float voxelX, float voxelY, float voxelZ) |
Returns if the given voxel coordinate is inside the image (z is currently ignored) More... | |
bool | isValidVoxel (const SbVec3f &voxel) |
same as above More... | |
void | invalidate () |
Invalidate the current slice data. More... | |
void | invalidateView () |
Sets a flag that the current state of the instance does not correspond to the data on the display. More... | |
float | millimeterToPixel (float lengthMillimeter) |
calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates). More... | |
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! More... | |
void | mapVoxelToDevice (const SbVec3f &voxelCoord, float &rx, float &ry) |
same as above More... | |
void | mapVoxelToDevice (const SbVec3f &voxelCoord, SbVec2f &r) |
same as above More... | |
SbMatrix | getWorldToDeviceMatrix () |
Returns the world to device matrix. More... | |
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) More... | |
void | mapWorldToDevice (const SbVec3f &worldCoord, float &rx, float &ry) |
same as above More... | |
void | mapWorldToDevice (const SbVec3f &worldCoord, SbVec2f &r) |
same as above More... | |
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) More... | |
View2DTexture * | getOverlayTexture (void *user=nullptr, int id=0) |
get the overlay texture (is only created on first call and cached afterwards) More... | |
int | getLutSize () |
get size of lut More... | |
float | getInnerZoom () |
get the inner zoom More... | |
void | setDraw3D (bool flag, float devicePixelSize=1) |
enable drawing in 3d More... | |
bool | is3D () |
check if current rendering is in 3d More... | |
bool | containsVoxel (const SbVec3f &voxelPos) |
returns if the slice contains the given voxel pos More... | |
Static Public Member Functions | |
static void | enableBlending (int blendMode) |
enable the given blend mode in GL state. More... | |
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.
bool View2DSlice::containsVoxel | ( | const SbVec3f & | voxelPos | ) |
returns if the slice contains the given voxel pos
void View2DSlice::destroy | ( | ) |
destroy the slice textures
void View2DSlice::drawBackground | ( | bool | clipBackgroundToImage = false | ) |
draw background of the slice
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)
|
static |
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.
void View2DSlice::getDrawPosition | ( | float & | x, |
float & | y | ||
) |
get the slice position for drawing
void View2DSlice::getDrawSize | ( | float & | sx, |
float & | sy | ||
) |
get the slice size for drawing
View2DTextureFilter View2DSlice::getFilter | ( | ) |
get the filter
void View2DSlice::getImageDeviceRect | ( | float & | dx1, |
float & | dy1, | ||
float & | dx2, | ||
float & | dy2 | ||
) |
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.
void View2DSlice::getSliceOrigin | ( | float & | x, |
float & | y | ||
) |
get the inner slice origin
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
void View2DSlice::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)
void View2DSlice::getVoxelSize | ( | double & | vx, |
double & | vy, | ||
double & | vz | ||
) |
return voxel size in doubles
void View2DSlice::getVoxelSize | ( | float & | vx, |
float & | vy, | ||
float & | vz | ||
) |
return voxel size
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.
bool View2DSlice::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,.
bool View2DSlice::isValidVoxel | ( | const SbVec3f & | voxel | ) |
same as above
bool View2DSlice::isValidVoxel | ( | float | voxelX, |
float | voxelY, | ||
float | voxelZ | ||
) |
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)
void View2DSlice::mapVoxelToDevice | ( | const SbVec3f & | voxelCoord, |
float & | rx, | ||
float & | ry | ||
) |
same as above
void View2DSlice::mapVoxelToDevice | ( | const SbVec3f & | voxelCoord, |
SbVec2f & | r | ||
) |
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!
void View2DSlice::mapWorldToDevice | ( | const SbVec3f & | worldCoord, |
float & | rx, | ||
float & | ry | ||
) |
same as above
void View2DSlice::mapWorldToDevice | ( | const SbVec3f & | worldCoord, |
SbVec2f & | r | ||
) |
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)
float View2DSlice::millimeterToPixel | ( | float | lengthMillimeter | ) |
calculates the pixel offset (in device coordinates) that corresponds to a certain distance (in mm, in world coordinates).
bool View2DSlice::select | ( | const SbVec2f & | d, |
SbVec3f & | voxel | ||
) |
same as above
bool View2DSlice::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 View2DSlice::select | ( | float | x, |
float | y, | ||
SbVec3f & | voxel | ||
) |
same as above
|
inline |
set the aspect ratio
Definition at line 78 of file View2DSlice.h.
void View2DSlice::setBackgroundColor | ( | float * | color | ) |
set the background color (rgba)
void View2DSlice::setBlendMode | ( | int | blendMode, |
float * | blendColor = nullptr |
||
) |
set blend mode
void View2DSlice::setCachingMode | ( | View2DSliceCachingMode | mode | ) |
set data caching mode.
void View2DSlice::setDraw3D | ( | bool | flag, |
float | devicePixelSize = 1 |
||
) |
enable drawing in 3d
void View2DSlice::setDrawPosition | ( | float | x, |
float | y | ||
) |
set the slice position for drawing
void View2DSlice::setDrawsData | ( | bool | flag | ) |
enable/disable data loading
void View2DSlice::setDrawSize | ( | float | sx, |
float | sy | ||
) |
set the slice size for drawing
void View2DSlice::setFilter | ( | View2DTextureFilter | filter = FILTER_LINEAR | ) |
set the filter
void View2DSlice::setFixedInnerZoom | ( | bool | flag, |
float | fixedZoom | ||
) |
set the fixed innerzoom
void View2DSlice::setInputImage | ( | SoSFMLImage * | img | ) |
set the input image.
void View2DSlice::setLut | ( | View2DLut * | lut | ) |
set the lut
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::setSliceOrigin | ( | float | x, |
float | y | ||
) |
set the inner slice origin
void View2DSlice::setSliceZ | ( | int | z | ) |
set the slice z position.
void View2DSlice::setSliceZoom | ( | float | zoom | ) |
set the inner slice zoom
void View2DSlice::setTimePoint | ( | int | timepoint | ) |
set the time point
void View2DSlice::setUserIndex | ( | int | useIndex | ) |
set the user index
void View2DSlice::updateLayout | ( | ) |
update internal layout