MeVisLab Toolbox Reference
SoCSOEditorTools.h File Reference
#include "SoCSOSystem.h"
#include <CSOBase/CSOBoundingBox.h>
#include <mlLinearAlgebra.h>
#include <SoCSODefines.h>

Go to the source code of this file.

Classes

struct  SoCSOEditorTools::PathPointSlicePosition
 
struct  SoCSOEditorTools::ImageStatisticsForCSO
 
struct  SoCSOEditorTools::PathPointsSegment
 Structure for handling path points segments. More...
 
struct  SoCSOEditorTools::vectorXSort
 For sorting Vector3s according to their x-component. More...
 
struct  SoCSOEditorTools::LineRenderSettings
 

Namespaces

namespace  ml
 Main documentation file for ML users and developers.
 
namespace  SoCSOEditorTools
 

Enumerations

enum  SoCSOEditorTools::RelativeSlicePosition { SoCSOEditorTools::SLICE_BELOW = 0 , SoCSOEditorTools::SLICE_IN = 1 , SoCSOEditorTools::SLICE_ABOVE = 2 }
 

Functions

SOCSO_EXPORT ImageStatisticsForCSO SoCSOEditorTools::performImageStatistics (ml::CSO *cso, SoSFMLImage *image)
 Reads out the given image and performs image voxel value statistics for the given CSO.
 
SOCSO_EXPORT void SoCSOEditorTools::setStatisticsToUserData (ml::CSO *cso, const ImageStatisticsForCSO &statistics, const std::string &viewerIdentifier="")
 Sets the given statistics to the CSO as user data.
 
SOCSO_EXPORT void SoCSOEditorTools::setUserDataWithViewerId (ml::CSO *cso, const std::string &userDataName, const std::string &viewerIdentifier, const ml::Variant &value)
 
SOCSO_EXPORT void SoCSOEditorTools::fillCrossingsVector (std::vector< std::vector< ml::Vector2 > > &crossingsVector, const std::vector< ml::Vector3 > &pathPoints, const ml::Vector3 &minBB, const ml::Vector3 &maxBB)
 Fills the given crossingsVector with crossings of rays in x-direction with the path points segments.
 
SOCSO_EXPORT void SoCSOEditorTools::retrieveDicomTagData (SoSFMLImage *image, std::string &modality, float &rescaleIntercept, float &rescaleSlope)
 Fills the given variables with values obtained from DICOM tags.
 
SOCSO_EXPORT ml::CSOBoundingBox SoCSOEditorTools::computeSlabBoundingBox (float deviceX, float deviceY, View2DSliceList *slicelist)
 Computes and returns the bounding box in voxel space of a slice at the given device position.
 
SOCSO_EXPORT ml::CSOBoundingBox SoCSOEditorTools::computeSlabBoundingBox (int voxelZ, View2DSliceList *slicelist, int voxelAugmentInZ=0)
 Computes and returns the bounding box in voxel space of the given slice.
 
SOCSO_EXPORT bool SoCSOEditorTools::isOnCurrentSlice (SoView2DCSOExtensibleEditor *editor, const CSODrawCSOInfos &csoDrawInfos, const CSODrawView2DInfos &view2DInfos)
 Returns whether the given CSO is visible on the current slice.
 
SOCSO_EXPORT bool SoCSOEditorTools::isOnCurrentSlice (ml::CSO *cso, const CSODrawView2DInfos &view2DInfos)
 Returns whether the given CSO is visible on the current slice.
 
SOCSO_EXPORT bool SoCSOEditorTools::isOnCurrentSlice (ml::CSO *cso, View2DSliceList *slicelist, const ml::Vector3 &sliceNormalWorld, SoCSOTransform *csoTransform)
 Returns whether the given CSO is visible on the current slice.
 
SOCSO_EXPORT float SoCSOEditorTools::getParallelThicknessAbsoluteValue (View2DSliceList *slicelist, ml::CSOVisualizationSettings *vSettings)
 Returns the absolute value for the parallel thickness.
 
SOCSO_EXPORT bool SoCSOEditorTools::isApproximatelyParallel (ml::CSO *cso, View2DSliceList *slicelist, float epsilon=-1)
 Returns whether the given CSO is parallel to the current 2D image considering the allowed thickness.
 
SOCSO_EXPORT void SoCSOEditorTools::fillWorldSliceCrossings (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, std::vector< CSOSliceCrossing > &belowSlicePositions, std::vector< CSOSliceCrossing > &inSlicePositions, std::vector< CSOSliceCrossing > &aboveSlicePositions)
 Fills the given vectors with positions below, in, and above the current slice.
 
