ROI¶
Inheritance diagram¶
Classes¶
ROI¶
-
class
ORSModel.ors.ROI¶ Bases:
ORSModel.ors.StructuredGridbrief_description: Represents a region of interest for a dataset. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005 see: VisualChannel, MeshFacesROI Represents a VisualRegion of Interest (ROI) for a dataset. Can be used to highlight, subtract, extract, etc, portions of a dataset. Each ROI has its own color, opacity, visual state, etc. Only a limited amount of ROIs (255) can be visible simultaneously.
-
adaptToChannel(self, pChannel: ORSModel.ors.Channel, x: int, y: int, z: int, pTSourceOffset: int, pTRange: int) → None¶ Adapts aROI to a channel, according to the channel’s coordinates.
Note
The supplied X/Y/Z offset is the offset of the given channel relatively to the originating channel (the one the ROI is based upon), in voxels.
Parameters: - pChannel (ORSModel.ors.Channel) – a reference channel (an Channel)
- x (int) – an X offset (an short)
- y (int) – an Y offset (an short)
- z (int) – a Z offset (an short)
- pTSourceOffset (int) – the T start position of the ROI (a uint32_t)
- pTRange (int) – the number of Ts to process (a uint32_t)
-
addCircleArea(self, posX: float, posY: float, posZ: float, normalX: float, normalY: float, normalZ: float, radius: float, tStep: int) → None¶ Add circle area toROI.
Parameters: - posX (float) –
- posY (float) –
- posZ (float) –
- normalX (float) –
- normalY (float) –
- normalZ (float) –
- radius (float) –
- tStep (int) –
-
addCircularPath2D(self, path: ORSModel.ors.VisualPath, box: ORSModel.ors.Box, plane: ORSModel.ors.Plane, includeAllTouchingVoxel: bool, inverse: bool, bRemove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Add a 2D polygon from aVisualPath to the ROI.
Parameters: - path (ORSModel.ors.VisualPath) –
- box (ORSModel.ors.Box) –
- plane (ORSModel.ors.Plane) –
- includeAllTouchingVoxel (bool) –
- inverse (bool) –
- bRemove (bool) –
- IProgress (ORSModel.ors.Progress) –
- tStep (int) –
-
addCircularPath3D(self, path: ORSModel.ors.VisualPath, box: ORSModel.ors.Box, plane: ORSModel.ors.Plane, includeAllTouchingVoxel: bool, inverse: bool, bRemove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Add a 3D polygon from aVisualPath to the ROI.
Parameters: - path (ORSModel.ors.VisualPath) –
- box (ORSModel.ors.Box) –
- plane (ORSModel.ors.Plane) –
- includeAllTouchingVoxel (bool) –
- inverse (bool) –
- bRemove (bool) –
- IProgress (ORSModel.ors.Progress) –
- tStep (int) –
-
addEllipse2D(self, plane: ORSModel.ors.Rectangle, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Adds a 2D ellipse to theROI.
Parameters: - plane (ORSModel.ors.Rectangle) – the bounded plane on which the ellipse lies (an Rectangle)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
- tStep (int) – time step for which to add the ellipse (a uint32_t)
-
addEllipse3D(self, plane: ORSModel.ors.Rectangle, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Adds a 2D ellipse to theROI.
Parameters: - plane (ORSModel.ors.Rectangle) – the bounded plane on which the ellipse lies (an Rectangle)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
- tStep (int) – time step for which to add the ellipse (a uint32_t)
-
addLine(self, pLine: ORSModel.ors.Line, tStep: int) → None¶ Adds a line to theROI.
Note
Note that the range values are inclusive.
Parameters: - pLine (ORSModel.ors.Line) – None
- tStep (int) – step
-
addLineIfInRange(self, pLine: ORSModel.ors.Line, tStep: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Adds a line to theROI if the corresponding voxels in the channel are within the specified range.
Note
Note that the range values are inclusive.
Parameters: - pLine (ORSModel.ors.Line) – the line to add (an Line)
- tStep (int) – the time step (a uint32_t)
- lowerThreshold (float) – the lower range value (a double)
- upperThreshold (float) – the upper range value (a double)
- pChannel (ORSModel.ors.Channel) – a channel of the same shape as the receiver (an Channel)
-
addLineSegment(self, lineSegment: ORSModel.ors.LineSegment, tStep: int) → None¶ Adds a line segment to theROI.
Parameters: - lineSegment (ORSModel.ors.LineSegment) – the line to remove (an Line)
- tStep (int) – the time step (a uint32_t)
-
addLineSegmentIfInRange(self, lineSegment: ORSModel.ors.LineSegment, tStep: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Adds a line segment to theROI if the corresponding voxels in the channel are within the specified range.
Note
Note that the range values are inclusive.
Parameters: - lineSegment (ORSModel.ors.LineSegment) – the line segment to add (an LineSegment)
- tStep (int) – the time step (a uint32_t)
- lowerThreshold (float) – the lower range value (a double)
- upperThreshold (float) – the upper range value (a double)
- pChannel (ORSModel.ors.Channel) – a channel of the same shape as the receiver (an Channel)
-
addPathContour(self, aPath: ORSModel.ors.VisualPath, aBox: ORSModel.ors.Box, tStep: int) → None¶ Add aVisualPath contour to the ROI.
Parameters: - aPath (ORSModel.ors.VisualPath) –
- aBox (ORSModel.ors.Box) –
- tStep (int) –
-
addPolygon2D(self, ptsList: float, ptsListSize: int, plane: ORSModel.ors.Plane, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Add a 3D polygon to theROI.
Note
This method adds a 3D polygon, not a polyhedron. The points must lie on the same plane. The polygon is fill in the plane normal direction
Parameters: - ptsList (float) – the points list (a double array)
- ptsListSize (int) – the size of the point list (an int)
- plane (ORSModel.ors.Plane) – the plane on which the points lie (a Plane)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
- tStep (int) – the T index (a uint32_t)
-
addPolygon3D(self, ptsList: float, ptsListSize: int, plane: ORSModel.ors.Plane, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Add a 3D polygon to theROI.
Note
This method adds a 3D polygon, not a polyhedron. The points must lie on the same plane. The polygon is fill in the plane normal direction
Parameters: - ptsList (float) – the points list (a double array)
- ptsListSize (int) – the size of the point list (an int)
- plane (ORSModel.ors.Plane) – the plane on which the points lie (a Plane)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (a Progress)
- tStep (int) – the T index (a uint32_t)
-
addROI(self, aROI: ORSModel.ors.ROI) → None¶ Adds aROI to the current ROI.
Note
The ROI to add will be projected correctly if it doesn’t share the same characteristics.
Parameters: aROI (ORSModel.ors.ROI) – the ROI to add (an ROI)
-
addROIAtTimeStepAtTOffset(self, aROI: ORSModel.ors.ROI, timeIndex: int, pTOffset: int) → None¶ Adds aROI to the current ROI, but at a specific T offset.
Note
The ROI to add will be projected correctly if it doesn’t share the same characteristics.
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to add (an ROI)
- timeIndex (int) –
- pTOffset (int) –
-
addRectangle2D(self, plane: ORSModel.ors.Rectangle, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Note
This method adds a 3D rectangle. The points must lie on the same plane. The polygon is filled in the plane normal direction.
Parameters: - plane (ORSModel.ors.Rectangle) – the bounded plane on which the rectangle lies (an Rectangle)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
- tStep (int) – time step for which to add the rectangle (a uint32_t)
-
addRectangle3D(self, plane: ORSModel.ors.Rectangle, includeAllTouchingVoxel: bool, inverse: bool, remove: bool, IProgress: ORSModel.ors.Progress, tStep: int) → None¶ Note
This method adds a 3D rectangle. The points must lie on the same plane. The polygon is filled in the plane normal direction.
Parameters: - plane (ORSModel.ors.Rectangle) – the bounded plane on which the rectangle lies (an Rectangle)
- includeAllTouchingVoxel (bool) – true to include all touching voxels, false to only include voxels where center is included
- inverse (bool) – true to add the inverse of the polygon
- remove (bool) – true to remove the polygon, false to add it
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
- tStep (int) – time step for which to add the rectangle (a uint32_t)
-
addToVolumeROIAtPosition(self, xmin: int, ymin: int, zmin: int, tmin: int, inputROI: ORSModel.ors.ROI) → ROI¶ Extracts a subset from indices.
Parameters: - xmin (int) – the minimal X indicies of the subset (a uint32_t)
- ymin (int) – the maximal Y indicies of the subset (a uint32_t)
- zmin (int) – the minimal Z indicies of the subset (a uint32_t)
- tmin (int) – the time step start (a uint32_t)
- inputROI (ORSModel.ors.ROI) – the subset ROI
Returns: output (ORSModel.ors.ROI) –
-
addVoxel(self, index: int) → None¶ Adds a voxel.
Note
The index is linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Note
If many voxels need to be added, it is better to use the protocols that accept a list of voxels.
Parameters: index (int) – the index of the voxel (a int64_t)
-
addVoxelFromWorldCoordinates(self, pVect: ORSModel.ors.Vector3, timeIndex: int) → None¶ Parameters: - pVect (ORSModel.ors.Vector3) – pVect
- timeIndex (int) – the T index (a uint32_t)
-
addVoxelIndicesToROIIfInRange(self, indices: int, indicesSize: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Adds indices to theROI, checking against a range.
Note
Only those indicies having values within the supplied range are added to the ROI.
Parameters: - indices (int) – an array of indices (a int64_t*)
- indicesSize (int) – the number of indices in the array (a int64_t)
- lowerThreshold (float) – the lower range (a double)
- upperThreshold (float) – the upper range (a double)
- pChannel (ORSModel.ors.Channel) – the channel to check against (an Channel)
-
addVoxelIntersectingBoundedPlane(self, aPlane: ORSModel.ors.Rectangle, tStep: int) → None¶ Add voxel intersecting bounded plane.
Parameters: - aPlane (ORSModel.ors.Rectangle) –
- tStep (int) –
-
addVoxelInterval(self, iStart: int, iEnd: int) → None¶ Adds a voxel interval of indicies.
Note
Every voxel within the interval will be added to the Region of Interest.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: - iStart (int) – the start value (inclusive) of the interval (a int64_t)
- iEnd (int) – the end value (inclusive) of the interval (a int64_t)
-
addVoxelIntervals(self, pIntervalArray: int, pNumberOfIntervals: int) → None¶ Adds a list of voxel indicies intervals.
Note
Every voxel within the interval will be added to the Region of Interest.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: - pIntervalArray (int) – an array of interval begin and end (inclusive) values (a int64_t*)
- pNumberOfIntervals (int) – the number of interval pairs in the array (a int32_t*)
-
addVoxels(self, indices: int, indicesSize: int) → None¶ Adds a list of voxels.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Note
If the array is sorted, addition will perform quicker.
Parameters: - indices (int) – an array of indicies (a int64_t*)
- indicesSize (int) – the number of indicies in the array (a int64_t)
-
addVoxelsFromWorldCoordinates(self, worldPositionArray: ORSModel.ors.ArrayDouble, timeIndex: int) → None¶ Adds indices (supplied in the form of world coordinates) to theROI.
Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) – an array of world position triplets (an ArrayDouble)
- timeIndex (int) – the T index (a uint32_t)
-
addVoxelsFromWorldCoordinatesIfInRange(self, worldPositionArray: ORSModel.ors.ArrayDouble, timeIndex: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Adds indices (supplied in the form of world coordinates) to theROI, checking against a range.
Note
Very similar to addVoxelsFromWorldCoordinates(), but only those indicies having values within the supplied range are added to the ROI.
Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) – an array of world position triplets (an ArrayDouble)
- timeIndex (int) – the T index (a uint32_t)
- lowerThreshold (float) – the lower range (a double)
- upperThreshold (float) – the upper range (a double)
- pChannel (ORSModel.ors.Channel) – the channel to check against (an Channel)
-
clear(self) → None¶ Empties all voxel data from the region of interest.
-
clearROI()¶
-
clearTimeStepRange(self, pTimeStepStart: int, pTimeStepEnd: int) → None¶ Empties a time step range of the region of interest.
Parameters: - pTimeStepStart (int) – the time step start (a uint32_t)
- pTimeStepEnd (int) – the time step end (a uint32_t)
-
closeHoles(threshold, progress)¶ Creates a ROI obtained from the closing operation of the input ROI
Parameters: - threshold (float) – distance threshold
- progress (ORSModel.ors.Progress) – progress object
Returns: closedROI (ORSModel.ors.ROI) – a new ROI
-
computeAnisotropyAtLocationFromMIL(self, iTIndex: int, centerPositionRCS: ORSModel.ors.Vector3, lengthToAnalyze: float, samplingDistance: float, countOrientations: int, anisotropy: float, eigenvectorMax: ORSModel.ors.Vector3, eigenvalueMax: float, eigenvectorMid: ORSModel.ors.Vector3, eigenvalueMid: float, eigenvectorMin: ORSModel.ors.Vector3, eigenvalueMin: float, fabricTensor: ORSModel.ors.Matrix4x4, arrayOrientedMeanInterceptLengths: ORSModel.ors.ArrayDouble) → None¶ Computes the anisotropy of aROI using the Mean Intercept Length (MIL) at the specified location.
Note
to call this method from Python, use this syntax: eigenvectorMax = Vector3(); eigenvectorMid = Vector3(); eigenvectorMin = Vector3(); fabricTensor = Matrix4x4(); arrayOrientedMeanInterceptLengths = ArrayDouble(); anisotropy, eigenvalueMax, eigenvalueMid, eigenvalueMin = aROI.computeAnisotropyAtLocationFromMIL(0, Vector3(0.1, 1.1, 2.1), 0.1, 0.001, 5000, eigenvectorMax, eigenvectorMid, eigenvectorMin, fabricTensor, arrayOrientedMeanInterceptLengths)
Parameters: - iTIndex (int) – the T index (a uint32_t)
- centerPositionRCS (ORSModel.ors.Vector3) – the location of the star (a Vector3)
- lengthToAnalyze (float) – the distance to analyze per orientation (a double)
- samplingDistance (float) – the distance between each sample on the line of analysis (a double)
- countOrientations (int) – the count of lines to analyze (a uint32_t)
Returns: - anisotropy (float) – the anisotropy (a double*)
- eigenvectorMax (ORSModel.ors.Vector3) – the normalized eigenvector associated to the longest axis of the ellipsoid (a Vector3)
- eigenvalueMax (float) – the eigenvalue associated to the longest axis of the ellipsoid (a double*)
- eigenvectorMid (ORSModel.ors.Vector3) – the normalized eigenvector associated to the medium axis of the ellipsoid (a Vector3)
- eigenvalueMid (float) – the eigenvalue associated to the medium axis of the ellipsoid (a double*)
- eigenvectorMin (ORSModel.ors.Vector3) – the normalized eigenvector associated to the smallest axis of the ellipsoid (a Vector3)
- eigenvalueMin (float) – the eigenvalue associated to the smallest axis of the ellipsoid (a double*)
- fabricTensor (ORSModel.ors.Matrix4x4) – the fabric tensor used to compute the eigenvectors and eigenvalues (a Matrix4x4)
- arrayOrientedMeanInterceptLengths (ORSModel.ors.ArrayDouble) – the array of the oriented mean intercept lengths (X, Y, Z for each orientation) used to compute the fabric tensor (an ArrayDouble)
-
computeAnisotropyFromMIL(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, iTIndex: int, lengthToAnalyze: float, samplingDistance: float, countOrientations: int, minStarCount: int, maxStarCount: int, tolerance: float, IProgress: ORSModel.ors.Progress) → float¶ Computes the anisotropy of aROI using the Mean Intercept Length (MIL) in the specified region.
Parameters: - minX (int) – the minimum X range (a uint32_t)
- minY (int) – the minimum Y range (a uint32_t)
- minZ (int) – the minimum Z range (a uint32_t)
- maxX (int) – the maximum X range (a uint32_t)
- maxY (int) – the maximum Y range (a uint32_t)
- maxZ (int) – the maximum Z range (a uint32_t)
- iTIndex (int) – the T index (a uint32_t)
- lengthToAnalyze (float) – the distance to analyze per orientation per star (a double)
- samplingDistance (float) – the distance between each sample on the line of analysis (a double)
- countOrientations (int) – the count of lines to analyze per star (a uint32_t)
- minStarCount (int) – the minimal count of star to iterate on (a uint32_t)
- maxStarCount (int) – the maximal count of star to iterate on (a uint32_t)
- tolerance (float) – the smallest variance of anisotropy to reach before ending the iterations (a double)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (float) – the anisotropy value (a double)
-
computeAnisotropyFromSVD(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, iTIndex: int, lengthToAnalyze: float, samplingDistance: float, countOrientations: int, minStarCount: int, maxStarCount: int, tolerance: float, IProgress: ORSModel.ors.Progress) → float¶ Computes the anisotropy of aROI using the Star Volume Distribution (SVD) in the specified region.
Parameters: - minX (int) – the minimum X range (a uint32_t)
- minY (int) – the minimum Y range (a uint32_t)
- minZ (int) – the minimum Z range (a uint32_t)
- maxX (int) – the maximum X range (a uint32_t)
- maxY (int) – the maximum Y range (a uint32_t)
- maxZ (int) – the maximum Z range (a uint32_t)
- iTIndex (int) – the T index (a uint32_t)
- lengthToAnalyze (float) – the distance to analyze per orientation per star (a double)
- samplingDistance (float) – the distance between each sample on the line of analysis (a double)
- countOrientations (int) – the count of lines to analyze per star (a uint32_t)
- minStarCount (int) – the minimal count of star to iterate on (a uint32_t)
- maxStarCount (int) – the maximal count of star to iterate on (a uint32_t)
- tolerance (float) – the smallest variance of anisotropy to reach before ending the iterations (a double)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (float) – the anisotropy value (a double)
-
computeAnisotropyMappingFromMIL(self, iTIndex: int, channelToFill: ORSModel.ors.Channel, vectorFieldEigenvectorMax: ORSModel.ors.VectorField, lengthToAnalyze: float, samplingDistance: float, countOrientations: int, IProgress: ORSModel.ors.Progress) → bool¶ Computes the anisotropy mapping of aROI at the specified locations using the mean intercept length (MIL)
Note
The vector field object will be cleared before being filled with the current information.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- channelToFill (ORSModel.ors.Channel) – the channel to fill at each voxel location (an Channel)
- vectorFieldEigenvectorMax (ORSModel.ors.VectorField) – the vector field (eigenvector associated to the highest eigenvalue) to fill at each voxel location of the given channel (a VectorField)
- lengthToAnalyze (float) – the distance to analyze per orientation per star (a double)
- samplingDistance (float) – the distance between each sample on the line of analysis (a double)
- countOrientations (int) – the count of lines to analyze per star (a uint32_t)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (bool) – true if the computation was completed successfully, false otherwise
-
computeAnisotropyMappingFromSurfaceNormals(self, iTIndex: int, channelToFill: ORSModel.ors.Channel, vectorFieldEigenvectorMax: ORSModel.ors.VectorField, channelToFillNormOfGradient: ORSModel.ors.Channel, channelToFillDivergence: ORSModel.ors.Channel, vectorFieldCurl: ORSModel.ors.VectorField, channelToFillNormOfCurl: ORSModel.ors.Channel, radiusOfInfluence: float, useProjectionBasedAnisotropy: bool, meshSmoothingRepetitions: int, IProgress: ORSModel.ors.Progress) → bool¶ Computes the anisotropy mapping of aROI at the specified locations using the surface normals.
Note
The vector field object will be cleared before being filled with the current information.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- channelToFill (ORSModel.ors.Channel) – the channel (anisotropy) to fill at each voxel location (a Channel)
- vectorFieldEigenvectorMax (ORSModel.ors.VectorField) – the vector field (eigenvector associated to the highest eigenvalue) to fill at each voxel location of the given channel (a VectorField)
- channelToFillNormOfGradient (ORSModel.ors.Channel) – the channel (norm of the gradient of the orientation) to fill at each voxel location (a Channel)
- channelToFillDivergence (ORSModel.ors.Channel) – the channel (divergence of the orientation) to fill at each voxel location (a Channel)
- vectorFieldCurl (ORSModel.ors.VectorField) – the vector field (curl of the orientation) to fill at each voxel location of the given channel (a VectorField)
- channelToFillNormOfCurl (ORSModel.ors.Channel) – the channel (norm of the curl of the orientation) to fill at each voxel location (a Channel)
- radiusOfInfluence (float) – distance from the analysis point to the last considered anisotropy element (a double)
- useProjectionBasedAnisotropy (bool) – anisotropy computation method. If true, the projection based method is used; if false, the eigenvalues from the tensor of inertia are taken (a bool)
- meshSmoothingRepetitions (int) – the number of times the mesh obtained from the ROI should be smoothed before computing the anisotropy (an uint16_t)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (bool) – true if the computation was completed successfully, false otherwise
-
computeDenseGraph(self, IProgress: ORSModel.ors.Progress) → Graph¶ Computes the graph of theROI’s connectivity.
Note
The receiver ROI should already be skeletonized. The receiver should be a proper skeleton without any surface
Parameters: IProgress (ORSModel.ors.Progress) – a progress object (an Progress) Returns: output (ORSModel.ors.Graph) – graph of the ROI’s connectivity
-
computeGraph(self, IProgress: ORSModel.ors.Progress) → Graph¶ Computes the graph of theROI’s connectivity.
Note
The receiver ROI should already be skeletonized. The receiver should be a proper skeleton without any surface
Parameters: IProgress (ORSModel.ors.Progress) – a progress object (an Progress) Returns: output (ORSModel.ors.Graph) – graph of the ROI’s connectivity
-
computeVolumeFractionMapping(self, iTIndex: int, channelToFill: ORSModel.ors.Channel, radius: float, IProgress: ORSModel.ors.Progress) → bool¶ Computes the volume fraction mapping of aROI at the specified locations.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- channelToFill (ORSModel.ors.Channel) – the channel to fill at each voxel location (an Channel)
- radius (float) – distance from the analysis point to the last considered ROI element (a double)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (bool) – true if the computation was completed successfully, false otherwise
-
convertToChannel(value=255)¶ Helper for setting the attribute of the object following the preferences
Parameters: value (int) – value to put in the Channel (should be between 0 and 255) Return: Rtype: ORSModel.ors.Channel
-
copyInto(self, aROI: ORSModel.ors.ROI) → None¶ Copies the receiver into anotherROI.
Parameters: aROI (ORSModel.ors.ROI) – a destination ROI (an Volume)
-
dijkstra3DGrow(self, inputChannel: ORSModel.ors.Channel, volumeToGrowIn: ORSModel.ors.Box, volumeOfTheGrow: float, timeStep: int) → None¶ Parameters: - inputChannel (ORSModel.ors.Channel) –
- volumeToGrowIn (ORSModel.ors.Box) –
- volumeOfTheGrow (float) –
- timeStep (int) –
-
dilate(self, pNumberOfIterations: int, pTimeStep: int, progress: ORSModel.ors.Progress) → None¶ Dilates (grows) theROI.
Note
Every voxel of the channel that touches the ROI is added to it, for the given time step.
Parameters: - pNumberOfIterations (int) – the number of dilate iterations (a uint16_t)
- pTimeStep (int) – the time step (a uint32_t)
- progress (ORSModel.ors.Progress) – a progress object (a Progress)
-
duplicateTimeStepDataAcrossAllTimeSteps(self, pSourceTimeStep: int) → None¶ Duplicates data from one time step to all time steps.
Note
The data from the source time step is copied to all the time steps of the ROI.
Parameters: pSourceTimeStep (int) – the source time step (a uint32_t)
-
erode(self, pNumberOfIterations: int, pTimeStep: int, progress: ORSModel.ors.Progress) → None¶ Erodes (shrinks) theROI.
Note
Every voxel of the ROI that touches the channel is removed from the ROI, for the given time step.
Parameters: - pNumberOfIterations (int) – the number of erode iterations (a uint16_t)
- pTimeStep (int) – the time step (a uint32_t)
- progress (ORSModel.ors.Progress) – a progress object (a Progress)
-
exchangeInternalData(self, aROI: ORSModel.ors.ROI) → bool¶ Exchanges (swaps) internal data between the receiver and the argumentROI.
Note
Both ROIs must have same spatial characteristics.
Parameters: aROI (ORSModel.ors.ROI) – a ROI (an ROI) Returns: output (bool) – true if swap was successful, false otherwise
-
extractCenterLinePaths(self, aSourceROI: ORSModel.ors.ROI, aTargetROI: ORSModel.ors.ROI) → List¶ Parameters: - aSourceROI (ORSModel.ors.ROI) –
- aTargetROI (ORSModel.ors.ROI) –
Returns: output (ORSModel.ors.List) –
-
extractMinimumLengthPaths(self, aSourceROI: ORSModel.ors.ROI, aTargetROI: ORSModel.ors.ROI) → List¶ Parameters: - aSourceROI (ORSModel.ors.ROI) –
- aTargetROI (ORSModel.ors.ROI) –
Returns: output (ORSModel.ors.List) –
-
extractSmoothPaths(self, aSourceROI: ORSModel.ors.ROI, aTargetROI: ORSModel.ors.ROI, fastMarchingGeometricBias: float, centered: bool) → List¶ Parameters: - aSourceROI (ORSModel.ors.ROI) –
- aTargetROI (ORSModel.ors.ROI) –
- fastMarchingGeometricBias (float) –
- centered (bool) –
Returns: output (ORSModel.ors.List) –
-
fillAllInnerHoles2DAlongDirection(self, dirX: float, dirY: float, dirZ: float, considerDiagonal: bool) → None¶ Fills all inner holes of 2D slices along any direction.
Note
This method fills the interior of a ROI for each 2D slice along the supplied direction.
Note
This method fills 2D slices by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Parameters: - dirX (float) – the X component of the direction (a double)
- dirY (float) – the Y component of the direction (a double)
- dirZ (float) – the Z component of the direction (a double)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillAllInnerHoles2DAlongXAxis(self, iTIndex: int, considerDiagonal: bool) → None¶ Fills all X slices’ inner holes.
Note
This method fills the interior of a ROI for each 2D slice along the X axis.
Note
This method fills a ROI’s interior by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillAllInnerHoles2DAlongYAxis(self, iTIndex: int, considerDiagonal: bool) → None¶ Fills all Y slices’ inner holes.
Note
This method fills the interior of a ROI for each 2D slice along the Y axis.
Note
This method fills a ROI’s interior by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillAllInnerHoles2DAlongZAxis(self, iTIndex: int, considerDiagonal: bool) → None¶ Fills all Z slices’ inner holes.
Note
This method fills the interior of a ROI for each 2D slice along the Z axis.
Note
This method fills a ROI’s interior by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillInnerHoles(self, iTIndex: int, considerDiagonal: bool) → None¶ Fills theROI’s interior.
Note
This method fills a ROI’s interior by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Note
When trying to close a 2D ROI (for example a circle), you need to work with a 2D ROI (i.e. Z size = 1).
Parameters: - iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillInnerHoles2D(self, pCenter: ORSModel.ors.Vector3, pDirection: ORSModel.ors.Vector3, considerDiagonal: bool) → None¶ Fills theROI’s interior in 2D.
Note
This method fills a ROI’s interior by looking for escape openings. Using 26 neighbors enforces more rigidity in the algorithm to determine if a neighboring voxel is an opening or not.
Note
This method fills the interior of a ROI on a single 2D plane.
Parameters: - pCenter (ORSModel.ors.Vector3) – a vector describing the 2D plane’s center point (an Vector3)
- pDirection (ORSModel.ors.Vector3) – a vector describing the direction of the plane (an Vector3)
- considerDiagonal (bool) – true to use 26 neighbors, false to use 6 neighbors (see note below)
-
fillIntervalArrays(self, pOutputLow: ORSModel.ors.ArrayUnsignedLong, pOutputHigh: ORSModel.ors.ArrayLONGLONG) → None¶ Extracts indicies in the form of intervals.
Returns: - pOutputLow (ORSModel.ors.ArrayUnsignedLong) – an output array for lower indicies (an ArrayUnsignedLong)
- pOutputHigh (ArrayLONGLONG) – an output array for higher indicies (an ArrayLONGLONG)
-
generateAnalyzer(self, aTimeStep: int, inputChannel: ORSModel.ors.Channel, useLinearInterpolation: bool, longestDistance: bool, longestSegment: bool, inertiaTensorPrincipalComponent: bool, surfaceArea: bool, centerOfMass: bool, IProgress: ORSModel.ors.Progress) → ROIAnalyzer¶ Parameters: - aTimeStep (int) –
- inputChannel (ORSModel.ors.Channel) –
- useLinearInterpolation (bool) –
- longestDistance (bool) –
- longestSegment (bool) –
- inertiaTensorPrincipalComponent (bool) –
- surfaceArea (bool) –
- centerOfMass (bool) –
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.ROIAnalyzer) –
-
getAllFeretDiameter(self, min: float, mean: float, max: float, iTIndex: int, iAngleSampling: int) → bool¶ Get Sorted feret diameter.
Parameters: - min (float) – the T index (a uint32_t)
- mean (float) – the angle sampling, steps between each angle iteration (a uint16_t)
- max (float) –
- iTIndex (int) –
- iAngleSampling (int) –
Returns: output (bool) – true if worked, else false (bool)
-
getAsCubicMesh(self, bWorld: bool, IProgress: ORSModel.ors.Progress, IInMesh: ORSModel.ors.Mesh) → Mesh¶ Generates a cubic mesh model from theROI.
Note
If a target Mesh is supplied, data is written to it and returned, otherwise a new Mesh is created.
Parameters: - bWorld (bool) – true to have the resulting mesh model in world coordinates, false in local
- IProgress (ORSModel.ors.Progress) – a progress object or NULL to show no progress (an Progress)
- IInMesh (ORSModel.ors.Mesh) – an optional target mesh model (an Mesh)
Returns: output (ORSModel.ors.Mesh) – the resulting mesh model (an Mesh)
-
getAsCubicMeshForTIndex(self, bWorld: bool, timeStep: int, IProgress: ORSModel.ors.Progress, IInMesh: ORSModel.ors.Mesh) → Mesh¶ Generates a cubic mesh model from theROI.
Note
If a target Mesh is supplied, data is written to it and returned, otherwise a new Mesh is created.
Parameters: - bWorld (bool) – true to have the resulting mesh model in world coordinates, false in local
- timeStep (int) – the TimeStep to extract (a uint32_t)
- IProgress (ORSModel.ors.Progress) – a progress object or NULL to show no progress (an Progress)
- IInMesh (ORSModel.ors.Mesh) – an optional target mesh model (an Mesh)
Returns: output (ORSModel.ors.Mesh) – the resulting mesh model (an Mesh)
-
getAsMarchingCubesMesh(self, isovalue: float, bSnapToContour: bool, flipNormal: bool, timeStep: int, xSample: int, ySample: int, zSample: int, pNearest: bool, pWorld: bool, IProgress: ORSModel.ors.Progress, pMesh: ORSModel.ors.Mesh) → Mesh¶ Creates a marching cube from theROI.
Note
The isovalue is used as a threshold, any value below it (inclusive) is not considered.
Note
If a mesh model is supplied as the last argument, the results are written to it, otherwise a new mesh model is created.
Note
Currently only nearest sampling is supported.
Parameters: - isovalue (float) – an isovalue (a float)
- bSnapToContour (bool) – true to snap vertices to contour, false to interpolate
- flipNormal (bool) – true flips normals, false doesn’t
- timeStep (int) – the time step to use (a uint32_t)
- xSample (int) – the X sampling (a uint16_t, 1 means no sampling)
- ySample (int) – the Y sampling (a uint16_t, 1 means no sampling)
- zSample (int) – the Z sampling (a uint16_t, 1 means no sampling)
- pNearest (bool) – true to sample to nearest value, false to sample linearly (if sampling is 1 this flag is ignored)
- pWorld (bool) – true to have the resulting mesh model in world coordinates, false in local
- IProgress (ORSModel.ors.Progress) – a progress object, NULL for no progress (an Progress)
Returns: - output (ORSModel.ors.Mesh) – the resulting mesh model (an Mesh)
- pMesh (ORSModel.ors.Mesh) – an optional output mesh model (an Mesh)
-
getAsNDArray(timestep=0)¶ Get a numpy nd array representation
Parameters: timestep (int) – timestep to analyse
-
getAsROIClipped(self, minX: int, minY: int, minZ: int, minT: int, maxX: int, maxY: int, maxZ: int, maxT: int, aROI: ORSModel.ors.ROI) → ROI¶ Clips theROI to the specified region.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - minX (int) – the X min dimension of the clip region (a uint32_t)
- minY (int) – the Y min dimension of the clip region (a uint32_t)
- minZ (int) – the Z min dimension of the clip region (a uint32_t)
- minT (int) – the T min dimension of the clip region (a uint32_t)
- maxX (int) – the X max dimension of the clip region (a uint32_t)
- maxY (int) – the Y max dimension of the clip region (a uint32_t)
- maxZ (int) – the Z max dimension of the clip region (a uint32_t)
- maxT (int) – the T max dimension of the clip region (a uint32_t)
- aROI (ORSModel.ors.ROI) – an optional target ROI (an ROI)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROICloseWithKernelOnSpecificSlices(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, axis: int, indices: ORSModel.ors.SequenceableCollection, progress: ORSModel.ors.Progress) → ROI¶ Close theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- axis (int) – the axis of the specified slices (x=0,y=1,z=2) (a uint8_t)
- indices (ORSModel.ors.SequenceableCollection) – the slices to work on (an SequenceableCollection)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIClosedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int) → ROI¶ Closes theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
Correlates theROI with a supplied 3D kernel.
Note
This method can be used to smooth the ROI by providing a smoothing kernel (e.g. with a gaussian distribution).
Note
If a mask is provided, its T size should be 1.
Note
All voxels of the input ROI not in the mask are copied into the output ROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- threshold (float) – the threshold value (a double). The output ROI will contain this voxel if the result of the correlation at that voxel is greater than or equal to this threshold value.
- pTimeStep (int) – the time step of the receiver ROI to smooth (a uint32_t)
- pROIMask (ORSModel.ors.ROI) – an optional mask (a ROI)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (a ROI)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (a ROI)
-
getAsROIDilatedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, progress: ORSModel.ors.Progress) → ROI¶ Dilates (grows) theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIDilatedWithKernelOnSpecificSlices(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, axis: int, indices: ORSModel.ors.SequenceableCollection, progress: ORSModel.ors.Progress) → ROI¶ Dilates (grows) theROI according to a supplied 3D kernel on the specified slices.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- axis (int) – the axis of the specified slices (x=0,y=1,z=2) (a uint8_t)
- indices (ORSModel.ors.SequenceableCollection) – the slices to work on (an SequenceableCollection)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIErodedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, progress: ORSModel.ors.Progress) → ROI¶ Erodes (shrinks) theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIErodedWithKernelOnSpecificSlices(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, axis: int, indices: ORSModel.ors.SequenceableCollection, progress: ORSModel.ors.Progress) → ROI¶ Erode (shrink) theROI according to a supplied 3D kernel on the specified slices.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- axis (int) – the axis of the specified slices (x=0,y=1,z=2) (a uint8_t)
- indices (ORSModel.ors.SequenceableCollection) – the slices to work on (an SequenceableCollection)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIFromTimeStepsUnion(self, pTimeStep1: int, pTimeStep2: int, anOutputROI: ORSModel.ors.ROI) → ROI¶ Merges (union) 2 time steps of theROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Note
The output ROI will always have a T dimension of 1, and the same X/Y/Z sizes as the source ROI.
Note
Because of the previous note, the output ROI cannot be the same as the receiver ROI (i.e. cannot merge into itself).
Parameters: - pTimeStep1 (int) – source time step (a uint32_t)
- pTimeStep2 (int) – time step to merge with (a uint32_t)
- anOutputROI (ORSModel.ors.ROI) – the output ROI (an ROI), see note below
Returns: output (ORSModel.ors.ROI) – the merged ROI
-
getAsROIMovedInChannel(self, pInputData: ORSModel.ors.Channel, xOffset: int, yOffset: int, zOffset: int, pTargetROI: ORSModel.ors.ROI) → ROI¶ Moves theROI by a given offset in a channel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pInputData (ORSModel.ors.Channel) – the source channel (an Channel)
- xOffset (int) – an X voxel offset (a uint32_t)
- yOffset (int) – a Y voxel offset (a uint32_t)
- zOffset (int) – a Z voxel offset (a uint32_t)
- pTargetROI (ORSModel.ors.ROI) – an optional output ROI (an ROI)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIOpenWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int) → ROI¶ Opens theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIOpenWithKernelOnSpecificSlices(self, pKernel: ORSModel.ors.ConvolutionKernel, pInRoi: ORSModel.ors.ROI, pTimeStep: int, axis: int, indices: ORSModel.ors.SequenceableCollection, progress: ORSModel.ors.Progress) → ROI¶ Opens theROI according to a supplied 3D kernel.
Note
The 3D kernel needs not be symmetric, but each dimension must be odd, for the center always represents the current voxel.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (an ConvolutionKernel)
- pInRoi (ORSModel.ors.ROI) – an optional output ROI (an ROI)
- pTimeStep (int) – the time step (a uint32_t)
- axis (int) – the axis of the specified slices (x=0,y=1,z=2) (a uint8_t)
- indices (ORSModel.ors.SequenceableCollection) – the slices to work on (an SequenceableCollection)
- progress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getAsROIThinned(self, aROI: ORSModel.ors.ROI) → ROI¶ Parameters: aROI (ORSModel.ors.ROI) – Returns: output (ORSModel.ors.ROI) –
-
getBoxGrownToContainVoxels(self, aBox: ORSModel.ors.Box, timeStep: int) → Box¶ Grow the given box so that it include all the voxels of the specified time step.
Parameters: - aBox (ORSModel.ors.Box) – the box to grow
- timeStep (int) –
Returns: output (ORSModel.ors.Box) – the resulting Box (a Box)
-
getCenterOfMass(self, pTimeStep: int) → Vector3¶ Computes theROI’s center of mass.
Parameters: pTimeStep (int) – Returns: output (ORSModel.ors.Vector3) – the center of mass (an XYZ vector) (an Vector3)
-
getCircumferenceAreaAndMinMaxDiameter(self, pBoundedPlane: ORSModel.ors.Rectangle, pointInside: ORSModel.ors.Vector3, nTimeStep: int, area: float, circumference: float, meanDiameter: float, maxDiameterPoint0: ORSModel.ors.Vector3, maxDiameterPoint1: ORSModel.ors.Vector3, minDiameter0: ORSModel.ors.Vector3, minDiameter1: ORSModel.ors.Vector3) → None¶ Parameters: - pBoundedPlane (ORSModel.ors.Rectangle) –
- pointInside (ORSModel.ors.Vector3) –
- nTimeStep (int) –
- area (float) –
- circumference (float) –
- meanDiameter (float) –
- maxDiameterPoint0 (ORSModel.ors.Vector3) –
- maxDiameterPoint1 (ORSModel.ors.Vector3) –
- minDiameter0 (ORSModel.ors.Vector3) –
- minDiameter1 (ORSModel.ors.Vector3) –
-
getClassNameStatic() → str¶ getClassNameStatic
Returns: output (str) –
-
getClipBox(timestep=0, display=None)¶ Gets the clip box of the ROI or of the MultiROI
Parameters: - timestep (int) – the time index
- display (ORSModel.ors.View) – a view
Returns: aClipBox (ORSModel.ors.Box) – the clip box
-
getClipping(timestep=0, display=None)¶ Gets the origin and the opposite summit of the clip box of the ROI or MultiROI
Parameters: - timestep (int) – the time index
- display (ORSModel.ors.View) – a view
Returns: - clipOriginSummit (ORSModel.ors.Vector3) – the origin summit of the clip box
- clipOppositeSummit (ORSModel.ors.Vector3) – the origin opposite summit of the clip box
-
getConnectedComponent(self, iTIndex: int, considerDiagonal: bool, IProgress: ORSModel.ors.Progress, pInData: ORSModel.ors.MultiROI) → MultiROI¶ Connected connectivity analysis of theROI.
Note
This method labels areas of the ROI by finding adjacent voxels and labelling them with sequential numbering.
Note
If a multi ROI object is supplied as the last argument, the results are written to it, otherwise a new one is created.
Parameters: - iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to consider diagonals, false otherwise
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress), or NULL for no progress
- pInData (ORSModel.ors.MultiROI) – an optional output object (an MultiROI)
Returns: output (ORSModel.ors.MultiROI) – the resulting object (an MultiROI)
-
getContour(self, pPlane: ORSModel.ors.Plane, nTimeStep: int, pfPoints: ORSModel.ors.Array) → None¶ Parameters: - pPlane (ORSModel.ors.Plane) –
- nTimeStep (int) –
- pfPoints (ORSModel.ors.Array) –
-
getContour2(self, pBoudedPlane: ORSModel.ors.Rectangle, nTimeStep: int, pfPoints: ORSModel.ors.Array) → None¶ Parameters: - pBoudedPlane (ORSModel.ors.Rectangle) –
- nTimeStep (int) –
- pfPoints (ORSModel.ors.Array) –
-
getContourOrdered(self, pPlane: ORSModel.ors.Plane, nTimeStep: int, pfPoints: ORSModel.ors.Array, pnIndexes: ORSModel.ors.ArrayLong) → None¶ GetROI contours Sorts the labels on their sizes, in descending order.
Note
Many contours may be found. The indexes array contains the start index (in the point array) of the nth contour and the number of points it contains at the location 2*n and 2*n+1 respectively.
Parameters: - pPlane (ORSModel.ors.Plane) – The cut plane (a Plane)
- nTimeStep (int) – The time step (a uint32_t)
- pfPoints (ORSModel.ors.Array) – The point array to fill (an ArrayFloat)
- pnIndexes (ORSModel.ors.ArrayLong) – The indexes array to fill (an ArrayLong)
-
getContourOrdered2(self, pBoudedPlane: ORSModel.ors.Rectangle, nTimeStep: int, pfPoints: ORSModel.ors.Array, pnIndexes: ORSModel.ors.ArrayLong) → None¶ GetROI contours Sorts the labels on their sizes, in descending order.
Note
Many contours may be found. The indexes array contains the start index (in the point array) of the nth contour and the number of points it contains at the location 2*n and 2*n+1 respectively.
Parameters: - pBoudedPlane (ORSModel.ors.Rectangle) – The cut plane (a Plane)
- nTimeStep (int) – The time step (a uint32_t)
- pfPoints (ORSModel.ors.Array) – The point array to fill (an ArrayFloat)
- pnIndexes (ORSModel.ors.ArrayLong) – The indexes array to fill (an ArrayLong)
-
getEndPoints(self, aROI: ORSModel.ors.ROI) → ROI¶ Parameters: aROI (ORSModel.ors.ROI) – Returns: output (ORSModel.ors.ROI) –
-
getFeretBox(self, iTIndex: int, iAngleSampling: int) → Box¶ Get Feret box ofROI.
Note
Default value for angle sampling is 5
Parameters: - iTIndex (int) – the T index (a uint32_t)
- iAngleSampling (int) – the angle sampling, steps between each angle iteration (a uint16_t)
Returns: output (ORSModel.ors.Box) –
-
getFromTimeStepRange(self, pTimeStepStart: int, pTimeStepEnd: int, anOutputROI: ORSModel.ors.ROI) → ROI¶ Extracts a T range from the region of interest, as a new region of interest.
Parameters: - pTimeStepStart (int) – the time step start (a uint32_t)
- pTimeStepEnd (int) – the time step end (a uint32_t)
- anOutputROI (ORSModel.ors.ROI) –
Returns: output (ORSModel.ors.ROI) –
-
getHasDataWithinArea(self, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int) → bool¶ Queries theROI to know if it has data within a specific range of indicies.
Parameters: - xmin (int) – the minimal x coordinate (a uint32_t)
- ymin (int) – the minimal y coordinate (a uint32_t)
- zmin (int) – the minimal z coordinate (a uint32_t)
- tmin (int) – the minimal t coordinate (a uint32_t)
- xmax (int) – the maximal x coordinate (a uint32_t)
- ymax (int) – the maximal y coordinate (a uint32_t)
- zmax (int) – the maximal z coordinate (a uint32_t)
- tmax (int) – the maximal t coordinate (a uint32_t)
Returns: output (bool) – true if receiver has data within the range (inclusive), false otherwise
-
getHasDataWithinRange(self, startIndex: int, endIndex: int) → bool¶ Queries theROI to know if it has data within a specific range of indicies.
Parameters: - startIndex (int) – the starting index (a int64_t)
- endIndex (int) – the ending index (a int64_t)
Returns: output (bool) – true if receiver has data within the range (inclusive), false otherwise
-
getHasVoxelIndex(self, index: int) → bool¶ Verifies if the receiverROI contains a specified voxel index.
Parameters: index (int) – a voxel index (a int64_t) Returns: output (bool) – true if the ROI contains the index, false otherwise
-
getHistogramData(self, pNumberOfBins: int, pTimeStep: int, IChannel: ORSModel.ors.Channel) → HistogramData¶ Gets a histogram of theROI’s underlying data (from its channel).
Parameters: - pNumberOfBins (int) – the number of desired bins (a uint32_t)
- pTimeStep (int) – the T index (a uint32_t)
- IChannel (ORSModel.ors.Channel) – the data channel (a Channel)
Returns: output (ORSModel.ors.HistogramData) – a histogram (an HistogramData)
-
getInertiaAxis(self, first: ORSModel.ors.Vector3, second: ORSModel.ors.Vector3, third: ORSModel.ors.Vector3, pTimeStep: int) → None¶ Computes theROI’s inertia tensor eigen vector.
Note
The eigen vector are sorted by eigen value, first is the int32_t*ues .. The norm of the vectors are the eigen value
Parameters: - first (ORSModel.ors.Vector3) –
- second (ORSModel.ors.Vector3) –
- third (ORSModel.ors.Vector3) –
- pTimeStep (int) –
-
getInitialColor(self) → Color¶ Gets the initialROI color.
Note
The color is expressed in RGB fashion.
Returns: output (ORSModel.ors.Color) – a color (an Color)
-
getInterfacialSurface(self, pOtherROI: ORSModel.ors.ROI, timeStep: int, progressBar: ORSModel.ors.Progress) → float¶ Gets theROI’s surface interfacial area estimation of digital (weighted voxel estimation).
Note
The algorithm checks 8 vertices neighbors for each voxel to determine surfaces. If a neighbor is empty, it means that the voxel’s side is a surface. Then, a weight is given for each border voxel type. (Lindblad, J. (2005). Surface area estimation of digitized 3D objects using weighted local configurations. Image and Vision Computing, 23(2), 111-122.)
Parameters: - pOtherROI (ORSModel.ors.ROI) – the other ROI (a ROI)
- timeStep (int) – time step for which we want the surface
- progressBar (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (float) – the total surface area (a double)
-
getInterfacialSurfaceAsCubicMesh(self, pOtherROI: ORSModel.ors.ROI, iTIndex: int, bWorld: bool, pProgress: ORSModel.ors.Progress) → Mesh¶ Generates the interface surface between 2 ROIs as a cubic mesh.
Note
This algorithm assume that ROIs do not contain intersecting voxel.
Parameters: - pOtherROI (ORSModel.ors.ROI) – other ROI that share an interface with the current one (a ROI)
- iTIndex (int) – the T index (a uint32_t)
- bWorld (bool) – true to have the resulting mesh model in world coordinates, false in local (a bool)
- pProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.Mesh) –
-
getInterfacialSurfaceAsMarchingCubesMesh(self, pOtherROI: ORSModel.ors.ROI, iTIndex: int, xSample: int, ySample: int, zSample: int, bWorld: bool, pProgress: ORSModel.ors.Progress) → Mesh¶ Generates the interface surface between 2 ROIs as a marching cubes mesh.
Note
This algorithm assume that ROIs do not contain intersecting voxel.
Parameters: - pOtherROI (ORSModel.ors.ROI) – other ROI that share an interface with the current one (a ROI)
- iTIndex (int) – the T index (a uint32_t)
- xSample (int) – the X sampling (a uint16_t, 1 means no sampling)
- ySample (int) – the Y sampling (a uint16_t, 1 means no sampling)
- zSample (int) – the Z sampling (a uint16_t, 1 means no sampling)
- bWorld (bool) – true to have the resulting mesh model in world coordinates, false in local (a bool)
- pProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.Mesh) –
-
getIntersectionCountWithROI(self, aROI: ORSModel.ors.ROI) → int¶ Intersects theROI with another ROI and return the count.
Note
if the ROI provided does not have the same shape as the receiver, the count is zero.
Parameters: aROI (ORSModel.ors.ROI) – the ROI to intersect with (an ROI) Returns: output (int) – number of common voxels
-
getIntersectionWithROI(self, aROI: ORSModel.ors.ROI, anOutputROI: ORSModel.ors.ROI) → ROI¶ Intersects theROI with another ROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Note
The output ROI can be the same as the receiver ROI (i.e. can intersect with another ROI into itself).
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to intersect with (an ROI)
- anOutputROI (ORSModel.ors.ROI) – the output ROI (an ROI), see note below
Returns: output (ORSModel.ors.ROI) – the intersected ROI
-
getIsAreaFull(self, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int) → bool¶ Queries theROI to know if the specific range of indicies is full.
Parameters: - xmin (int) – the minimal x coordinate (a uint32_t)
- ymin (int) – the minimal y coordinate (a uint32_t)
- zmin (int) – the minimal z coordinate (a uint32_t)
- tmin (int) – the minimal t coordinate (a uint32_t)
- xmax (int) – the maximal x coordinate (a uint32_t)
- ymax (int) – the maximal y coordinate (a uint32_t)
- zmax (int) – the maximal z coordinate (a uint32_t)
- tmax (int) – the maximal t coordinate (a uint32_t)
Returns: output (bool) – true if receiver has all data within the range (inclusive), false otherwise
-
getIsClipped(timestep=0, display=None)¶ Gets to know if there is a clip box attached to the ROI or MultiROI
Parameters: - timestep (int) – the time index
- display (ORSModel.ors.View) – a view
Returns: isClipped (bool) – if True, the clip box of the ROI or MultiROI is visible; False otherwise.
-
getIsEmpty(self) → bool¶ Sees if theROI contains data.
Returns: output (bool) – true if ROI contains no data, false otherwise
-
getLabel(self) → int¶ Gets theROI label.
Note
A ROI label is a unsigned short value that can be associated to the ROI. Each ROI has one label.
Returns: output (int) – a label (a uint16_t)
-
getLabelization(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, iTIndex: int, considerDiagonal: bool, IProgress: ORSModel.ors.Progress, pInData: ORSModel.ors.MultiROI) → MultiROI¶ Connected connectivity analysis of theROI.
Note
This method labels areas of the ROI by finding adjacent voxels and labelling them with sequential numbering.
Note
If a multi ROI object is supplied as the last argument, the results are written to it, otherwise a new one is created.
Parameters: - minX (int) – the minimum X range (a uint32_t)
- minY (int) – the minimum Y range (a uint32_t)
- minZ (int) – the minimum Z range (a uint32_t)
- maxX (int) – the maximum X range (a uint32_t)
- maxY (int) – the maximum Y range (a uint32_t)
- maxZ (int) – the maximum Z range (a uint32_t)
- iTIndex (int) – the T index (a uint32_t)
- considerDiagonal (bool) – true to consider diagonals, false otherwise
- IProgress (ORSModel.ors.Progress) – a progress object (an Progress), or NULL for no progress
- pInData (ORSModel.ors.MultiROI) – an optional output object (an MultiROI)
Returns: output (ORSModel.ors.MultiROI) – the resulting object (an MultiROI)
-
getLocalBoundingBoxMax(self, timeStep: int) → Vector3¶ Gets the upper-right corner of the visual’s bounding box.
Parameters: timeStep (int) – timeStep (a uint32_t) Returns: output (ORSModel.ors.Vector3) – a point (an Vector3)
-
getLocalBoundingBoxMin(self, timeStep: int) → Vector3¶ Gets the lower-left corner of the visual’s bounding box.
Parameters: timeStep (int) – timeStep (uint32_t) Returns: output (ORSModel.ors.Vector3) – a point (an Vector3)
-
getMaxIndex(self) → int¶ Gets the largest index of theROI.
Returns: output (int) – a channel voxel index (a int64_t)
-
getMaxSourceDataValue(self, pTimeStep: int, pInputData: ORSModel.ors.Channel) → float¶ Gets the maximum source voxel value of theROI for a given channel.
Note
The value returned is in the same type as the source channel, but converted to a double.
Parameters: - pTimeStep (int) – the T index (a uint32_t)
- pInputData (ORSModel.ors.Channel) – the source channel (an Channel)
Returns: output (float) – a voxel value (a double)
-
getMeanSourceDataValue(self, pTimeStep: int, pInputData: ORSModel.ors.Channel) → float¶ Gets the mean source voxel value of theROI for a given channel.
Note
The value returned is in the same type as the source channel, but converted to a double.
Parameters: - pTimeStep (int) – the T index (a uint32_t)
- pInputData (ORSModel.ors.Channel) – the source channel (an Channel)
Returns: output (float) – a voxel value (a double)
-
getMedialAxis(IProgress=None)¶
-
getMinIndex(self) → int¶ Gets the smallest index of theROI.
Returns: output (int) – a channel voxel index (a int64_t)
-
getMinSourceDataValue(self, pTimeStep: int, pInputData: ORSModel.ors.Channel) → float¶ Gets the minimum source voxel value of theROI for a given channel.
Note
The value returned is in the same type as the source channel, but converted to a double.
Parameters: - pTimeStep (int) – the T index (a uint32_t)
- pInputData (ORSModel.ors.Channel) – the source channel (an Channel)
Returns: output (float) – a voxel value (a double)
-
getMinimalBox(self, iTIndex: int) → Box¶ Get mininal box ofROI (also know as Oriented Bounding Box in literature)
Parameters: iTIndex (int) – the T index (a uint32_t) Returns: output (Box) –
-
getNDArray(timestep=0)¶ Get a numpy nd array representation
Parameters: timestep (int) – timestep to analyse Deprecated since version 2021.1: use getAsNDArray instead
-
getProjectionIn(self, pChannel: ORSModel.ors.Channel, sourceTimeOffset: int, pProgress: ORSModel.ors.Progress) → ROI¶ Projects theROI in a channel’s spatial box.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: - pChannel (ORSModel.ors.Channel) – the target channel (an Channel)
- sourceTimeOffset (int) – a progress object (an Progress) or NULL for no progress
- pProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getReversed(self, pTargetROI: ORSModel.ors.ROI) → ROI¶ Reverses theROI.
Note
A reversed ROI contains exactly the data not present in the receiver ROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Parameters: pTargetROI (ORSModel.ors.ROI) – an optional output ROI (an ROI) Returns: output (ORSModel.ors.ROI) – the resulting ROI (an ROI)
-
getSimplePoints(self, aROI: ORSModel.ors.ROI) → ROI¶ Parameters: aROI (ORSModel.ors.ROI) – Returns: output (ORSModel.ors.ROI) –
-
getSimplifiedGraphMesh(self, aROI: ORSModel.ors.ROI, aResultMesh: ORSModel.ors.Mesh, aSurfaceMesh: ORSModel.ors.Mesh) → ROI¶ Parameters: - aROI (ORSModel.ors.ROI) –
- aResultMesh (ORSModel.ors.Mesh) –
- aSurfaceMesh (ORSModel.ors.Mesh) –
Returns: output (ORSModel.ors.ROI) –
-
getSkeletonized(IProgress=None)¶
-
getStandardDeviationSourceDataValue(self, pTimeStep: int, pInputData: ORSModel.ors.Channel) → float¶ Gets the standard deviation of the source voxels of theROI for a given channel.
Note
The value returned is in the same type as the source channel, but converted to a double.
Parameters: - pTimeStep (int) – the T index (a uint32_t)
- pInputData (ORSModel.ors.Channel) – the source channel (an Channel)
Returns: output (float) – a voxel value (a double)
-
getSubtractionFromROI(self, aROI: ORSModel.ors.ROI, pOutputROI: ORSModel.ors.ROI) → ROI¶ Subtracts anotherROI from the receiver ROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Note
The output ROI can be the same as the receiver ROI (i.e. can subtract another ROI into itself), but the output ROI cannot be the subtraction ROI.
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to subtract (an ROI)
- pOutputROI (ORSModel.ors.ROI) – the output ROI (an ROI), see note below
Returns: output (ORSModel.ors.ROI) – the subtracted ROI
-
getSurface(self, timeStep: int) → float¶ Gets theROI’s surface area.
Note
The algorithm checks 6 neighbors for each voxel to determine surfaces. If a neighbor is empty, it means that the voxel’s side is a surface.
Parameters: timeStep (int) – step for which we want the surface Returns: output (float) – the total surface area (a double)
-
getSurfaceFromWeightedVoxelEstimation(self, timeStep: int, progressBar: ORSModel.ors.Progress) → float¶ Gets theROI’s surface area estimation of digital (weighted voxel estimation).
Note
The algorithm checks 8 vertices neighbors for each voxel to determine surfaces. If a neighbor is empty, it means that the voxel’s side is a surface. Then, a weight is given for each border voxel type. (Lindblad, J. (2005). Surface area estimation of digitized 3D objects using weighted local configurations. Image and Vision Computing, 23(2), 111-122.)
Parameters: - timeStep (int) – time step for which we want the surface
- progressBar (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (float) – the total surface area (a double)
-
getTotalPerimeterOnPlane(self, cuttingPlane: ORSModel.ors.Plane, timeStep: int) → float¶ Gets theROI’s perimeter on a plane.
Parameters: - cuttingPlane (ORSModel.ors.Plane) – a cutting plane (an ORS plane)
- timeStep (int) – time step (int)
Returns: output (float) – the total ROI’s perimeter for the current plane (a double)
-
getTotalVoxelCount(self) → int¶ Gets the total number of voxels within theROI.
Returns: output (int) – the number of voxels in the ROI (a uint64_t)
-
getUndoROI()¶
-
getUnionWithROI(self, aROI: ORSModel.ors.ROI, iTOffset: int, anOutputROI: ORSModel.ors.ROI) → ROI¶ Merges theROI with another ROI.
Note
If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Note
The output ROI can be the same as the receiver ROI (i.e. can merge with another ROI into itself).
Note
It is assumed that both ROIs share the same characteristics (i.e. size, orientation, etc).
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to merge with (an ROI)
- iTOffset (int) – the output ROI (an ROI), see note below
- anOutputROI (ORSModel.ors.ROI) –
Returns: output (ORSModel.ors.ROI) – the merged ROI
-
getVolume(self, timeStep: int) → float¶ Returns thecomputed volume of the region of interest.
Note
The volume is in cubic units of the dimension unit of the underlying channel.
Parameters: timeStep (int) – the time step (a uint32_t) Returns: output (float) – a double.
-
getVoxelCount(self, iTIndex: int) → int¶ Gets the number of voxels within theROI for a given T value.
Note
This method computes the number of indicies, so if you need the value several times try to cache its return value.
Parameters: iTIndex (int) – Returns: output (int) – the number of voxels in the ROI (a uint64_t)
-
getVoxelsNeighborCountGreaterThanOrEqualTo(self, neighborCount: int, pProgress: ORSModel.ors.Progress) → ROI¶ Gets aROI containing the voxels having a neighbor count greater than or equal to n.
Parameters: - neighborCount (int) – the minimal neighbor count
- pProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) –
-
getWillBeDisplayed(self) → bool¶ Gets whether or not theROI is destined to be displayed.
Note
Regions of interest are to be displayed by default.
Note
Regions of interest that will not be displayed use less memory and have less overhead.
Returns: output (bool) – true if the ROI will be displayed, false otherwise
-
classmethod
imread(files)¶ Loads a ROI from files
Parameters: files (file) [count=[0, None]] – fully qualified file name list Returns: outROI (ORSModel.ors.ROI) – the resulting ROI
-
classmethod
imreadDICOM(files)¶ Loads a ROI from files or folder contaning DICOM
Parameters: files (file) [count=[0, None]] – fully qualified file name list Returns: outROI (ORSModel.ors.ROI) – the resulting ROI
-
classmethod
imreadDICOMFolder(folder)¶ Loads a ROI from folder of DICOM files
Parameters: folder (folder) – fully qualified folder Returns: outROI (ORSModel.ors.ROI) – the resulting ROI
-
classmethod
imreadFolder(folder)¶ Loads a ROI from folder
Parameters: folder (folder) – fully qualified folder Returns: outROI (ORSModel.ors.ROI) – the resulting ROI
-
imsave(fileName, extension='tif', value=255)¶ Save a ROI to file in the type specified by the extension
Parameters: - fileName (file saving) – fully qualified file name
- extension (str) – image file format extension
- value (int) – value to put in the image at the ROI painted locations (should be between 0 and 255)
-
imwrite(fileName, extension='tif', value=255)¶ Save a ROI to file in the type specified by the extension
Parameters: - fileName (file saving) – fully qualified file name
- extension (str) – image file format extension
- value (int) – value to put in the image at the ROI painted locations (should be between 0 and 255)
-
iterateIntervals(self, callbackFunction: int, userdata: int, bForceSingleThread: bool, bAlignMultiThreadingToZ: bool, createMultiThreadDataFunction: int) → None¶ Iterates through theROI indicies, calling a callback function with index intervals.
Note
The last two arguments are ignored if second argument is true.
Note
The callback function (argument 1) is called with an interval of indicies beginning and end, with the range being inclusive. A third argument supplied is the result of calling callback function in argument 2. In the case of single-threaded execution, that argument is NULL. The callback function should return true to continue iterating, but can return false to interrupt the iterating.
Note
The second callback function (argument 4) is called at the start of each thread. It is intended for the caller to create user data that is in turn supplied to the callback function at each invocation. The arguments it receives is (number of threads being started, threadNumber), with threadNumber being zero based.
Parameters: - callbackFunction (int) – a callback function (the address of a ORSVOLUMEROIITERATORLINEAR function)
- userdata (bytes) – any user data to be supplied to the callback function
- bForceSingleThread (bool) – true to force single threaded execution, false to have it multi-threaded
- bAlignMultiThreadingToZ (bool) – true to align multi-thread execution to Z slices, false to align to nothing
- createMultiThreadDataFunction (int) – a callback function to create multithread data (the address of a ORSVOLUMEROIITERATORCREATETHREADDATA function)
-
iterateXYZTIntervals(self, callbackFunction: int, userdata: int, bForceSingleThread: bool, bAlignMultiThreadingToZ: bool, createMultiThreadDataFunction: int) → None¶ Iterates through theROI indicies, calling a callback function with X/Y/Z/T intervals.
Note
The last two arguments are ignored if second argument is true.
Note
The callback function (argument 1) is called with an interval of indicies beginning and end, with the range being inclusive. A third argument supplied is the result of calling callback function in argument 2. In the case of single-threaded execution, that argument is NULL. The callback function should return true to continue iterating, but can return false to interrupt the iterating.
Note
The second callback function (argument 4) is called at the start of each thread. It is intended for the caller to create user data that is in turn supplied to the callback function at each invocation. The arguments it receives is (number of threads being started, threadNumber), with threadNumber being zero based.
Parameters: - callbackFunction (int) – a callback function (the address of a ORSVOLUMEROIITERATORXYZT function)
- userdata (bytes) – any user data to be supplied to the callback function
- bForceSingleThread (bool) – true to force single threaded execution, false to have it multi-threaded
- bAlignMultiThreadingToZ (bool) – true to align multi-thread execution to Z slices, false to align to nothing
- createMultiThreadDataFunction (int) – a callback function to create multithread data (the address of a ORSVOLUMEROIITERATORCREATETHREADDATA function)
-
makeROIForChannel(self, pChannel: ORSModel.ors.Channel, x: int, y: int, z: int) → ROI¶ Makes a newROI from the receiver, according to a given channel’s coordinates.
Note
The supplied offset is the offset of the given channel relatively to the originating channel (the one the ROI is based upon), in voxels.
Parameters: - pChannel (ORSModel.ors.Channel) – a reference channel (an Channel)
- x (int) – an X offset (an uint32_t)
- y (int) – an Y offset (an uint32_t)
- z (int) – a Z offset (an uint32_t)
Returns: output (ORSModel.ors.ROI) – a new ROI (an ROI)
-
none() → ROI¶ Returns a none object, equivalent to a non-existent object (or null).
Returns: output (ROI) –
-
projectInShape(self, aShape: ORSModel.ors.Shape3D, sourceTime: int, outputROI: ORSModel.ors.ROI, destinationTime: int) → ROI¶ Parameters: - aShape (ORSModel.ors.Shape3D) –
- sourceTime (int) –
- outputROI (ORSModel.ors.ROI) –
- destinationTime (int) –
Returns: output (ORSModel.ors.ROI) –
-
removeAllVoxelsIfInRange(self, timeStep: int, minValue: float, maxValue: float, pChannel: ORSModel.ors.Channel) → None¶ Parameters: - timeStep (int) –
- minValue (float) –
- maxValue (float) –
- pChannel (ORSModel.ors.Channel) –
-
removeAllVoxelsIfNotInRange(self, timeStep: int, minValue: float, maxValue: float, pChannel: ORSModel.ors.Channel) → None¶ Parameters: - timeStep (int) –
- minValue (float) –
- maxValue (float) –
- pChannel (ORSModel.ors.Channel) –
-
removeCircleArea(self, posX: float, posY: float, posZ: float, normalX: float, normalY: float, normalZ: float, radius: float, tStep: int) → None¶ Remove circle area fromROI.
Parameters: - posX (float) –
- posY (float) –
- posZ (float) –
- normalX (float) –
- normalY (float) –
- normalZ (float) –
- radius (float) –
- tStep (int) –
-
removeLine(self, pLine: ORSModel.ors.Line, tStep: int) → None¶ Removes a line from theROI.
Parameters: - pLine (ORSModel.ors.Line) – the line to remove (an Line)
- tStep (int) – the time step (a uint32_t)
-
removeLineIfInRange(self, pLine: ORSModel.ors.Line, tStep: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Removes a line from theROI if the corresponding voxels in the channel are within the specified range.
Note
Note that the range values are inclusive.
Parameters: - pLine (ORSModel.ors.Line) – the line to remove (an Line)
- tStep (int) – the time step (a uint32_t)
- lowerThreshold (float) – the lower range value (a double)
- upperThreshold (float) – the upper range value (a double)
- pChannel (ORSModel.ors.Channel) – a channel of the same shape as the receiver (an Channel)
-
removeLineSegment(self, lineSegment: ORSModel.ors.LineSegment, tStep: int) → None¶ Removes a line segment from theROI.
Parameters: - lineSegment (ORSModel.ors.LineSegment) – the line segment to remove (an Line)
- tStep (int) – the time step (a uint32_t)
-
removeLineSegmentIfInRange(self, lineSegment: ORSModel.ors.LineSegment, tStep: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Removes a line segment from theROI if the corresponding voxels in the channel are within the specified range.
Note
Note that the range values are inclusive.
Parameters: - lineSegment (ORSModel.ors.LineSegment) – the line segment to remove (an LineSegment)
- tStep (int) – the time step (a uint32_t)
- lowerThreshold (float) – the lower range value (a double)
- upperThreshold (float) – the upper range value (a double)
- pChannel (ORSModel.ors.Channel) – a channel of the same shape as the receiver (an Channel)
-
removeROI(self, aROI: ORSModel.ors.ROI) → None¶ Parameters: aROI (ORSModel.ors.ROI) –
-
removeSimplePointsWithDistanceMap(self, seedPointROI: ORSModel.ors.ROI, spaceChannel: ORSModel.ors.Channel, outputROI: ORSModel.ors.ROI) → ROI¶ Parameters: - seedPointROI (ORSModel.ors.ROI) –
- spaceChannel (ORSModel.ors.Channel) –
- outputROI (ORSModel.ors.ROI) –
Returns: output (ORSModel.ors.ROI) –
-
removeVoxel(self, index: int) → None¶ Removes a voxel.
Note
The index is linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: index (int) – the index of the voxel (a int64_t)
-
removeVoxelIndicesFromROIIfInRange(self, indices: int, indicesSize: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Removes indices from theROI, checking against a range.
Note
Only those indicies having values within the supplied range are removed from the ROI.
Parameters: - indices (int) – an array of indices (a int64_t*)
- indicesSize (int) – the number of indices in the array (a int64_t)
- lowerThreshold (float) – the lower range (a double)
- upperThreshold (float) – the upper range (a double)
- pChannel (ORSModel.ors.Channel) – the channel to check against (an Channel)
-
removeVoxelInterval(self, iStart: int, iEnd: int) → None¶ Removes a voxel interval of indicies.
Note
Every voxel within the interval will be removed from the Region of Interest.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: - iStart (int) – the start value (inclusive) of the interval (a int64_t)
- iEnd (int) – the end value (inclusive) of the interval (a int64_t)
-
removeVoxelIntervals(self, pIntervalArray: int, pNumberOfIntervals: int) → None¶ Removes a list of voxel indicies intervals.
Note
Every voxel within the interval will be removed from the Region of Interest.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: - pIntervalArray (int) – an array of interval begin and end (inclusive) values (a int64_t*)
- pNumberOfIntervals (int) – the number of interval pairs in the array (a int32_t*)
-
removeVoxels(self, indices: int, indicesSize: int) → None¶ Removes a list of voxels.
Note
The indicies are linear within the channel data.
Note
Any changes to a Region of Interest need to be followed by a show() to refresh the screen.
Parameters: - indices (int) – an array of indicies (a int64_t*)
- indicesSize (int) – the number of indicies in the array (a int64_t)
-
removeVoxelsFromWorldCoordinates(self, worldPositionArray: ORSModel.ors.ArrayDouble, timeIndex: int) → None¶ Removes indices (supplied in the form of world coordinates) from theROI.
Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) – an array of world position triplets (an ArrayDouble)
- timeIndex (int) – the T index (a uint32_t)
-
removeVoxelsFromWorldCoordinatesIfInRange(self, worldPositionArray: ORSModel.ors.ArrayDouble, timeIndex: int, lowerThreshold: float, upperThreshold: float, pChannel: ORSModel.ors.Channel) → None¶ Removes indices (supplied in the form of world coordinates) from theROI, checking against a range.
Note
Very similar to removeVoxelsFromWorldCoordinates(), but only those indicies having values within the supplied range are removed from the ROI.
Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) – an array of world position triplets (an ArrayDouble)
- timeIndex (int) – the T index (a uint32_t)
- lowerThreshold (float) – the lower range (a double)
- upperThreshold (float) – the upper range (a double)
- pChannel (ORSModel.ors.Channel) – the channel to check against (an Channel)
-
reverseTimeStepRange(self, pTimeStepStart: int, pTimeStepEnd: int) → None¶ Reverses a time step range of theROI.
Parameters: - pTimeStepStart (int) – the time step start (a uint32_t)
- pTimeStepEnd (int) – the time step end (a uint32_t)
-
setAsTemporaryObject(isTemporaryObject=True)¶ Helper for setting useful properties when marking an object as a (non-)temporary object.
Parameters: isTemporaryObject (bool) – if True, the object will be set as temporary (not representable, not to be saved, callbacks disabled). Otherwise, these properties are set as the opposite.
-
setInitialColor(self, IColor: ORSModel.ors.Color) → None¶ Sets the initialROI color.
Note
The color is expressed in RGB fashion.
Parameters: IColor (ORSModel.ors.Color) – a color (an Color)
-
setLabel(self, aLabel: int) → None¶ Sets theROI label.
Note
A ROI label is an unsigned short value that can be associated to the ROI. Each ROI has one label.
Parameters: aLabel (int) – a label (a uint16_t)
-
setWillBeDisplayed(self, value: bool) → None¶ Indicates whether or not theROI is destined to be displayed.
Note
Regions of interest are to be displayed by default.
Note
Regions of interest that will not be displayed use less memory and have less overhead.
Parameters: value (bool) – true if the ROI will be displayed, false otherwise
-
updateUndo()¶
-
StructuredGrid¶
-
class
ORSModel.ors.StructuredGrid Bases:
ORSModel.ors.Node-
addROIAtTOffset(self, aROI: ORSModel.ors.ROI, label: int, pTOffset: int) → None Adds aROI to the receiver, but at a specific T offset.
Note
The ROI to add will be projected correctly if it doesn’t share the same characteristics.
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to add (an ROI)
- label (int) – a label (a uint32_t)
- pTOffset (int) – the T offset (a uint32_t)
-
copyShapeFromBox(self, pBox: ORSModel.ors.Box, tSize: int) → None Initializes the structured grid’s shape based on a box.
Parameters: - pBox (ORSModel.ors.Box) – a box (a Box)
- tSize (int) – a T size (an uint32_t)
-
copyShapeFromRectangle(self, aRectangle: ORSModel.ors.Rectangle, zSpacing: float, tSize: int) → None Initializes the structured grid’s shape based on a rectangle.
Parameters: - aRectangle (ORSModel.ors.Rectangle) – a rectangle (a Rectangle)
- zSpacing (float) – the thickness of the output structured grid (a double)
- tSize (int) – a T size (an uint32_t)
-
copyShapeFromStructuredGrid(self, pStructuredGrid: ORSModel.ors.StructuredGrid) → None Initializes the structured grid’s shape based on another structured grid.
Note
Shape includes size, spacing, type, description, position and location.
Note
This method does not handle the structured grid’s data.
Parameters: pStructuredGrid (ORSModel.ors.StructuredGrid) – a source structured grid
-
getAsChannel(self, inOutStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → Channel Convert a structured grid to a channel.
Note
If an output channel is supplied, data is written to it and returned, otherwise a new channel is created.
Note
If the source structured grid is a channel it returns a copy.
Note
If the source structured grid is a Volume ROI the channel output data type is UNSIGNED CHAR. A value of 1 is written where a label exist in the input Volume ROI, 0 otherwise.
Note
If the source structured grid is a MultiROI the output data type is determined by the total number of labels within:
Parameters: - inOutStructuredGrid (ORSModel.ors.StructuredGrid) – an optional output channel (an StructuredGrid)
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.Channel) – the resulting channel (an StructuredGrid)
-
getAsMultiROI(self, inOutStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → MultiROI Convert a structured grid to aMultiROI.
Note
If an output MultiROI is supplied, data is written to it and returned, otherwise a new MultiROI is created.
Note
The MultiROI is cleared prior to adding.
Note
If the source structured grid is a channel the output MultiROI will contain a label for every non zero channel values.
Note
If the source structured grid is a Volume ROI it returns a MultiROI of 1 label.
Note
If the source structured grid is a MultiROI it returns a copy.
Parameters: - inOutStructuredGrid (ORSModel.ors.StructuredGrid) – an optional output MultiROI (an StructuredGrid)
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.MultiROI) – the resulting MultiROI (an StructuredGrid)
-
getAsROI(self, inOutStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → ROI Convert a structured grid to a VolumeROI.
Note
If an output ROI is supplied, data is written to it and returned, otherwise a new ROI is created.
Note
The ROI is cleared prior to adding.
Note
If the source structured grid is a channel the output Volume ROI will contain voxel for every non zero channel values.
Note
If the source structured grid is a Volume ROI it returns a copy.
Note
If the source structured grid is a MultiROI it extracts the labels and adds them all to a Volume ROI.
Parameters: - inOutStructuredGrid (ORSModel.ors.StructuredGrid) – an optional output Volume ROI (an StructuredGrid)
- IProgress (ORSModel.ors.Progress) – an optional progress object (a Progress)
Returns: output (ORSModel.ors.ROI) – the resulting Volume ROI (an StructuredGrid)
-
getBoundingBox(self, pTIndex: int) → Box Parameters: pTIndex (int) – Returns: output (ORSModel.ors.Box) –
-
getBox(self) → Box Gets the box.
Returns: output (ORSModel.ors.Box) – the box (an Box)
-
getClassNameStatic() → str getClassNameStatic
Returns: output (str) –
-
getDirtyBox(self, bResetDirtyBox: bool) → Box Gets the dirty box.
Parameters: bResetDirtyBox (bool) – insicate that the dirty box should be resetted (a bool) Returns: output (ORSModel.ors.Box) – the dirty box (a Box)
-
getHasNonZeroDataOnPlane(self, aPlane: ORSModel.ors.Plane, tStep: int) → bool Test to know if there is a non zero value on plain.
Parameters: - aPlane (ORSModel.ors.Plane) – a Plane (Plane)
- tStep (int) – a time step (uint32_t)
Returns: output (bool) – a bool (bool)
-
getHasNonZeroDataOnSlice(self, sliceIndex: int, timestep: int) → bool Parameters: - sliceIndex (int) –
- timestep (int) –
Returns: output (bool) –
-
getHasSameShape(self, pStructuredGrid: ORSModel.ors.StructuredGrid) → bool Verifies if the structured grid has same shape as another structured grid (see note below).
Note
Shape comparison includes axis sizes, spacing, position and orientation.
Parameters: pStructuredGrid (ORSModel.ors.StructuredGrid) – a comparison structured grid Returns: output (bool) – true if the comparison structured grid has same shape as receiver structured grid, false otherwise
-
getIndexOfFirstIntersectingNonZeroElement(self, aLine: ORSModel.ors.Line, subBox: ORSModel.ors.Box, timestep: int) → Vector3 Parameters: - aLine (ORSModel.ors.Line) –
- subBox (ORSModel.ors.Box) –
- timestep (int) –
Returns: output (ORSModel.ors.Vector3) –
-
getLabelAtPosition(self, tIndex: int, worldPosition: ORSModel.ors.Vector3) → int Parameters: - tIndex (int) –
- worldPosition (ORSModel.ors.Vector3) –
Returns: output (int) –
-
getOrigin(self) → Vector3 Returns: output (ORSModel.ors.Vector3) –
-
getOriginalBox(self) → Box Returns: output (ORSModel.ors.Box) –
-
getPositionOfFirstIntersectingNonZeroElement(self, aLine: ORSModel.ors.Line, subBox: ORSModel.ors.Box, timestep: int) → Vector3 Parameters: - aLine (ORSModel.ors.Line) –
- subBox (ORSModel.ors.Box) –
- timestep (int) –
Returns: output (ORSModel.ors.Vector3) –
-
getShape3DGrownToContain(self, aShape: ORSModel.ors.Shape3D, timeIndex: int) → Shape3D Parameters: - aShape (ORSModel.ors.Shape3D) –
- timeIndex (int) –
Returns: output (ORSModel.ors.Shape3D) –
-
getSliceAtIndex(self, zIndex: int, inStructuredGridSlice: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → StructuredGrid Parameters: - zIndex (int) –
- inStructuredGridSlice (ORSModel.ors.StructuredGrid) –
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.StructuredGrid) –
-
getSliceIntersectingBoundedPlane(self, aBoundedPlane: ORSModel.ors.Rectangle, inStructuredGridSlice: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → StructuredGrid Parameters: - aBoundedPlane (ORSModel.ors.Rectangle) –
- inStructuredGridSlice (ORSModel.ors.StructuredGrid) –
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.StructuredGrid) –
-
getSpaceHasBeenTransformed(self) → bool Returns: output (bool) –
-
getSpacingInDirection(self, pDirection: ORSModel.ors.Vector3) → float Gets the spacing in the specified direction.
Note
A structured grid knows its X, Y and Z spacing but can compute the spacing in any direction with this method.
Parameters: pDirection (ORSModel.ors.Vector3) – the direction vector (an Vector3) Returns: output (float) – The spacing (a double)
-
getSubset(self, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int, inChannelSubset: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → StructuredGrid Gets a subset of the the structuredGrid.
Note
To prevent creating extra StructuredGrid, the output StructuredGrid can be fed as the second to last argument to the method.
Note
If an output structured grid is not supplied, a StructuredGrid of the same base type will be created, otherwise the data will be fed directly into it.
Parameters: - xmin (int) – the X lower range (an uint32_t)
- ymin (int) – the Y lower range (an uint32_t)
- zmin (int) – the Z lower range (an uint32_t)
- tmin (int) – the T lower range (an uint32_t)
- xmax (int) – the X upper range (an uint32_t)
- ymax (int) – the Y upper range (an uint32_t)
- zmax (int) – the Z upper range (an uint32_t)
- tmax (int) – the T upper range (an uint32_t)
- inChannelSubset (ORSModel.ors.StructuredGrid) – the output structured grid (see notes)
- IProgress (ORSModel.ors.Progress) – an optional progress object
Returns: output (ORSModel.ors.StructuredGrid) – a StructuredGrid (see notes)
-
getTSize(self) → int Gets the T size of the structured grid.
Note
The T size is expressed in units.
Returns: output (int) – the T size (an uint32_t)
-
getTSpacing(self) → float Gets the structured grid’s T spacing.
Note
Spacing is used for structured grid visual representation.
Returns: output (float) – T spacing (a double)
-
getTransformationFromOriginalReferential(self) → Matrix4x4 Returns: output (ORSModel.ors.Matrix4x4) –
-
getTransformationShape3D(self) → Shape3D Returns: output (ORSModel.ors.Shape3D) –
-
getValueAtPosition(self, worldPos: ORSModel.ors.Vector3, timestep: int, defaultValue: float) → float Parameters: - worldPos (ORSModel.ors.Vector3) –
- timestep (int) –
- defaultValue (float) –
Returns: output (float) –
-
getVoxelToWorldCoordinates(self, anIndex: ORSModel.ors.Vector3) → Vector3 Gets a given voxel’s location in DICOM Reference Coordinates Syste.
Note
This method returns the world coordinates of any given voxel. The arguments supplied represent the voxel index, but can be offset by a value between 0 and 1, to discover the exact subvoxel location. For example, to find the exact middle location of the voxel at x30,y50,z65, use getVoxelToWorldCoordinates (30.5, 50.5, 65.5).
Parameters: anIndex (ORSModel.ors.Vector3) – the voxel coordinate as a Vector3 Returns: output (ORSModel.ors.Vector3) – the world coordinates (in a vector) of the voxel (an Vector3)
-
getWorldToVoxelCoordinates(self, pPointInWorld: ORSModel.ors.Vector3) → Vector3 Gets a given voxel’s index from DICOM Reference Coordinates System.
Parameters: pPointInWorld (ORSModel.ors.Vector3) – the voxel coordinate encoded in Vector3 Returns: output (ORSModel.ors.Vector3) – the voxel coordinates (in a vector) of the voxel (an Vector3)
-
getXSize(self) → int Gets the X size of the structured grid.
Note
The size is expressed in pixels.
Returns: output (int) – the X size (an uint32_t)
-
getXSpacing(self) → float Gets the structured grid’s X spacing.
Note
Spacing is used for structured grid visual representation.
Returns: output (float) – X spacing (a double)
-
getYSize(self) → int Gets the Y size of the structured grid.
Note
The size is expressed in pixels.
Returns: output (int) – the Y size (an uint32_t)
-
getYSpacing(self) → float Gets the structured grid’s Y spacing.
Note
Spacing is used for structured grid visual representation.
Returns: output (float) – Y spacing (a double)
-
getZSize(self) → int Gets the Z size of the structured grid.
Note
The size is expressed in pixels.
Returns: output (int) – the Z size (an uint32_t)
-
getZSliceThickness(self) → float Gets the structured grid’s Z slice thickness.
Note
Slice thickness is used for structured grid visual representation.
Returns: output (float) – Z slice thickness (a double)
-
getZSpacing(self) → float Gets the structured grid’s Z spacing.
Note
Spacing is used for structured grid visual representation.
Returns: output (float) – Z spacing (a double)
-
none() → StructuredGrid Returns a none object, equivalent to a non-existent object (or null).
Returns: output (StructuredGrid) –
-
paintBox(self, pBox: ORSModel.ors.Box, label: float, tStep: int) → None Parameters: - pBox (ORSModel.ors.Box) –
- label (float) –
- tStep (int) –
-
paintBoxIfInRange(self, pBox: ORSModel.ors.Box, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None Parameters: - pBox (ORSModel.ors.Box) –
- label (float) –
- tStep (int) –
- fMinValue (float) –
- fMaxValue (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
-
paintBoxIntersectingChannel(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingChannel: ORSModel.ors.Channel, levelingMinRange: float, levelingMaxRange: float, pLUT: ORSModel.ors.LookupTable, intersectingChannelClipBox: ORSModel.ors.Box) → None Parameters: - pBox (ORSModel.ors.Box) –
- label (float) –
- tStep (int) –
- intersectingChannel (ORSModel.ors.Channel) –
- levelingMinRange (float) –
- levelingMaxRange (float) –
- pLUT (ORSModel.ors.LookupTable) –
- intersectingChannelClipBox (ORSModel.ors.Box) –
-
paintBoxIntersectingMultiROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingMultiROI: ORSModel.ors.MultiROI, fHightlightOpacity: float, fHightlightOpacityOutRange: float, intersectingMultiROIClipBox: ORSModel.ors.Box) → None Parameters: - pBox (ORSModel.ors.Box) –
- label (float) –
- tStep (int) –
- intersectingMultiROI (ORSModel.ors.MultiROI) –
- fHightlightOpacity (float) –
- fHightlightOpacityOutRange (float) –
- intersectingMultiROIClipBox (ORSModel.ors.Box) –
-
paintBoxIntersectingROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box) → None Parameters: - pBox (ORSModel.ors.Box) –
- label (float) –
- tStep (int) –
- intersectingROI (ORSModel.ors.ROI) –
- intersectingROIClipBox (ORSModel.ors.Box) –
-
paintCircleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- radius (float) –
- label (float) –
- timeIndex (int) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintCircleOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- radius (float) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintEllipseOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Radius: float, dir1Radius: float, axisOrientation: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- dir0Radius (float) –
- dir1Radius (float) –
- axisOrientation (float) –
- label (float) –
- timeIndex (int) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintEllipseOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Radius: float, dir1Radius: float, axisOrientation: float, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- dir0Radius (float) –
- dir1Radius (float) –
- axisOrientation (float) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintPolygonOnPlane(self, pPlane: ORSModel.ors.Rectangle, polygonWorldPos: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- polygonWorldPos (ORSModel.ors.ArrayDouble) –
- label (float) –
- timeIndex (int) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintPolygonOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, polygonWorldPos: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- polygonWorldPos (ORSModel.ors.ArrayDouble) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintRectangleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Length: float, dir1Length: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- dir0Length (float) –
- dir1Length (float) –
- label (float) –
- timeIndex (int) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintRectangleOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Length: float, dir1Length: float, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- dir0Length (float) –
- dir1Length (float) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintRemoveBox(self, pBox: ORSModel.ors.Box, tStep: int) → None Removes a box (3D object) from the receiver.
Parameters: - pBox (ORSModel.ors.Box) – The T index (a uint32_t)
- tStep (int) –
-
paintRemoveCircleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Removes a circle (2D object) from the receiver.
Parameters: - pPlane (ORSModel.ors.Rectangle) – The plane of the circle (a Rectangle)
- worldPos (ORSModel.ors.Vector3) – The center of the circle (a Vector3)
- radius (float) – The radius of the circle (a double)
- timeIndex (int) – The T index (a uint32_t)
- worldPositionArray (ORSModel.ors.ArrayDouble) – None
-
paintRemoveSphere(self, worldPos: ORSModel.ors.Vector3, fRadius: float, tStep: int) → None Removes a sphere (3D object) from the receiver.
Parameters: - worldPos (ORSModel.ors.Vector3) – The center of the sphere (a Vector3)
- fRadius (float) – The sphere radius (a double)
- tStep (int) – The T index (a uint32_t)
-
paintRemoveSquareOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Removes a square (2D object) from the receiver.
Parameters: - pPlane (ORSModel.ors.Rectangle) – The plane of the square (a Rectangle)
- worldPos (ORSModel.ors.Vector3) – The center of the square (a Vector3)
- radius (float) – The radius (a double)
- timeIndex (int) – The T index (a uint32_t)
- worldPositionArray (ORSModel.ors.ArrayDouble) – None
-
paintShape3D(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int) → None Parameters: - aShape (ORSModel.ors.Shape3D) –
- label (float) –
- tStep (int) –
-
paintShape3DIfInRange(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None Parameters: - aShape (ORSModel.ors.Shape3D) –
- label (float) –
- tStep (int) –
- fMinValue (float) –
- fMaxValue (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
-
paintSphere(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int) → None Parameters: - worldPos (ORSModel.ors.Vector3) –
- fRadius (float) –
- label (float) –
- tStep (int) –
-
paintSphereIfInRange(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None Parameters: - worldPos (ORSModel.ors.Vector3) –
- fRadius (float) –
- label (float) –
- tStep (int) –
- fMinValue (float) –
- fMaxValue (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
-
paintSphereIntersectingChannel(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingChannel: ORSModel.ors.Channel, levelingMinRange: float, levelingMaxRange: float, pLUT: ORSModel.ors.LookupTable, intersectingChannelClipBox: ORSModel.ors.Box) → None Parameters: - worldPos (ORSModel.ors.Vector3) –
- fRadius (float) –
- label (float) –
- tStep (int) –
- intersectingChannel (ORSModel.ors.Channel) –
- levelingMinRange (float) –
- levelingMaxRange (float) –
- pLUT (ORSModel.ors.LookupTable) –
- intersectingChannelClipBox (ORSModel.ors.Box) –
-
paintSphereIntersectingMultiROI(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingMultiROI: ORSModel.ors.MultiROI, fHightlightOpacity: float, fHightlightOpacityOutRange: float, intersectingMultiROIClipBox: ORSModel.ors.Box) → None Parameters: - worldPos (ORSModel.ors.Vector3) –
- fRadius (float) –
- label (float) –
- tStep (int) –
- intersectingMultiROI (ORSModel.ors.MultiROI) –
- fHightlightOpacity (float) –
- fHightlightOpacityOutRange (float) –
- intersectingMultiROIClipBox (ORSModel.ors.Box) –
-
paintSphereIntersectingROI(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box) → None Parameters: - worldPos (ORSModel.ors.Vector3) –
- fRadius (float) –
- label (float) –
- tStep (int) –
- intersectingROI (ORSModel.ors.ROI) –
- intersectingROIClipBox (ORSModel.ors.Box) –
-
paintSquareOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- radius (float) –
- label (float) –
- timeIndex (int) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintSquareOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid, worldPositionArray: ORSModel.ors.ArrayDouble) → None Parameters: - pPlane (ORSModel.ors.Rectangle) –
- worldPos (ORSModel.ors.Vector3) –
- radius (float) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
- worldPositionArray (ORSModel.ors.ArrayDouble) –
-
paintSubset(self, startX: int, startY: int, startZ: int, endX: int, endY: int, endZ: int, label: float, tStep: int) → None Parameters: - startX (int) –
- startY (int) –
- startZ (int) –
- endX (int) –
- endY (int) –
- endZ (int) –
- label (float) –
- tStep (int) –
-
paintSubsetIfInRange(self, startX: int, startY: int, startZ: int, endX: int, endY: int, endZ: int, label: float, tStep: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None Parameters: - startX (int) –
- startY (int) –
- startZ (int) –
- endX (int) –
- endY (int) –
- endZ (int) –
- label (float) –
- tStep (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
-
paintVoxelsFromWorldCoordinates(self, worldPositionArray: ORSModel.ors.ArrayDouble, label: float, timeIndex: int) → None Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) –
- label (float) –
- timeIndex (int) –
-
paintVoxelsFromWorldCoordinatesIfInRange(self, worldPositionArray: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None Parameters: - worldPositionArray (ORSModel.ors.ArrayDouble) –
- label (float) –
- timeIndex (int) –
- lowerThreshold (float) –
- upperThreshold (float) –
- pRangeChannel (ORSModel.ors.StructuredGrid) –
-
projectInto(self, aDestinationStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → None Copies the receiver into the destination, keeping the destination shape.
Parameters: - aDestinationStructuredGrid (ORSModel.ors.StructuredGrid) – a destination StructuredGrid (a StructuredGrid)
- IProgress (ORSModel.ors.Progress) –
-
setBox(self, IInBox: ORSModel.ors.Box) → None Sets the box.
Parameters: IInBox (ORSModel.ors.Box) – the box (an Box)
-
setCurrentShapeAsOriginal(self) → None
-
setOrigin(self, origin: ORSModel.ors.Vector3) → None Parameters: origin (ORSModel.ors.Vector3) –
-
setTSize(self, pTSize: int) → None Sets the T size of the structured grid.
Note
The T size is expressed in units.
Parameters: pTSize (int) – T size (an uint32_t)
-
setTSpacing(self, pTSpacing: float) → None Sets the structured grid’s T spacing.
Note
Spacing is used for structured grid visual representation.
Parameters: pTSpacing (float) – T spacing (a double)
-
setTransformationShape3D(self, aShape: ORSModel.ors.Shape3D) → None Parameters: aShape (ORSModel.ors.Shape3D) –
-
setXSize(self, pXSize: int) → None Sets the X size of the structured grid.
Note
The size is expressed in pixels.
Parameters: pXSize (int) – X size (an uint32_t)
-
setXSpacing(self, pXSpacing: float) → None Sets the structured grid’s X spacing.
Note
Spacing is used for structured grid visual representation.
Parameters: pXSpacing (float) – X spacing (a double)
-
setXYZTSize(self, pXSize: int, pYSize: int, pZSize: int, pTSize: int) → None Sets the X,Y,Z,T sizes of the structured grid.
Note
The size is expressed in pixels.
Parameters: - pXSize (int) – X size (an uint32_t)
- pYSize (int) – Y size (an uint32_t)
- pZSize (int) – Z size (an uint32_t)
- pTSize (int) – T size (an uint32_t)
-
setYSize(self, pYSize: int) → None Sets the Y size of the structured grid.
Note
The size is expressed in pixels.
Parameters: pYSize (int) – Y size (an uint32_t)
-
setYSpacing(self, pYSpacing: float) → None Sets the structured grid’s Y spacing.
Note
Spacing is used for structured grid visual representation.
Parameters: pYSpacing (float) – Y spacing (a double)
-
setZSize(self, pZSize: int) → None Sets the Z size of the structured grid.
Note
The size is expressed in pixels.
Parameters: pZSize (int) – Z size (an uint32_t)
-
setZSliceThickness(self, pZThickness: float) → None Sets the structured grid’s Z slice thickness.
Note
Slice thickness is used for structured grid visual representation.
Parameters: pZThickness (float) – Z slice thickness (a double)
-
setZSpacing(self, pZSpacing: float) → None Sets the structured grid’s Z spacing.
Note
Spacing is used for structured grid visual representation.
Parameters: pZSpacing (float) – Z spacing (a double)
-
shape
-
sliceIteratorFromBox(viewBox, mask=None, usePositiveMask=True, computeMask=False)
-
sliceIteratorFromDirection(dir0, dir1, mask=None, positiveMask=True, computeMask=False)
-
sliceIteratorFromView(view, mask=None, positiveMask=True, computeMask=False)
-
Node¶
-
class
ORSModel.ors.Node Bases:
ORSModel.ors.Managedbrief_description: An abstract class for any object that can be a node in the visualization flow. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
addTransformationToStack(matrix, registrationMethod=None)
-
attachChild(self, anINode: ORSModel.ors.Node) → bool Attaches a child node.
Note
Certain parent-child relationships are forbidden, hence the need to verify the result.
Note
Calling this method several times will still result in the child node only appearing once in its parent.
Parameters: anINode (ORSModel.ors.Node) – the node to attach (a Node) Returns: output (bool) – true if child was attached, false otherwise
-
attachChildAtIndex(self, anINode: ORSModel.ors.Node, index: int) → bool Attaches a child node at a given index.
Note
Certain parent-child relationships are forbidden, hence the need to verify the result.
Note
Calling this method several times will still result in the child node only appearing once in its parent.
Parameters: - anINode (ORSModel.ors.Node) – the node to attach (a Node)
- index (int) – the index (a uint32_t)
Returns: output (bool) – true if child was attached, false otherwise
-
copyGraph(self) → Node Returns a copy of the node, including its graph.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Returns: output (ORSModel.ors.Node) – a new node (a Node)
-
detachChild(self, anINode: ORSModel.ors.Node) → bool Detaches a child node.
Parameters: anINode (ORSModel.ors.Node) – the node to detach (a Node) Returns: output (bool) – true if child was detached, false otherwise
-
getAllChildrenNodes(self) → List Returns a flattened list of the child hierarchy of the node.
Note
The child hierarchy is flattened.
Note
Expect no particular ordering of the nodes.
Returns: output (ORSModel.ors.List) – a list of all nodes below the node (a List)
-
getAllChildrenOfClass(self, pProgId: str) → List Returns all the nodes of the specified class found in the child hierarchy.
Note
Result will be an empty list if no match is found.
Note
The search is done breadth-first.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getAllChildrenOfClassReachableByRenderer(self, pProgId: str) → List Returns a flattened list of all the child nodes, of the given class, that are renderable.
Note
The list contains only Managed objects (they will need to be typecast to the appropriate class).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of all child nodes that can be rendered (an List)
-
getAllParentNodes(self) → List Returns a flattened list of the parent hierarchy of the node.
Note
The parent hierarchy is flattened.
Note
Expect no particular ordering of the nodes.
Returns: output (ORSModel.ors.List) – a list of all nodes above the node (an List)
-
getAllParentsOfClass(self, pProgId: str) → List Returns all the nodes of the specified class found in the parent hierarchy.
Note
Result will be an empty list if no match is found.
Note
The search is done breadth-first.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getChildWithGUID(self, aGUID: str) → Node Gets an immediate child node with the given GUID.
Note
Only immediate children are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: aGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
-
getChildWithTitle(self, aTitle: str) → Node Gets an immediate child node with the given title.
Note
Only immediate children are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: aTitle (str) – a string (a string) Returns: output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
-
getChildrenNodes(self) → List Returns the list of immediate child nodes.
Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getChildrenOfClass(self, pProgId: str) → List Returns the nodes of the specified class found in the immediate children.
Note
Result will be an empty list if no match is found.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getClassNameStatic() → str getClassNameStatic
Returns: output (str) –
-
getFirstChildOfClass(self, pProgId: str) → Node Returns the first object of the specified class found in the child hierarchy.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
-
getFirstChildOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node Searches the hierarchy for a child node with the specified class and private title.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- privateTitle (str) – some text (a string)
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFirstFrameTowardsNode(self, anINode: ORSModel.ors.Node) → ReferenceFrame Gets the first frame found going up the hierarchy towards a given object.
Parameters: anINode (ORSModel.ors.Node) – the target node (an Node) Returns: output (ORSModel.ors.ReferenceFrame) – a frame (an ReferenceFrame) or none if no frame is found
-
getFirstNodeWithClassNameTowardsNode(self, pProgId: str, anINode: ORSModel.ors.Node) → Node Searches the hierarchy for a parent node with the specified class toward a specific parent nopde.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- anINode (ORSModel.ors.Node) – a target node
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFirstParentOfClass(self, pProgId: str) → Node Returns the first object of the specified class found in the parent hierarchy.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
-
getFirstParentOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node Searches the hierarchy for a parent node with the specified class and private title.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- privateTitle (str) – some text (a string)
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFrameTransformationFromNode(self, towardNode: ORSModel.ors.Node, pTimeStep: int) → Matrix4x4 Parameters: - towardNode (ORSModel.ors.Node) –
- pTimeStep (int) –
Returns: output (ORSModel.ors.Matrix4x4) –
-
getImmediateChildOfClass(self, pProgId: str) → Node Searches for a child node with the specified class.
Note
Only the immediate children are searched, not the hierarchy.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getImmediateParentOfClass(self, pProgId: str) → Node Searches for a parent node with the specified class.
Note
Only the immediate parents are searched, not the hierarchy.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getImmediateParentWithGUID(self, pGUID: str) → Node Gets a parent node with the given GUID.
Note
Only immediate parents are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: pGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
-
getIsNodeOneOfMyAscendants(self, anINode: ORSModel.ors.Node) → bool Checks to see if a specified node is in the parent hierarchy of the node.
Note
The parent hierarchy is searched in its entirety for the specified node.
Note
The search is conducted depth-first.
Parameters: anINode (ORSModel.ors.Node) – Returns: output (bool) – true if the specified node in the parent hierarchy, false otherwise
-
getIsNodeOneOfMyDescendants(self, anINode: ORSModel.ors.Node) → bool Checks to see if a specified node is in the child hierarchy of the node.
Note
The child hierarchy is searched in its entirety for the specified node.
Note
The search is conducted depth-first.
Parameters: anINode (ORSModel.ors.Node) – Returns: output (bool) – true if the specified node in the child hierarchy, false otherwise
-
getMaxTSizeOfChilden(self) → int Get Maximum T Size of all children node of this node.
Returns: output (int) –
-
getParentNodes(self) → List Gets the immediate parent nodes.
Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getParentWithGUID(self, pGUID: str) → Node Gets a parent node (from the hierarchy) with the given GUID.
Note
The whole parent hierarchy is searched.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: pGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
-
getParentsOfClass(self, pProgId: str) → List Returns the nodes of the specified class found in the immediate parents.
Note
Result will be an empty list if no match is found.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getVisual(self) → Visual Gets the visual of a model. Some models have a visual, e.g.Channel has VisualChannel as Visual.
Returns: output (ORSModel.ors.Visual) – the visual of a model (a Visual)
-
none() → Node Returns a none object, equivalent to a non-existent object (or null).
Returns: output (Node) –
-
propagateChildrenNodesOrganizationDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsChildrenNodesOrganizationDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateDataDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsDataDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateDirty(self, dirtyFlag: str, includeSelf: bool) → None Causes a dirty message to be sent to all children nodes.
Note
See ORS_def.h for default dirty flag (ex: ORSDataDirty).
Note
A dirty message has different results for different objects, but generally causes a refresh on the data.
Note
Message propagation is done depth-first.
Parameters: - dirtyFlag (str) – a string dirty flag (a string)
- includeSelf (bool) – should set this dirty (a bool)
-
propagateGeometryDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsGeometryDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateHighlightDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsHighlightDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagatePropertyDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsPropertyDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateVisibilityDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsVisibilityDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
refresh() Refreshes the views related to the current object
-
refreshAll2DParentViews(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed.
-
refreshAll2DParentViewsIfVisible(self) → None Causes all 2D views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
refreshAll3DParentViews(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed.
-
refreshAll3DParentViewsIfVisible(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
refreshAllParentViews(self) → None Causes all views in the parent hierarchy of the node to be refreshed.
-
refreshAllParentViewsIfVisible(self) → None Causes all views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
setAllowRenderingInAllParentViews(self, bValue: bool) → None Allows or prevents rendering in the views affected by a node.
Parameters: bValue (bool) – true to allow rendering, false to disallow it.
-
switchOrderOfPrecedenceOfChildrenNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool Rearranges the order of child nodes.
Note
When child nodes are not in the desired order, they can be switched with this method (for example, the order in which they are rendered can be undesired).
Note
Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfChildrenNodes(A, C), the nodes are then in this order: C B A D.
Note
This method dives down in the child hierarchy until it finds a node where both arguments appear, then performs the switch at that level.
Parameters: - anINode1 (ORSModel.ors.Node) – a child node (a Node)
- anINode2 (ORSModel.ors.Node) – a child node (a Node)
Returns: output (bool) – true if successful, false otherwise
-
switchOrderOfPrecedenceOfParentNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool Rearranges the ordering of immediate parent nodes.
Note
When parent nodes are not in the desired order, they can be switched with this method.
Note
Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfParentNodes(A, C), the nodes are then in this order: C B A D.
Note
This method acts only on immediate parent nodes, not the entire parent hierarchy.
Parameters: - anINode1 (ORSModel.ors.Node) – a parent node (a Node)
- anINode2 (ORSModel.ors.Node) – a parent node (a Node)
Returns: output (bool) – true if successful, false otherwise
-
Managed¶
-
class
ORSModel.ors.Managed Bases:
ORSModel.ors.ORSBaseClassbrief_description: An abstract class that implements all the default behavior of managed objects. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
addCallbackToEvent(self, anEventName: str, sCallbackName: str, callbackData: int) → bool Adds a callback subscription to an event.
Note
The callback name for a given event needs to be unique for that event, i.e. no two callbacks for a given event can have the same name.
Parameters: - anEventName (str) – name of the event to subscribe to (a string)
- sCallbackName (str) – callback name (a string)
- callbackData (int) – a pointer to a ORS_EVENT_CALLBACK_INFO structure
Returns: output (bool) – true if subscription succeeded, false otherwise
-
addToDeleteSet(self, anIObject: ORSModel.ors.Managed) → None Add an object to the delete set.
Note
All objects have a delete set, which designates those objects that should also be deleted when the receiver gets deleted.
Parameters: anIObject (ORSModel.ors.Managed) – an object (a Managed)
-
addToSelection(contextInstance) Adds the instance to the selection of a context
Parameters: contextInstance (plugin instance) – context instance Note
Only representable object can be selected
-
applyPreferences() Helper for setting the attribute of the object following the preferences
-
atomicLoad(sFilename: str, bPreserveIdentity: bool) → Managed Creates an object from a file where an object was save.
Parameters: - sFilename (str) – path of the file to load
- bPreserveIdentity (bool) – if true, preserves the identity of the object, false otherwise
Returns: output (Managed) – a managed object, or none() if the load fails
-
atomicLoadFrom(self, anXML: str) → None Loads an object from an XML string.
Parameters: anXML (str) – Managed.atomicLoadFrom(self, buffer: int, nBytes: int) -> None
Loads an object from a buffer. Used for python pickling.
Parameters: - buffer (bytes) – the buffer
- nBytes (int) – the number of bytes in the buffer (a 64 bit unsigned int)
-
atomicLoadSpecificNode(self, aFilename: str, aXPathOfTheNodeToLoad: str) → bool Loads an object from a file containing several objects.
Parameters: - aFilename (str) –
- aXPathOfTheNodeToLoad (str) –
Returns: output (bool) –
-
atomicSave(self, aFilename: str, isTemporary: bool) → int Saves the object to a file.
Parameters: - aFilename (str) – path of the file to save
- isTemporary (bool) – if true, try to keep file in memory
Returns: output (int) – 0 if successful, otherwise an error code
-
copy(self) → Managed Returns a copy of the managed.
Note
Only the immediate attributes of the managed are copied. The graph surrounding the new managed is the same one as the source managed.
Note
You can type the return value of this method to any subclass of Managed, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be NULL.
Returns: output (ORSModel.ors.Managed) – a new managed (a Managed)
-
createScalarValuesCollection(self) → None
-
deleteObject(self) → None Explicitly deletes the core object wrapped by this Interface object.
-
deleteObjectAndAllItsChildren(self) → None Explicitly deletes the core object wrapped by this Interface object, along with all its children.
-
getAllGroupsContaining(self, anIObject: ORSModel.ors.Managed) → List Gets all the groups that contain the given object.
Parameters: anIObject (ORSModel.ors.Managed) – Returns: output (ORSModel.ors.List) –
-
classmethod
getAllInstances()
-
getAllInstancesOf(pProgId: str) → List Gathers all existing objects of the specified class.
Parameters: pProgId (str) – Returns: output (ORSModel.ors.List) –
-
classmethod
getAllObjectsOfClass(cls_name)
-
getAllObjectsOfClassAndPrivateTitle(pProgId: str, pPrivateTitle: str) → List Gathers all existing objects of the specified class, that have a matching private title.
Parameters: - pProgId (str) – name of the class (a string)
- pPrivateTitle (str) – private title to search for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
getAllObjectsOfClassAndTitle(pProgId: str, pTitle: str) → List Gathers all existing objects of the specified class, that have a matching title.
Parameters: - pProgId (str) – name of the class (a string)
- pTitle (str) – title to search for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
getAllObjectsOfClassAndUserData(pProgId: str, userDataKey: str, userDataValue: str) → List Gathers all existing objects of the specified class, that have a matching user data.
Parameters: - pProgId (str) – name of the class (a string)
- userDataKey (str) – key of the user data (a string)
- userDataValue (str) – value to look for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
classmethod
getAllRepresentableInstances()
-
getAllRepresentableInstancesOf(pProgId: str) → List Gathers all existing objects of the specified class that are representable.
Parameters: pProgId (str) – Returns: output (ORSModel.ors.List) –
-
getAllRepresentableObjects(self) → List Gets all the representable objects of the world.
Returns: output (ORSModel.ors.List) – a list containing all the representable objects
-
classmethod
getAllSubclasses(outputCollection=None)
-
getAtomicTextRepresentation(self, bSelfContained: bool) → str Retrieves the object’s atomic text representation.
Parameters: bSelfContained (bool) – Returns: output (str) –
-
getBinaryUserInfo(self, pTag: str) → None Retrieves a user defined binary value. Typed as void* for sip, but it’s in reality an unsigned char*.
Note
If the key doesn’t exist, nullptr is returned
Parameters: pTag (str) – key of the data (a string)
-
getBinaryUserInfoAsBytes(name)
-
getBinaryUserInfoSize(self, pTag: str) → int Retrieves the size of a user defined binary value.
Note
If the key doesn’t exist, 0 is returned
Parameters: pTag (str) – key of the data (a string) Returns: output (int) – the size of the data (a uint32_t)
-
getCallbacksEnabled(self) → bool Queries the object to know if its callbacks are enabled or disabled.
Returns: output (bool) – true if callbacks are enabled, false otherwise
-
getChildrenNodesOrganizationDirtySignature() Gets the current dirty signature for the flag OrsChildrenNodesOrganizationDirty
Returns: childrenNodesOrganizationDirtySignature (int) – the dirty signature
-
classmethod
getClassDenomination()
-
static
getClassFromProgId(progId)
-
getClassName(self) → str Retrieves the class name of the core object wrapped by this Interface object.
Returns: output (str) – the class name (a string)
-
getClassNameStatic() → str getClassNameStatic
Returns: output (str) –
-
getCreationTime(self) → int Returns the time Number of seconds since Jan 1 2000 of creation of this object.
Returns: output (int) – a uint32_t
-
getDataChecksum(self) → str Returns: output (str) –
-
getDataDirtySignature() Gets the current dirty signature for the flag OrsDataDirty
Returns: dataDirtySignature (int) – the dirty signature
-
getDirtySignature(self, dirtyFlag: str) → int Gets the current dirty signature.
Note
Objects can be dirty for several aspects, see the ors_def.h file for the different dirty aspects.
Parameters: dirtyFlag (str) – dirty flag name (a string, see note below) Returns: output (int) – dirty signature (a uint64_t)
-
getEntireDirtySignature(self) → int Gets the current dirty signature for all aspects, added up.
Note
Objects can be dirty for several aspects, see the ors_def.h file for the different dirty aspects.
Returns: output (int) – entire dirty signature (a uint64_t)
-
getEventCallbackEnabled(self, sEventName: str, sCallbackName: str) → bool Gets the enabled state of a callback subscription to an event.
Parameters: - sEventName (str) – event name (a string)
- sCallbackName (str) – callback name (a string)
Returns: output (bool) – true if callback is enabled, false if disabled or if the callback subscription did not exist
-
getGUID(self) → str Retrieves the GUID of the core object.
Note
The GUID is the unique identifier of the object. No two objects can have the same GUID. Once you have an object’s GUID, at any time you can obtain a reference to that object via its GUID, given that the object is still alive.
Returns: output (str) –
-
getGeometryDirtySignature() Gets the current dirty signature for the flag OrsGeometryDirty
Returns: geometryDirtySignature (int) – the dirty signature
-
getHasCallbacksForEvent(self, anEventName: str) → bool Checks if the receiver has any callbacks for an event.
Parameters: anEventName (str) – name of the event (a string) Returns: output (bool) –
-
getHighlightDirtySignature() Gets the current dirty signature for the flag OrsHighlightDirty
Returns: highlightDirtySignature (int) – the dirty signature
-
getIsAllowedToBeDeletedInContext(pluginInstance=None)
-
getIsAvailableInContext(pluginInstance=None)
-
getIsDirty(self, dirtyFlag: str) → bool Gets if the object is dirty for a specific dirty flag.
Parameters: dirtyFlag (str) – dirty flag name (a string, see note below) Returns: output (bool) – true if object is dirty, false otherwise
-
getIsDirtyAnyDirtyFlag(self) → bool Gets if the object is dirty for any of the dirty flags.
Returns: output (bool) – true if object is dirty, false otherwise
-
getIsEqualTo(self, aManaged: ORSModel.ors.Managed) → bool Checks if the two objects are equal.
Parameters: aManaged (ORSModel.ors.Managed) – an object to compare with (a Managed) Returns: output (bool) – true if the receiver and the argument are equal (class dependent), false otherwise
-
getIsExclusiveToContext(pluginInstance=None)
-
getIsIdentityPreservedForPickling(self) → bool Returns True if the GUID is preserved when pickling and unpickling an object.
Returns: output (bool) – Returns True if the GUID is preserved when pickling and unpickling an object
-
getIsInDeleteSet(self, anIObject: ORSModel.ors.Managed) → bool Gets if an object is included in the receiver delete set.
Note
The delete set is a list of objects that are to be deleted when the receiver is deleted.
Parameters: anIObject (ORSModel.ors.Managed) – object to look for in the receiver delete set (a Managed) Returns: output (bool) – true if the object is in the delete set of the receiver, false otherwise
-
getIsInstanceOf(self, pProgId: str) → bool Queries the object to know if it is an instance of a certain class.
Parameters: pProgId (str) – Returns: output (bool) –
-
getIsInstanceOfAtLeastOneClasses(progIdList)
-
getIsModifiedAnyAspect()
-
getIsPrivateInContext(pluginInstance=None)
-
getIsPublicInAllContexts()
-
getIsRepresentable(self) → bool Queries the object to know if it is representable.
Returns: output (bool) –
-
getIsSameObjectAs(self, anObject: ORSModel.ors.Managed) → bool Checks to see if the receiver wraps the same underlying object as the supplied argument.
Parameters: anObject (ORSModel.ors.Managed) – an object to compare with (a Managed) Returns: output (bool) – true if underlying object is the same for both the receiver and the argument, false otherwise
-
classmethod
getIsSubclassOf(parentClass)
-
getIsToBeKeptAliveUntilExit(self) → bool Queries the object to know if it is permanent for the life of the application.
Note
Permanent objects survive a new session, i.e. they live until the application is terminated.
Returns: output (bool) – true if object is permanent, false otherwise
-
getIsToBeSaved(self) → bool Queries the object to know if it should be saved in a session file.
Returns: output (bool) – true if object should be saved, false otherwise
-
getMetadataChecksum(self) → str Returns: output (str) –
-
getObjectWithGUID(guid: str) → Managed Retrieves an object from its GUID.
Parameters: guid (str) – a GUID (a string) Returns: output (ORSModel.ors.Managed) – An object or none if object is not found
-
getPrivateTitle(self) → str Gets the private title of the object.
Note
The private title is never shown in the application, but is a means by which an object can be found (getAllObjectsOfClassAndPrivateTitle for example).
Returns: output (str) – private title of the object (a string)
-
getPropertyDirtySignature() Gets the current dirty signature for the flag OrsPropertyDirty
Returns: propertyDirtySignature (int) – the dirty signature
-
getPythonRepresentation(self) → str Gets a Python evaluable string representation.
Returns: output (str) – The object’s representation (a string)
-
getReferenceCount(self) → int Returns the count of references to the object.
Returns: output (int) – the count of references (an int)
-
getScalarValuesCollection(self) → ScalarValuesCollection Returns: output (ORSModel.ors.ScalarValuesCollection) –
-
getTitle(self) → str Gets the title of the object.
Returns: output (str) – the title (a string)
-
getUserInfo(self, pTag: str) → str Retrieves a user defined value.
Note
If the key doesn’t exist an empty string is returned.
Parameters: pTag (str) – key of the data (a string) Returns: output (str) – the data (a string)
-
getUserInfoAsArray(self) → ArrayString Retrieves the user info as a string array.
Note
The user info data is flattened into an array of string pairs, for the key and the value.
Returns: output (ORSModel.ors.ArrayString) – the data (an ArrayString, see note below)
-
getUserInfoPickledObject(name)
-
getVisibilityDirtySignature() Gets the current dirty signature for the flag OrsVisibilityDirty
Returns: visibilityDirtySignature (int) – the dirty signature
-
isManaged(self) → bool Returns: output (bool) –
-
isNone(self) → bool check if the object is none
Returns: output (bool) –
-
isNotNone(self) → bool check if the object is Not none
Returns: output (bool) –
-
none() → Managed Returns a none object, equivalent to a non-existent object (or null).
Returns: output (Managed) –
-
publish() Sets an object as representable and notifies the Dragonfly UI of a new available object
-
removeBinaryUserInfo(self, pTag: str) → None Removes a user defined binary value.
Parameters: pTag (str) – key name of the binary value (a string)
-
removeCallbackFromEvent(guid: str, sEventName: str, sCallbackName: str, bRemoveInDeletedObject: bool) → bool Removes a callback subscription to an event.
Parameters: - guid (str) – object GUID (a string)
- sEventName (str) – name of the callback event (a string)
- sCallbackName (str) – name of the callback (a string)
- bRemoveInDeletedObject (bool) – if true, the callback will be removed from the object even if that object is in the process of being deleted (a boolean)
Returns: output (bool) – true callback existed, false otherwise
-
removeFromDeleteSet(self, anIObject: ORSModel.ors.Managed) → None Remove an object from the delete set.
Note
The delete set is a list of objects that are to be deleted when the receiver is deleted.
Parameters: anIObject (ORSModel.ors.Managed) – object to be removed from the delete set (a Managed)
-
removeUserInfo(self, pTag: str) → None Removes a user defined value.
Parameters: pTag (str) – key of the data (a string)
-
selectExclusively(contextInstance) Selects only the current instance for a context
Parameters: contextInstance (plugin instance) – context instance Note
Only representable object can be selected
-
setAsTemporaryObject(isTemporaryObject=True) Helper for setting useful properties when marking an object as a (non-)temporary object.
Parameters: isTemporaryObject (bool) – if True, the object will be set as temporary (not representable, not to be saved, callbacks disabled). Otherwise, these properties are set as the opposite.
-
setBinaryUserInfo(self, pTag: str, pValue: int, iDataSize: int) → None Sets a user defined binary value.
Note
Objects can carry user defined data in the form of strings or binary data.
Parameters: - pTag (str) – key of the data (a string)
- pValue (bytes) – the data (an unsigned char* buffer)
- iDataSize (int) – the size of the data (a uint32_t)
-
setCallbacksEnabled(self, enabled: bool) → None Sets the object’s callbacks to be enabled or not.
Note
When an object’s callbacks are disabled, absolutely no callbacks are triggered from the receiver.
Parameters: enabled (bool) – true to enable callbacks, false otherwise
-
setChildrenNodesOrganizationDirty() Calls for a setDirty with the flag OrsChildrenNodesOrganizationDirty
-
setDataDirty() Calls for a setDirty with the flag OrsDataDirty
-
setDirty(self, dirtyFlag: str) → None Sets the object as being dirty for a given aspect.
Note
A dirty object is an object that has changed, giving its observers a chance to refresh their view on the object. Several aspects of an object can be dirty, see ORS_def.h for dirty signature flags.
Parameters: dirtyFlag (str) – dirty flag name (a string)
-
setEventCallbackEnabled(self, sEventName: str, sCallbackName: str, bValue: bool) → bool Enables/disables a callback subscription to an event.
Note
Works for all callback types (object, class and global)
Parameters: - sEventName (str) – event name (a string)
- sCallbackName (str) – callback name (a string)
- bValue (bool) – true to enable the callback, false to disable it
Returns: output (bool) – true if callback subscription existed, false otherwise
-
setExclusiveToContext(pluginInstance=None)
-
setGeometryDirty() Calls for a setDirty with the flag OrsGeometryDirty
-
setHighlightDirty() Calls for a setDirty with the flag OrsHighlightDirty
-
setIdentityIsPreservedForPickling(self, value: bool) → None Set to True if the GUID is to be preserved when pickling and unpickling an object.
Parameters: value (bool) –
-
setIsNotDirty(self) → None Sets the object as not being dirty for all dirty flags.
-
setIsRepresentable(self, isRepresentable: bool) → None Sets the object to be representable or not.
Note
Non representable objects don’t appear in lists and such, the implicit meaning is that these objects are transient and temporary.
Parameters: isRepresentable (bool) – true to make the object representable, false otherwise
-
setIsToBeKeptAliveUntilExit(self, pFlag: bool) → None Sets the object to be permanent for the life of the application.
Note
Permanent objects survive a new session, i.e. they live until the application is terminated.
Parameters: pFlag (bool) – true to make the object permanent, false otherwise
-
setIsToBeSaved(self, pIsToBeSaved: bool) → None Sets the object to be saved to session files or not.
Parameters: pIsToBeSaved (bool) – true to cause the object to be saved to session files, false otherwise
-
setPrivateTitle(self, newPrivateTitle: str) → None Sets the private title of the object.
Note
The private title can later be used to find a reference to that object, given that it’s still alive.
Parameters: newPrivateTitle (str) – a title (a string)
-
setPropertyDirty() Calls for a setDirty with the flag OrsPropertyDirty
-
setPublicInAllContexts()
-
setTitle(self, newVal: str) → None Sets the title of the object.
Parameters: newVal (str) –
-
setUserInfo(self, pTag: str, pValue: str) → None Sets a user defined value.
Note
Stores the key/value pair in an internal dictionary. If the key already exists its previous value is overwritten.
Parameters: - pTag (str) – a key name (a string)
- pValue (str) – a value (a string)
-
setUserInfoPickledObject(name: str, picklable_object)
-
setVisibilityDirty() Calls for a setDirty with the flag OrsVisibilityDirty
-
switchAvailabilityToContext(oldContextID, newContextID) Switches the availability of the object from an old context to a new context. This will be done only if the old context ID is found in the set of available contexts and the new context ID is not already in the set of available contexts. The availability for all other contexts remains unchanged.
The arguments oldContextID and newContextID are used as strings instead of plugin instances to support the situation where the old or new context is not existing (for example, to perform a copy of the objects).
Parameters: - oldContextID (str) – old context ID
- newContextID (str) – new context ID
-
triggerClassEvent(self, sEventName: str) → bool Triggers a class event.
Parameters: sEventName (str) – Returns: output (bool) –
-
unpublish() Sets an object as non-representable and notifies the Dragonfly UI of a loss of the availability of the object.
-
unselect(contextInstance) Unselects the instance for a context
Parameters: contextInstance (plugin instance) – context instance
-
ORSBaseClass¶
-
class
ORSModel.ors.ORSBaseClass brief_description: An abstract class from which all objects issued from the author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
getPythonTraceBack() → typing.List[str] Set the python traceback for a call from python.
Returns: output (typing.List[str]) –
-
isManaged(self) → bool Returns: output (bool) –
-
isNone(self) → bool Returns: output (bool) –
-
setPythonTraceBack(tb: ORSModel.ors.typing.List[str]) → None Set the python traceback for a call from python.
Parameters: tb (typing.List[str]) –
-