#include <mlCSOWrapper.h>
Inherits QObject.
A class that wraps CSO objects for use in scripting.
◆ CSOVoxelWriteMode
Voxel write mode used for setVoxelWriteMode.
| Enumerator |
|---|
| VOXEL_WRITE_ID | If a CSO is voxelized, its id (or the group id) is written into the image.
|
| VOXEL_WRITE_CONST | If a CSO is voxelized, this constant is written into the image.
|
| VOXEL_WRITE_CONST_PLUS_ID | If a CSO is voxelized, its id (or the group id) added to the constant value is written into the image.
|
| VOXEL_WRITE_MODULE | A CSO (-Group) with this value is voxelized with the according module's values. This is the default setting.
|
◆ addGroup
| bool MLCSOWrapper::addGroup |
( |
int |
id, |
|
|
bool |
useUndoRedo = true |
|
) |
| |
|
slot |
Adds this CSO to the group with the given ID.
Returns false if the group ID is invalid. Deprecated: use addToGroup instead!
◆ addToGroup
| bool MLCSOWrapper::addToGroup |
( |
int |
id, |
|
|
bool |
useUndoRedo = true |
|
) |
| |
|
slot |
Adds this CSO to the group with the given ID.
Returns false if the group ID is invalid.
◆ applyTransformationMatrix
| void MLCSOWrapper::applyTransformationMatrix |
( |
QVariantList |
matrix | ) |
|
|
slot |
Applies the given matrix to all seed- and path points.
◆ calculatePCA
| QVariantMap MLCSOWrapper::calculatePCA |
( |
| ) |
const |
|
slot |
Calculates the main axes using PCA.
Returns a dictionary with the following values:
- "center" The center of the object (aka mid point)
- "centerOfMass" The center of mass (aka barycenter)
- "longestAxis" The longest axis (normalized)
- "middleAxis" The middle axis (normalized)
- "shortestAxis" The shortest axis (normalized)
- "longestExtent" The extent along the longest axis
- "middleExtent" The extent along the middle axis
◆ close
| void MLCSOWrapper::close |
( |
| ) |
|
|
slot |
Closes an open CSO.
Note: this method just adds a path points list between the last and the first seed point, but this path point list is not filled up with path points as the other path point lists.
◆ getArea
| double MLCSOWrapper::getArea |
( |
| ) |
const |
|
slot |
Returns the area of this CSO (this value is only meaningful if all points lie in a plane).
◆ getCreatorId
| int MLCSOWrapper::getCreatorId |
( |
| ) |
const |
|
slot |
Returns the creator ID of the CSO. This is set by the processor or editor that generated this CSO.
◆ getCSOList
Returns the internal pointer to the wrapped CSOList.
◆ getDescription
| QString MLCSOWrapper::getDescription |
( |
| ) |
const |
|
slot |
Returns the description of this CSO.
◆ getEditableState
| bool MLCSOWrapper::getEditableState |
( |
| ) |
const |
|
slot |
Returns the 'editable' state of this CSO.
◆ getGroupAt
Returns the group at the specified index. If the index is out of bounds, NULL is returned.
◆ getGroupIdAt
| unsigned int MLCSOWrapper::getGroupIdAt |
( |
unsigned int |
index | ) |
const |
|
inlineslot |
Returns the ID of the group at the specified index.
◆ getId
| unsigned int MLCSOWrapper::getId |
( |
| ) |
const |
|
slot |
Returns the unique ID of this CSO.
◆ getIsClosed
| bool MLCSOWrapper::getIsClosed |
( |
| ) |
const |
|
slot |
Returns the closed state of this contour.
◆ getIsFinished
| bool MLCSOWrapper::getIsFinished |
( |
| ) |
const |
|
slot |
Returns the finished status of this contour.
◆ getIsInPlane
| bool MLCSOWrapper::getIsInPlane |
( |
| ) |
const |
|
slot |
Returns the plane status (do all seed points lie in a plane?).
If the method returns 'true', the plane normal is also valid. Note that a CSO forming a straight line is not considered to be 'in plane' as it lies in an infinite number of planes.
◆ getIsPoint
| bool MLCSOWrapper::getIsPoint |
( |
| ) |
const |
|
slot |
Returns whether the CSO is a point.
◆ getIsPointInside
| bool MLCSOWrapper::getIsPointInside |
( |
QVariantList |
point | ) |
const |
|
slot |
Returns whether the given 3D point (x, y, z in world coordinates) is inside the CSO.
◆ getLabel
| QString MLCSOWrapper::getLabel |
( |
| ) |
const |
|
slot |
Returns the label of this CSO.
◆ getLargestDistance
| double MLCSOWrapper::getLargestDistance |
( |
| ) |
const |
|
slot |
Returns the largest distance between any of the path points of the CSO.
◆ getLargestDistanceWithPoints
| QVariantMap MLCSOWrapper::getLargestDistanceWithPoints |
( |
| ) |
const |
|
slot |
Returns the largest distance between any of the path points of the CSO.
Also returns the two points that have the largest distance. The result dictionary looks like this:
- "distance" - The distance
- "point0" - The first point
- "point1" - The second point
◆ getLength
| float MLCSOWrapper::getLength |
( |
| ) |
const |
|
slot |
Returns the length of this CSO (this is sum of the the euclidean distances between all successive path points).
◆ getNumGroups
| unsigned int MLCSOWrapper::getNumGroups |
( |
| ) |
const |
|
slot |
Returns the number of groups this CSO is in.
◆ getNumPathPointLists
| int MLCSOWrapper::getNumPathPointLists |
( |
| ) |
const |
|
slot |
Returns the number of path point lists.
◆ getNumSeedPoints
| int MLCSOWrapper::getNumSeedPoints |
( |
| ) |
const |
|
slot |
Returns the number of seed points.
◆ getNumUniquePathPoints
| int MLCSOWrapper::getNumUniquePathPoints |
( |
| ) |
const |
|
slot |
Returns the number of path points.
◆ getPathPointAlpha
| float MLCSOWrapper::getPathPointAlpha |
( |
| ) |
const |
|
slot |
Returns the path point alpha of this CSO.
◆ getPathPointColor
| QVariantList MLCSOWrapper::getPathPointColor |
( |
| ) |
const |
|
slot |
Returns the path point color of this CSO.
◆ getPathPoints
| QList< float > MLCSOWrapper::getPathPoints |
( |
| ) |
const |
|
slot |
Returns all path points making up the CSO in world coordinates (xyz tuple).
The returned list of path points contains no duplicates; note that for a closed CSO, the first and the last position in this returned list are also not duplicates. If you want to compute the length of a closed CSO by adding the distances between all path points in this list, make sure to finally add the distance between the last and the first path points!
◆ getPathPointsAsNumPyArray
| QVariant MLCSOWrapper::getPathPointsAsNumPyArray |
( |
| ) |
const |
|
slot |
◆ getPathPointsListAt
| QList< float > MLCSOWrapper::getPathPointsListAt |
( |
unsigned int |
index | ) |
const |
|
slot |
Returns the points of the path point list at the given index.
◆ getPathPointStyle
| int MLCSOWrapper::getPathPointStyle |
( |
| ) |
const |
|
slot |
Returns the path point style of this CSO.
◆ getPathPointWidth
| float MLCSOWrapper::getPathPointWidth |
( |
| ) |
const |
|
slot |
Returns the path point width of this CSO.
◆ getPlaneNormal
| QVariantList MLCSOWrapper::getPlaneNormal |
( |
| ) |
const |
|
slot |
Returns the plane normal. Only valid if isInPlane returns 'true'.
◆ getSeedPointAlpha
| float MLCSOWrapper::getSeedPointAlpha |
( |
| ) |
const |
|
slot |
Returns the seed point alpha of this CSO.
◆ getSeedPointColor
| QVariantList MLCSOWrapper::getSeedPointColor |
( |
| ) |
const |
|
slot |
Returns the seed point color of this CSO.
◆ getSeedPointPositionAt
| QVariantList MLCSOWrapper::getSeedPointPositionAt |
( |
unsigned int |
index | ) |
const |
|
slot |
Returns the seed point position at the given index.
◆ getSeedPointPositions
| QList< QVariant > MLCSOWrapper::getSeedPointPositions |
( |
| ) |
const |
|
slot |
Returns all seed points' positions as a list of lists: ((x1,y1,z1), (x2,y2,z2), ... , (xn,yn,zn))
◆ getSeedPoints
| QList< float > MLCSOWrapper::getSeedPoints |
( |
| ) |
const |
|
slot |
Returns all seed points' positions as a flat list: (x1,y1,z1, x2,y2,z2, ... , xn,yn,zn)
◆ getSeedPointsAsNumPyArray
| QVariant MLCSOWrapper::getSeedPointsAsNumPyArray |
( |
| ) |
const |
|
slot |
Returns the seed points' positions as numpy array.
◆ getSeedPointSize
| float MLCSOWrapper::getSeedPointSize |
( |
| ) |
const |
|
slot |
Returns the seed point size of this CSO.
◆ getSeedPointStyle
| int MLCSOWrapper::getSeedPointStyle |
( |
| ) |
const |
|
slot |
Returns the seed point style of this CSO.
◆ getShowState
| bool MLCSOWrapper::getShowState |
( |
| ) |
const |
|
slot |
Returns the 'show' status of this CSO.
◆ getSubType
| QString MLCSOWrapper::getSubType |
( |
| ) |
const |
|
slot |
Returns the subtype of the CSO. This is set by the processor or editor that generated this CSO.
◆ getTimePointIndex
| int MLCSOWrapper::getTimePointIndex |
( |
| ) |
const |
|
slot |
Returns the time point index of this CSO.
◆ getType
| QString MLCSOWrapper::getType |
( |
| ) |
const |
|
slot |
Returns the type of the CSO. This is set by the processor or editor that generated this CSO.
◆ getUserData [1/2]
| QVariant MLCSOWrapper::getUserData |
( |
const QString & |
name | ) |
const |
|
slot |
Returns the user data under the given name or an invalid value if the entry does not exist.
◆ getUserData [2/2]
| QVariant MLCSOWrapper::getUserData |
( |
const QString & |
name, |
|
|
const QVariant & |
defaultValue |
|
) |
| const |
|
slot |
Returns the user data under the given name or the given default value if the entry does not exist.
◆ getUserDataNames
| QStringList MLCSOWrapper::getUserDataNames |
( |
| ) |
const |
|
slot |
Returns the keys/names under which user data are stored for this CSO.
◆ getVoxelBoundingBox
| QVariantList MLCSOWrapper::getVoxelBoundingBox |
( |
const QVariantList & |
worldToVoxelMatrix | ) |
const |
|
slot |
Returns the bounding box of this contour in voxel coordinates computed by the given (image) matrix.
◆ getVoxelBoundingBoxSeedPoints
| QVariantList MLCSOWrapper::getVoxelBoundingBoxSeedPoints |
( |
const QVariantList & |
worldToVoxelMatrix | ) |
const |
|
slot |
Returns the bounding box of the seed points of this CSO in voxel coordinates computed by the given (image) matrix.
◆ getVoxelizeState
| bool MLCSOWrapper::getVoxelizeState |
( |
| ) |
const |
|
slot |
Returns the 'voxelize' state of this CSO.
◆ getVoxelWriteMode
Returns the voxel write mode of this CSO.
◆ getVoxelWriteValue
| float MLCSOWrapper::getVoxelWriteValue |
( |
| ) |
const |
|
slot |
Returns the voxel write value of this CSO.
◆ getWorldBoundingBox
| QVariantList MLCSOWrapper::getWorldBoundingBox |
( |
| ) |
const |
|
slot |
Returns the bounding box of this contour in world coordinates.
◆ hasSelectedSeedPoint
| bool MLCSOWrapper::hasSelectedSeedPoint |
( |
| ) |
const |
|
slot |
Returns whether the CSO has a selected seed point.
◆ isSelfIntersecting
| bool MLCSOWrapper::isSelfIntersecting |
( |
| ) |
const |
|
slot |
Returns whether the CSO is self-intersecting.
◆ level
| void MLCSOWrapper::level |
( |
| ) |
|
|
slot |
Levels this CSO; the best-fitting plane for all CSO points is computed and all CSO points are projected onto that plane.
The CSO is in-plane after this operation.
Note that this might slightly shift the position of the CSO. If there is a more robust way to determine the target plane, use levelToPlane(...) method instead!
◆ levelToPlane
| void MLCSOWrapper::levelToPlane |
( |
QVariantList |
normal, |
|
|
QVariantList |
planeAnchorPoint |
|
) |
| |
|
slot |
Levels this CSO by projecting all points to the plane defined by the normal and the plane anchor point.
◆ moveSeedPointsAndPathPoints
| void MLCSOWrapper::moveSeedPointsAndPathPoints |
( |
float |
dx, |
|
|
float |
dy, |
|
|
float |
dz, |
|
|
int |
timepoint |
|
) |
| |
|
inlineslot |
Moves all seed points and all path points by the given coordinates offset.
The timepoint value is simply set to the CSO's; it is not used as an offset to the existing timepoint.
◆ recomputePathPointsEllipse
| void MLCSOWrapper::recomputePathPointsEllipse |
( |
double |
pointDistanceInMM = 1.0 | ) |
|
|
slot |
Interpolates all path points to fit an ellipse.
◆ recomputePathPointsLinear
| void MLCSOWrapper::recomputePathPointsLinear |
( |
double |
pointDistanceInMM = 1.0 | ) |
|
|
slot |
Interpolates all path points linearly.
◆ recomputePathPointsSplineApproximation
| void MLCSOWrapper::recomputePathPointsSplineApproximation |
( |
double |
pointDistanceInMM = 1.0 | ) |
|
|
slot |
Interpolates all path points with a spline approximation.
◆ recomputePathPointsSplineInterpolation
| void MLCSOWrapper::recomputePathPointsSplineInterpolation |
( |
double |
pointDistanceInMM = 1.0 | ) |
|
|
slot |
Interpolates all path points with a spline interpolation.
◆ redistributeSeedPointsEveryNthPathPoint
| void MLCSOWrapper::redistributeSeedPointsEveryNthPathPoint |
( |
int |
everyNthPathPoint, |
|
|
bool |
notifyObservers = true |
|
) |
| |
|
slot |
Redistributes seed points so that everyNthPathPoint, there will be a seed point.
- Parameters
-
| notifyObservers | If true (the default) a "CSO finished" notification is sent after completion. |
◆ removeAllGroups
| void MLCSOWrapper::removeAllGroups |
( |
| ) |
|
|
slot |
Removes this CSO from all its groups.
Deprecated: use removeFromAllGroups instead!
◆ removeFromAllGroups
| void MLCSOWrapper::removeFromAllGroups |
( |
| ) |
|
|
slot |
Removes this CSO from all its groups.
◆ removeFromGroup
| bool MLCSOWrapper::removeFromGroup |
( |
int |
id, |
|
|
bool |
useUndoRedo = true |
|
) |
| |
|
slot |
Removes this CSO from the group with the given ID.
Returns false if the group ID is invalid.
◆ removeGroup
| bool MLCSOWrapper::removeGroup |
( |
int |
id, |
|
|
bool |
useUndoRedo = true |
|
) |
| |
|
slot |
Removes this CSO from the group with the given ID.
Returns false if the group ID is invalid. Deprecated: use removeFromGroup instead!
◆ removeUserData
| void MLCSOWrapper::removeUserData |
( |
const QString & |
name | ) |
|
|
slot |
Removes a user data entry.
◆ setDescription
| void MLCSOWrapper::setDescription |
( |
QString |
desc | ) |
|
|
slot |
Sets the description of this CSO.
◆ setEditableState
| void MLCSOWrapper::setEditableState |
( |
bool |
editableState | ) |
|
|
slot |
Sets the 'editable' state of this CSO.
◆ setId
| void MLCSOWrapper::setId |
( |
unsigned int |
id | ) |
|
|
slot |
Sets the unique ID of this CSO. Note that uniqueness is not checked.
◆ setLabel
| void MLCSOWrapper::setLabel |
( |
QString |
label | ) |
|
|
slot |
Sets the label of this CSO.
◆ setPathPointAlpha
| void MLCSOWrapper::setPathPointAlpha |
( |
float |
alpha | ) |
|
|
slot |
Sets the path point alpha of this CSO.
◆ setPathPointColor
| void MLCSOWrapper::setPathPointColor |
( |
QVariantList |
| ) |
|
|
slot |
Sets the path point color of this CSO.
◆ setPathPointStyle
| void MLCSOWrapper::setPathPointStyle |
( |
int |
lStyle | ) |
|
|
slot |
Sets the path point style of this CSO.
◆ setPathPointWidth
| void MLCSOWrapper::setPathPointWidth |
( |
float |
width | ) |
|
|
slot |
Sets the path point width of this CSO.
◆ setSeedPointAlpha
| void MLCSOWrapper::setSeedPointAlpha |
( |
float |
alpha | ) |
|
|
slot |
Sets the seed point alpha of this CSO.
◆ setSeedPointColor
| void MLCSOWrapper::setSeedPointColor |
( |
QVariantList |
| ) |
|
|
slot |
Sets the seed point color of this CSO.
◆ setSeedPointPositionAt
| void MLCSOWrapper::setSeedPointPositionAt |
( |
unsigned int |
index, |
|
|
QVariantList |
newPosition |
|
) |
| |
|
slot |
Sets the seed point's position at the given index.
Note that no GEOMETRY_CHANGE events are sent when calling this method and path points are not touched. Therefore, one of the recomputePathPoints* methods has to be called after changing the seed point geometry, which catches up on both.
◆ setSeedPointsAndPathPoints [1/2]
| void MLCSOWrapper::setSeedPointsAndPathPoints |
( |
const MLCSOWrapper * |
csoWrapper, |
|
|
bool |
useUndoRedo = true |
|
) |
| |
|
slot |
Sets the seed points and the path point of the given CSO.
◆ setSeedPointsAndPathPoints [2/2]
| void MLCSOWrapper::setSeedPointsAndPathPoints |
( |
const QVariantList & |
seedPoints, |
|
|
const QVariantList & |
pathPointLists, |
|
|
bool |
closed, |
|
|
bool |
useUndoRedo |
|
) |
| |
|
slot |
Sets the given seed points and the path points.
◆ setSeedPointSelectedAt
| void MLCSOWrapper::setSeedPointSelectedAt |
( |
unsigned int |
index | ) |
|
|
slot |
Sets the seed point at the given index as selected. Does not change the CSO's selection state.
◆ setSeedPointSize
| void MLCSOWrapper::setSeedPointSize |
( |
float |
size | ) |
|
|
slot |
Sets the seed point size of this CSO.
◆ setSeedPointStyle
| void MLCSOWrapper::setSeedPointStyle |
( |
int |
sStyle | ) |
|
|
slot |
Sets the seed point style of this CSO.
◆ setShowState
| void MLCSOWrapper::setShowState |
( |
bool |
showState | ) |
|
|
slot |
Sets the 'show' status of this CSO.
◆ setSubType
| void MLCSOWrapper::setSubType |
( |
const QString & |
newSubType | ) |
|
|
slot |
Sets the subtype of the CSO.
This is used to identify a processor's preset or the editor responsible for this kind of CSO.
◆ setTimePointIndex
| void MLCSOWrapper::setTimePointIndex |
( |
int |
index | ) |
|
|
slot |
Sets the time point index of this CSO.
◆ setType
| void MLCSOWrapper::setType |
( |
const QString & |
newType | ) |
|
|
slot |
Sets the type of the CSO.
◆ setUserData
| void MLCSOWrapper::setUserData |
( |
const QString & |
name, |
|
|
const QVariant & |
value |
|
) |
| |
|
slot |
Sets or adds a user data value under the given name.
◆ setVoxelizeState
| void MLCSOWrapper::setVoxelizeState |
( |
bool |
voxelizeState | ) |
|
|
slot |
Sets the 'voxelize' state of this CSO.
◆ setVoxelWriteMode
Sets the voxel write mode of this CSO.
◆ setVoxelWriteValue
| void MLCSOWrapper::setVoxelWriteValue |
( |
float |
vwV | ) |
|
|
slot |
Sets the voxel write value of this CSO.
◆ area
Returns the area of the CSO.
◆ creatorId
| int MLCSOWrapper::creatorId |
|
read |
Returns the ID of the creator.
◆ csoList
◆ description
| QString MLCSOWrapper::description |
|
readwrite |
Sets or reads the description.
◆ editableState
| bool MLCSOWrapper::editableState |
|
readwrite |
Sets or reads the editable state.
◆ id
◆ isClosed
| bool MLCSOWrapper::isClosed |
|
read |
Returns whether the CSO is closed.
◆ isFinished
| bool MLCSOWrapper::isFinished |
|
read |
Returns whether the CSO is finished.
◆ isInPlane
| bool MLCSOWrapper::isInPlane |
|
read |
Returns whether the CSO is planar.
◆ label
| QString MLCSOWrapper::label |
|
readwrite |
◆ length
| float MLCSOWrapper::length |
|
read |
Returns the length of the CSO.
◆ numGroups
| int MLCSOWrapper::numGroups |
|
read |
Returns the number of groups this CSO is in.
◆ numSeedPoints
| int MLCSOWrapper::numSeedPoints |
|
read |
Returns the number of seed points.
◆ numUniquePathPoints
| int MLCSOWrapper::numUniquePathPoints |
|
read |
Returns the number of path points.
◆ pathPointAlpha
| float MLCSOWrapper::pathPointAlpha |
|
readwrite |
Sets or reads the path point alpha.
◆ pathPointColor
| QVariantList MLCSOWrapper::pathPointColor |
|
readwrite |
Sets or reads the path point color.
◆ pathPointStyle
| int MLCSOWrapper::pathPointStyle |
|
readwrite |
Sets or reads the path point style.
◆ pathPointWidth
| float MLCSOWrapper::pathPointWidth |
|
readwrite |
Sets or reads the path point width.
◆ seedPointAlpha
| float MLCSOWrapper::seedPointAlpha |
|
readwrite |
Sets or reads the seed point alpha.
◆ seedPointColor
| QVariantList MLCSOWrapper::seedPointColor |
|
readwrite |
Sets or reads the seed point color.
◆ seedPointSize
| float MLCSOWrapper::seedPointSize |
|
readwrite |
Sets or reads the seed point size.
◆ seedPointStyle
| int MLCSOWrapper::seedPointStyle |
|
readwrite |
Sets or reads the seed point style.
◆ showState
| bool MLCSOWrapper::showState |
|
readwrite |
Sets or reads the show state.
◆ subType
| QString MLCSOWrapper::subType |
|
readwrite |
◆ timePointIndex
| int MLCSOWrapper::timePointIndex |
|
readwrite |
Sets or reads the time point index.
◆ type
| QString MLCSOWrapper::type |
|
readwrite |
◆ voxelizeState
| bool MLCSOWrapper::voxelizeState |
|
readwrite |
Sets or reads the voxelize state.
◆ voxelWriteMode
Sets or reads the voxel write mode.
◆ voxelWriteValue
| float MLCSOWrapper::voxelWriteValue |
|
readwrite |
Sets or reads the voxel write value.