SOCSO_EXPORT void SoCSOEditorTools::getWorldSlicePlanes (const CSODrawView2DInfos &view2DInfos, ml::Plane &topPlane, ml::Plane &bottomPlane)
 Fills the given top/bottom planes with planes in world space that lies on top and on bottom of the current slice.
 
SOCSO_EXPORT void SoCSOEditorTools::fillCrossingsOnePlaneCrossed (const ml::Plane &plane, const ml::Vector3 &lastPosition, const ml::Vector3 &currentPosition, CSOSliceCrossing &sliceCrossings, std::vector< CSOSliceCrossing > *crossings[3], int lastSlicePosition)
 Fills the crossings vector.
 
SOCSO_EXPORT void SoCSOEditorTools::fillCrossingsBothPlanesCrossed (const ml::Plane &topPlane, const ml::Plane &bottomPlane, const ml::Vector3 &lastPosition, const ml::Vector3 &currentPosition, int relativePosition, CSOSliceCrossing &sliceCrossings, std::vector< CSOSliceCrossing > *crossings[3])
 Fills the crossings vector.
 
SOCSO_EXPORT void SoCSOEditorTools::fillWorldToVoxelMatrix (const CSODrawView2DInfos &view2DInfos, ml::Matrix4 &worldToVoxelMatrix)
 Fills the given matrix with the slice's worldToVoxel matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillWorldToVoxelMatrix (const SoPointerPosition &pos, ml::Matrix4 &worldToVoxelMatrix)
 Fills the given matrix with the slice's worldToVoxel matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillWorldToVoxelMatrix (View2DSliceList *sliceList, ml::Matrix4 &worldToVoxelMatrix)
 Fills the given matrix with the sliceList's worldToVoxel matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillWorldToVoxelMatrix (const SbMatrix &inventorMatrix, ml::Matrix4 &worldToVoxelMatrix)
 Fills the given ML matrix with the given worldToVoxel Inventor matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillVoxelToWorldMatrix (const CSODrawView2DInfos &view2DInfos, ml::Matrix4 &voxelToWorldMatrix)
 Fills the given matrix with the slice's voxelToWorld matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillVoxelToWorldMatrix (const SoPointerPosition &pos, ml::Matrix4 &voxelToWorldMatrix)
 Fills the given matrix with the slice's voxelToWorld matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillVoxelToWorldMatrix (View2DSliceList *sliceList, ml::Matrix4 &voxelToWorldMatrix)
 Fills the given matrix with the sliceList's voxelToWorld matrix.
 
SOCSO_EXPORT void SoCSOEditorTools::fillVoxelToWorldMatrix (const SbMatrix &inventorMatrix, ml::Matrix4 &voxelToWorldMatrix)
 Fills the given ML matrix with the given worldToVoxel Inventor matrix.
 
SOCSO_EXPORT bool SoCSOEditorTools::isAbovePlane (const ml::Vector3 &worldPosition, const ml::Plane &plane)
 Returns whether the given point is above the given plane.
 
SOCSO_EXPORT bool SoCSOEditorTools::evaluateHitPoint (const ml::Vector3 &worldPosition, View2DSliceList *slicelist, ml::CSOList *csoList, const ml::CSOBoundingBox &slabBB, const std::string &subType, SoView2DCSOExtensibleEditor *editor, bool testSeedPoints, ml::CSO *&localHitCSO, ml::CSOSeedPoint *&localHitSeedPoint, ml::CSOPathPoints *&localHitPathPoints, float &distanceToCSO)
 Returns whether a CSO was hit and fills the according structures. If subType is an empty string, it is not evaluated.
 
SOCSO_EXPORT bool SoCSOEditorTools::isEligibleForPicking (ml::CSO *cso, ml::CSOList *csoList, const std::string &subType, View2DSliceList *slicelist, SoView2DCSOExtensibleEditor *editor)
 Returns whether the given CSO is eligible for picking.
 
SOCSO_EXPORT bool SoCSOEditorTools::hasTransformation (ml::CSO *cso, SoView2D *viewer, SoView2DCSOExtensibleEditor *editor)
 Returns whether there exists a transformation between the CSO and the viewer.
 
SOCSO_EXPORT bool SoCSOEditorTools::isInteractionAllowedBecauseOfRegistration (ml::CSO *cso, SoView2D *viewer, SoView2DCSOExtensibleEditor *editor)
 Returns whether any interaction is allowed because of registration information.
 
SOCSO_EXPORT bool SoCSOEditorTools::shouldRenderCSODependingOnImageCreation (ml::CSO *cso, SoView2DCSOExtensibleEditor *editor, View2DSliceList *slicelist)
 Returns whether the given CSO should be rendered on the image depending whether it was created on it.
 
SOCSO_EXPORT float SoCSOEditorTools::getSquaredDeviceDistance (const ml::Vector3 &worldPosition, View2DSliceList *slicelist, float dMouseX, float dMouseY)
 Returns the squared distance in device coordinates from the given world position to the given device position.
 
SOCSO_EXPORT void SoCSOEditorTools::mapWorldToDevice (View2DSliceList *slicelist, const ml::Vector3 &worldPosition, float &devX, float &devY)
 Maps the given world position to device position.
 
SOCSO_EXPORT float SoCSOEditorTools::getSquaredDeviceLineDistance (const ml::Vector3 &lineWorldStart, const ml::Vector3 &lineWorldEnd, View2DSliceList *slicelist, float dMouseX, float dMouseY)
 Returns the squared distance in device coordinates from the given line in world positions to the given device position.
 
SOCSO_EXPORT bool SoCSOEditorTools::isOnSameSlab (const ml::CSOBoundingBox &slabBB, const ml::CSOBoundingBox &csoBB)
 Returns whether the two given voxel bounding boxes lie on the same slab.
 
SOCSO_EXPORT bool SoCSOEditorTools::intersectsSlice (const ml::CSOBoundingBox &slabBB, const CSOVoxelSlab &csoBB)
 Returns whether the two given voxel bounding boxes lie on the same slab.
 
SOCSO_EXPORT bool SoCSOEditorTools::areOnSamePlane (ml::CSO *cso1, ml::CSO *cso2, float epsilon=0.00001f)
 Returns whether the two given CSOs are lying on the same plane.
 
SOCSO_EXPORT bool SoCSOEditorTools::areOnSamePlane (ml::CSO *cso, const ml::Vector3 &position, const ml::Vector3 &normal, float epsilon=0.00001f)
 Returns whether the given CSO and the point/normal are on the same plane.
 
SOCSO_EXPORT void SoCSOEditorTools::drawLines (GLint lineMode, const std::vector< ml::Vector3 > &positions, const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const SbVec2f &deviceOffset)
 Draws the given points as a line strip or loop, depending on the lineMode.
 
SOCSO_EXPORT void SoCSOEditorTools::getRightmostSeedPointPosition (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, float &deviceX, float &deviceY)
 Fills the device coordinates with the right most seed point position of the CSO in the viewer.
 
SOCSO_EXPORT void SoCSOEditorTools::getRightMostPathPointPositionOnCurrentSlice (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, float &deviceX, float &deviceY)
 Fills the device coordinates with the right most path point position projected on the current slice of the CSO in the viewer.
 
SOCSO_EXPORT void SoCSOEditorTools::getRightmostSeedPointPositionAndVector (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, float &deviceX, float &deviceY, float &deviceVX, float &deviceVY)
 Fills the device coordinates with the right most seed point position of the CSO (assumed to be a DistanceLine CSO with two seed points) in the viewer and the normalized direction of the distance line pointing to the right most point.
 
SOCSO_EXPORT SbVec2f SoCSOEditorTools::convertDevicePositionToRelativeViewerPosition (View2DSlice *slice, const SbVec2f &deviceVector)
 Converts the given device position to a position relative to the viewer's size.
 
SOCSO_EXPORT SbVec2f SoCSOEditorTools::convertRelativeViewerPositionToDevicePosition (View2DSlice *slice, const SbVec2f &relativeVector)
 Converts the given position relative to the viewer's size to a device position.
 
SOCSO_EXPORT bool SoCSOEditorTools::mapWorldToDeviceViaVoxel (const CSODrawCSOInfos &csoInfos, const CSODrawView2DInfos &view2DInfos, const ml::Vector3 &position, float &deviceX, float &deviceY)
 Maps the given world position to device coordinates via voxel coordinate; z in voxel space is set to current slice.
 
SOCSO_EXPORT void SoCSOEditorTools::setupGLAntiAlias (bool shouldUseAntiAliasing)
 Sets OpenGL antialiasing parameters.
 
SOCSO_EXPORT void SoCSOEditorTools::restoreGLAntiAlias ()
 Undoes changes to OpenGL state applied by setupGLAntiAlias.
 
SOCSO_EXPORT bool SoCSOEditorTools::enableGLStipplingIfNeeded (unsigned short pattern)
 Enables/disables GL stippling if pattern requires stippling (if pattern == 0xffff, stippling is disabled).
 
SOCSO_EXPORT bool SoCSOEditorTools::isNearDeviceBoundingBox (View2DSliceList *slicelist, const ml::CSOBoundingBox &box, float selectionDistance, float dMouseX, float dMouseY)
 Returns if the mouse device position is near the given voxel bounding box in device coords.
 

Variables

static std::vector< floatSoCSOEditorTools::_lineBuffer
 Used to avoid reallocation on line rendering.