MultiROI¶
Inheritance diagram¶
Classes¶
MultiROI¶
-
class
ORSModel.ors.MultiROI¶ Bases:
ORSModel.ors.StructuredGridbrief_description: Container for multiple ROIs. author: Normand Mongeau. All other members of ORS participated. version: 1.0 date: February 2010
-
addToVolumeROI(self, pOutputROI: ORSModel.ors.ROI, pLabel: int) → None¶ Adds all the voxels associated to a label to a VolumeROI.
Note
The ROI is not cleared prior to adding.
Parameters: - pOutputROI (ORSModel.ors.ROI) – the output Volume ROI (a ROI)
- pLabel (int) – the label to extract (a uint32_t)
-
addToVolumeROILabelAtIndex(self, pOutputROI: ORSModel.ors.ROI, pIndex: int) → None¶ Finds the label at a given index, then extracts the label data and adds it to a VolumeROI.
Parameters: - pOutputROI (ORSModel.ors.ROI) – the output Volume ROI (an ROI)
- pIndex (int) – the index (a int64_t)
-
addToVolumeROILabelAtPosition(self, pOutputROI: ORSModel.ors.ROI, tIndex: int, pVector: ORSModel.ors.Vector3) → None¶ Finds the label at a given position, then extracts the label data and adds it to a VolumeROI.
Parameters: - pOutputROI (ORSModel.ors.ROI) – the output Volume ROI (an ROI)
- tIndex (int) – the T value (a uint32_t)
- pVector (ORSModel.ors.Vector3) – the position (an Vector3)
-
addVolumeROIToLabel(self, aLabel: int, pROI: ORSModel.ors.ROI) → bool¶ Parameters: - aLabel (int) –
- pROI (ORSModel.ors.ROI) –
Returns: output (bool) –
-
appendMultiROI(self, pLabeledMultiROI: ORSModel.ors.MultiROI, pLabelArray: ORSModel.ors.ArrayUnsignedLong) → None¶ Parameters: - pLabeledMultiROI (ORSModel.ors.MultiROI) –
- pLabelArray (ORSModel.ors.ArrayUnsignedLong) –
-
clear(self) → None¶ Clears the entire data.
-
clearLabel(self, pLabel: int) → None¶ Clears a label.
Parameters: pLabel (int) – the label to clear (a uint32_t)
-
clearLabels(self, pLabelArray: ORSModel.ors.ArrayUnsignedLong) → None¶ Clears a set of labels.
Parameters: pLabelArray (ORSModel.ors.ArrayUnsignedLong) – an array of labels to clear (an ArrayUnsignedLong)
-
copyInto(self, aMultiROI: ORSModel.ors.MultiROI) → None¶ Copies the receiver into anotherROI.
Parameters: aMultiROI (ORSModel.ors.MultiROI) – a destination multiROI (an MultiROI)
-
fromChannel(self, pChan: ORSModel.ors.Channel) → None¶ Parameters: pChan (ORSModel.ors.Channel) –
-
generateAnalyzer(self, inputChannel: ORSModel.ors.Channel, pROI: ORSModel.ors.ROI, aTimeStep: int, pStats: int, pCompute2DStats: bool, IProgress: ORSModel.ors.Progress) → MultiROIAnalyzer¶ Parameters: - inputChannel (ORSModel.ors.Channel) –
- pROI (ORSModel.ors.ROI) –
- aTimeStep (int) –
- pStats (int) –
- pCompute2DStats (bool) –
- IProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.MultiROIAnalyzer) –
-
getAsArray(self, tIndex: int, pOutputArray: ORSModel.ors.ArrayUnsignedLong) → ArrayUnsignedLong¶ Extracts the labels and adds them all to anArray.
Note
If an output Array is supplied, data is written to it and returned, otherwise a new Array is created.
Note
The Array is cleared prior to adding.
Parameters: - tIndex (int) – time index (a uint32_t)
- pOutputArray (ORSModel.ors.ArrayUnsignedLong) – an optional output Array (an ArrayUnsignedLong)
Returns: output (ORSModel.ors.ArrayUnsignedLong) – the resulting Array (an ArrayUnsignedLong)
-
getAsChannelWithLabelOffset(self, labelOffset: int, pOutputChannel: ORSModel.ors.Channel) → Channel¶ Extracts the labels and adds them all to a channel.
Note
If an output channel is supplied, data is written to it and returned, otherwise a new channel is created.
Note
The channel’s data type is determined by the total number of labels within:
Parameters: - labelOffset (int) – a label offset to add to output channel values (a uint32_t)
- pOutputChannel (ORSModel.ors.Channel) – an optional output channel (an Channel)
Returns: output (ORSModel.ors.Channel) – the resulting channel (an Channel)
-
getAsCubicMesh(self, bWorld: bool, IProgress: ORSModel.ors.Progress, IInMesh: ORSModel.ors.Mesh) → Mesh¶ Parameters: - bWorld (bool) –
- IProgress (ORSModel.ors.Progress) –
- IInMesh (ORSModel.ors.Mesh) –
Returns: output (ORSModel.ors.Mesh) –
-
getAsCubicMeshSubset(self, IEnabledLabel: ORSModel.ors.ArrayChar, bWorld: bool, IProgress: ORSModel.ors.Progress, IInMesh: ORSModel.ors.Mesh) → Mesh¶ Parameters: - IEnabledLabel (ORSModel.ors.ArrayChar) –
- bWorld (bool) –
- IProgress (ORSModel.ors.Progress) –
- IInMesh (ORSModel.ors.Mesh) –
Returns: output (ORSModel.ors.Mesh) –
-
getAsGraph(self, optionalInputGraph: ORSModel.ors.Graph, IProgress: ORSModel.ors.Progress) → Graph¶ Computes the graph of theMultiROI’s connectivity.
Parameters: - optionalInputGraph (ORSModel.ors.Graph) – an optional input graph to modify (a Graph)
- IProgress (ORSModel.ors.Progress) – a progress object (a Progress)
Returns: output (ORSModel.ors.Graph) – graph of the MultiROI’s connectivity
-
getBoundingBoxOfLabel(self, pTIndex: int, iLabel: int) → Box¶ Parameters: - pTIndex (int) –
- iLabel (int) –
Returns: output (ORSModel.ors.Box) –
-
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
-
getCurrentScalarValuesSlot(self) → int¶ gets the current scalar value slot index.
Note
The scalar index is zero-based, and thus should be less than getScalarValuesSlotCount().
Returns: output (int) – the scalar slot index (a uint16_t)
-
getFeretBox(iTIndex, iAngleSampling=5)¶ Gets Feret box of a MultiROI
Note
Default value for angle sampling is 5
Parameters: - iTIndex (int) – the T index
- iAngleSampling (int) – the angle sampling, steps between each angle iteration
Returns: output (ORSModel.ors.Box) – Feret box
-
getHideOutOfRangeScalarValues(self) → bool¶ Indicate if out of range values should be hidden.
Returns: output (bool) – (a bool)
-
getIntersectionWithLabeledMultiROI(self, pInputLabeledMultiROI: ORSModel.ors.MultiROI, anOutputLabeledMultiROI: ORSModel.ors.MultiROI) → MultiROI¶ Intersects theMultiROI with another MultiROI.
Note
If a target MultiROI is supplied, data is written to it and returned, otherwise a new MultiROI is created.
Parameters: - pInputLabeledMultiROI (ORSModel.ors.MultiROI) – the MultiROI to intersect with (a MultiROI)
- anOutputLabeledMultiROI (ORSModel.ors.MultiROI) – the output MultiROI (a MultiROI), see note below
Returns: output (ORSModel.ors.MultiROI) – the intersection result
-
getIntersectionWithROI(self, aROI: ORSModel.ors.ROI, anOutputMultiROI: ORSModel.ors.MultiROI) → MultiROI¶ Intersects theMultiROI with a ROI.
Note
If a target MultiROI is supplied, data is written to it and returned, otherwise a new MultiROI is created.
Parameters: - aROI (ORSModel.ors.ROI) – the ROI to intersect with (an ROI)
- anOutputMultiROI (ORSModel.ors.MultiROI) – the output MultiROI (a MultiROI), see note below
Returns: output (ORSModel.ors.MultiROI) – the intersection result
-
getIsClipped(timestep=0, display=None)¶ Gets to know if the clip box of the ROI or MultiROI is active
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¶ Verifies to see if all labels are empty or not.
Returns: output (bool) – TRUE if no labels within, FALSE otherwise
-
getLabelAtIndex(self, pIndex: int) → int¶ Gets the label value at a given index.
Note
If no label exists at the given index 0 is returned.
Parameters: pIndex (int) – the index (a int64_t) Returns: output (int) – the resulting label (a uint32_t)
-
getLabelAtPosition(self, tIndex: int, pVector: ORSModel.ors.Vector3) → int¶ Gets the label value at a given World position.
Note
If no label exists at the given position, 0 is returned.
Parameters: - tIndex (int) – the T value (a uint32_t)
- pVector (ORSModel.ors.Vector3) – the position (an Vector3)
Returns: output (int) – the resulting label (a uint32_t)
-
getLabelColor(self, label: int) → Color¶ Parameters: label (int) – Returns: output (ORSModel.ors.Color) –
-
getLabelCount(self) → int¶ Gets the number of distinct labels within.
Returns: output (int) – the number of labels (a uint32_t)
-
getLabelSize(self, pLabel: int) → int¶ Gets the size of a given label.
Parameters: pLabel (int) – the label value (a uint32_t) Returns: output (int) – the size of the label (an int64_t)
-
getMergedLabelsIntersectingMultiROI(self, pInputMROI: ORSModel.ors.MultiROI) → MultiROI¶ Parameters: pInputMROI (ORSModel.ors.MultiROI) – Returns: output (ORSModel.ors.MultiROI) –
-
getMergedLabelsIntersectingROI(self, inputROI: ORSModel.ors.ROI) → MultiROI¶ Parameters: inputROI (ORSModel.ors.ROI) – Returns: output (ORSModel.ors.MultiROI) –
-
getMinimalBox(self, iTIndex: int) → Box¶ Get miminal box (also know as Oriented BoundingBox in litterature)
Parameters: iTIndex (int) – the T index (a uint32_t) Returns: output (Box) –
-
getNonEmptyLabelCount(self) → int¶ Gets the number of distinct labels within.
Returns: output (int) – the number of non empty labels (a uint32_t)
-
getNonEmptyLabels(self, pOutputArray: ORSModel.ors.ArrayUnsignedLong) → ArrayUnsignedLong¶ Returns an array of all non empty labels.
Note
If an output array is supplied, data is written to it and returned, otherwise a new array is created.
Note
The array is cleared prior to adding.
Parameters: pOutputArray (ORSModel.ors.ArrayUnsignedLong) – an optional output array (an ArrayUnsignedLong) Returns: output (ORSModel.ors.ArrayUnsignedLong) – the resulting array (an ArrayUnsignedLong)
-
getProjectionIn(self, aLabeledMultiROI: ORSModel.ors.MultiROI, sourceTimeOffset: int, pProgress: ORSModel.ors.Progress) → MultiROI¶ Parameters: - aLabeledMultiROI (ORSModel.ors.MultiROI) –
- sourceTimeOffset (int) –
- pProgress (ORSModel.ors.Progress) –
Returns: output (ORSModel.ors.MultiROI) –
-
getScalarValueDescription(self, nScalarValueSlotIndex: int, iTIndex: int) → str¶ Gets a scalar description value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (str) – the scalar description value (a std::wstring)
-
getScalarValueId(self, nScalarValueSlotIndex: int, iTIndex: int) → str¶ Gets a scalar id value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (str) – the scalar id value (a std::wstring)
-
getScalarValueMax(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Gets a scalar max value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar max value (a float)
-
getScalarValueMin(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Gets a scalar min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar min value (a float)
-
getScalarValueOffset(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Gets a scalar offset value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar offset value (a float)
-
getScalarValueSlope(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Get a scalar slope value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar slope value (a float)
-
getScalarValueSlotLookUpTable(self, nScalarValueSlotIndex: int, iTIndex: int) → dict¶ Parameters: - nScalarValueSlotIndex (int) –
- iTIndex (int) –
Returns: output (dict) –
-
getScalarValueUnit(self, nScalarValueSlotIndex: int, iTIndex: int) → int¶ Gets a scalar value unit.
Parameters: - nScalarValueSlotIndex (int) – scalar slot index (a uint16_t)
- iTIndex (int) – time step (a uint32_t)
Returns: output (int) – the scalar value unit (an uint16_t)
-
getScalarValues(self, nScalarValueSlotIndex: int, iTIndex: int) → Array¶ Gets the values of a scalar.
Note
The scalar value in the slot s of the v is located at the index (getScalarValuesSlotCount() * v) + s of the array.
Parameters: - nScalarValueSlotIndex (int) – the time step (a uint32_t)
- iTIndex (int) –
Returns: output (ORSModel.ors.Array) – an array of values (an Array)
-
getScalarValuesAsPandaDataFrame(iTIndex=0)¶
-
getScalarValuesDatatype(self, nScalarValueSlotIndex: int, iTIndex: int) → int¶ Parameters: - nScalarValueSlotIndex (int) –
- iTIndex (int) –
Returns: output (int) –
-
getScalarValuesId(self, nScalarValueSlotIndex: int, iTIndex: int) → str¶ Gets the scalar slot id from a scalar values slot.
Parameters: - nScalarValueSlotIndex (int) – the index of the slot (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (str) –
-
getScalarValuesRangeBoundaryMax(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Get a scalar range max boundary value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – a double
-
getScalarValuesRangeBoundaryMin(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Get a scalar range min boundary value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – a double
-
getScalarValuesRangeMax(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Get a scalar range max value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot indexuint16_t(a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – a double
-
getScalarValuesRangeMin(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Get a scalar range min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – a double
-
getScalarValuesSlotCount(self) → int¶ Gets the number of slots for scalar values.
Returns: output (int) – the number of slots (a uint16_t)
-
getScalarValuesWindowMax(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Gets a scalar window max value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar max value (a float)
-
getScalarValuesWindowMin(self, nScalarValueSlotIndex: int, iTIndex: int) → float¶ Gets a scalar window min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the time step (a uint32_t)
Returns: output (float) – the scalar min value (a float)
-
getTotalVoxelCount(self) → int¶ Gets the total size of all labels.
Returns: output (int) – the total size (a int64_t)
-
getUseScalarValues(self) → bool¶ Returns: output (bool) –
-
getVoxelCount(self, iTIndex: int) → int¶ Gets the size of all labels for a given T value.
Parameters: iTIndex (int) – Returns: output (int) – the number of voxels in the MultiROI (a int64_t)
-
grid(self, celXSize: int, celYSize: int, celZSize: int, minT: int, maxT: int) → None¶ Parameters: - celXSize (int) –
- celYSize (int) –
- celZSize (int) –
- minT (int) –
- maxT (int) –
-
classmethod
imread(files)¶ Loads a MultiROI from files
Parameters: files (file) [count=[0, None]] – fully qualified file name list Returns: outMultiROI (ORSModel.ors.MultiROI) – the resulting MultiROI
-
classmethod
imreadDICOM(files)¶ Loads a MultiROI from files or folder contaning DICOM
Parameters: files (file) [count=[0, None]] – fully qualified file name list Returns: outMultiROI (ORSModel.ors.MultiROI) – the resulting MultiROI
-
classmethod
imreadDICOMFolder(folder)¶ Loads a MultiROI from folder of DICOM files
Parameters: folder (folder) – fully qualified folder Returns: outMultiROI (ORSModel.ors.MultiROI) – the resulting MultiROI
-
classmethod
imreadFolder(folder)¶ Loads a MultiROI from folder
Parameters: folder (folder) – fully qualified folder Returns: outMultiROI (ORSModel.ors.MultiROI) – the resulting MultiROI
-
imsave(fileName)¶ Save a MultiROI to file in the type specified by the extension
Parameters: fileName (file saving) – fully qualified file name Return: True or False Rtype: bool
-
imwrite(fileName)¶ Save a MultiROI to file in the type specified by the extension
Parameters: fileName (file saving) – fully qualified file name Return: True or False Rtype: bool
-
insertLabeledMultiROI(self, pLabeledMultiROI: ORSModel.ors.MultiROI, insertionLabel: int) → bool¶ Insert all the labels of aMultiROI starting at an insertion label.
Parameters: - pLabeledMultiROI (ORSModel.ors.MultiROI) – the MultiROI to insert (a MultiROI)
- insertionLabel (int) – the label at which the insertion begins (a uint32_t)
Returns: output (bool) – true if the operation succeeded, false otherwise
-
mapLabelsToColors(self, anILUT: ORSModel.ors.LookupTable) → None¶ Parameters: anILUT (ORSModel.ors.LookupTable) –
-
mapLabelsToDiscreteColors(self, anILUT: ORSModel.ors.LookupTable) → None¶ Parameters: anILUT (ORSModel.ors.LookupTable) –
-
mapScalarValuesToColors(self, pData: ORSModel.ors.Array, pHightlightOpacityValue: ORSModel.ors.ArrayFloat, pLMROpacityValue: ORSModel.ors.ArrayFloat, fMinDisplayableValue: float, fMaxDisplayableValue: float, anILUT: ORSModel.ors.LookupTable) → None¶ Parameters: - pData (ORSModel.ors.Array) –
- pHightlightOpacityValue (ORSModel.ors.ArrayFloat) –
- pLMROpacityValue (ORSModel.ors.ArrayFloat) –
- fMinDisplayableValue (float) –
- fMaxDisplayableValue (float) –
- anILUT (ORSModel.ors.LookupTable) –
-
mapScalarValuesToColorsWithRange(self, pData: ORSModel.ors.Array, fMinDisplayableValue: float, fMaxDisplayableValue: float, fMinSelectionRangeValue: float, fMaxSelectionRangeValue: float, hideOutOfRangeValues: bool, anILUT: ORSModel.ors.LookupTable) → None¶ ComputeMultiROI color table using scalar value.
Parameters: - pData (ORSModel.ors.Array) – the scalar value to use (an Array)
- fMinDisplayableValue (float) – the minimum value used for the LUT range (a double)
- fMaxDisplayableValue (float) – the maximum value used for the LUT range (a double)
- fMinSelectionRangeValue (float) – the minimum range value (a double)
- fMaxSelectionRangeValue (float) – the maximum range value (a double)
- hideOutOfRangeValues (bool) – indicate if the out of range value should be displayed (a bool)
- anILUT (ORSModel.ors.LookupTable) – the LookUpTable (a LookupTable)
-
mapScalarValuesToDiscreteColors(self, pData: ORSModel.ors.Array, pHightlightOpacityValue: ORSModel.ors.ArrayFloat, pLMROpacityValue: ORSModel.ors.ArrayFloat, nMinDisplayableValue: float, nMaxDisplayableValue: float, anILUT: ORSModel.ors.LookupTable) → None¶ Parameters: - pData (ORSModel.ors.Array) –
- pHightlightOpacityValue (ORSModel.ors.ArrayFloat) –
- pLMROpacityValue (ORSModel.ors.ArrayFloat) –
- nMinDisplayableValue (float) –
- nMaxDisplayableValue (float) –
- anILUT (ORSModel.ors.LookupTable) –
-
mergeLabels(self, targetLabel: int, sourceLabel: int) → bool¶ Merge a label into another one.
Parameters: - targetLabel (int) – the receiving label (a uint32_t)
- sourceLabel (int) – the source label (a uint32_t)
Returns: output (bool) – true if the operation succeeded, false otherwise
-
mergeLabelsIntersectingMultiROI(self, pInputMROI: ORSModel.ors.MultiROI) → bool¶ assign the label of all intersecting labels to the smallest label intersecting, per label
Parameters: pInputMROI (ORSModel.ors.MultiROI) – Returns: output (bool) – return true if labels where collapse
-
mergeLabelsIntersectingROI(self, pInputROI: ORSModel.ors.ROI) → bool¶ assign the label of all intersecting labels to the smallest label intersecting
Parameters: pInputROI (ORSModel.ors.ROI) – Returns: output (bool) – return true if labels where collapse
-
none()¶ MultiROI.__init__() -> MultiROI
-
removeAScalarValuesSlot(self, nScalarValueSlotIndex: int, iTIndex: int) → None¶ Remove a scalar values slot from aMultiROI.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the T value (a uint32_t)
-
removeEmptyLabelsAndRenumber(self) → None¶ Removes all empty labels and renumber the remaining labels in the same order.
-
removeFromVolumeROI(self, pOutputROI: ORSModel.ors.ROI, pLabel: int) → None¶ Remove all the voxels associated to a label from a VolumeROI.
Parameters: - pOutputROI (ORSModel.ors.ROI) – the output Volume ROI (an ROI)
- pLabel (int) – the label to extract (a uint32_t)
-
removeLabelAndRenumber(self, pLabel: int) → None¶ Removes the specified label and renumber the remaining labels in the same order.
Parameters: pLabel (int) – the label to remove (a uint32_t)
-
removeLabelIntersectingROI(self, pInputROI: ORSModel.ors.ROI) → bool¶ Remove label that are intersecting the givenROI.
Parameters: pInputROI (ORSModel.ors.ROI) – Returns: output (bool) – return true if label where removed (a bool)
-
removeLabelNotIntersectingROI(self, pInputROI: ORSModel.ors.ROI) → bool¶ Remove label that are not intersecting the givenROI.
Parameters: pInputROI (ORSModel.ors.ROI) – Returns: output (bool) – return true if label where removed (a bool)
-
removeLabeledMultiROI(self, pInputLabeledMultiROI: ORSModel.ors.MultiROI) → None¶ Removes aMultiROI.
Parameters: pInputLabeledMultiROI (ORSModel.ors.MultiROI) – the MultiROI to remove (a MultiROI)
-
removeLabelsAndRenumber(self, pLabelArray: ORSModel.ors.ArrayUnsignedLong) → None¶ Removes the specified labels and renumber the remaining labels in the same order.
Parameters: pLabelArray (ORSModel.ors.ArrayUnsignedLong) – an array of labels to remove (an ArrayUnsignedLong)
-
removeVolumeROI(self, pInputROI: ORSModel.ors.ROI) → None¶ Removes a VolumeROI.
Parameters: pInputROI (ORSModel.ors.ROI) – the Volume ROI to remove (an ROI)
-
removeVolumeROIFromLabel(self, aLabel: int, pROI: ORSModel.ors.ROI) → bool¶ Parameters: - aLabel (int) –
- pROI (ORSModel.ors.ROI) –
Returns: output (bool) –
-
setCurrentScalarValuesSlot(self, nScalarValueSlotIndex: int) → None¶ Sets the current scalar.
Note
The scalar index is zero-based, and thus should be less than getScalarValuesSlotCount().
Parameters: nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
-
setHideOutOfRangeScalarValues(self, value: bool) → None¶ Indicate if out of range values should be hidden.
Parameters: value (bool) –
-
setLabelColor(self, label: int, IColor: ORSModel.ors.Color) → None¶ Parameters: - label (int) –
- IColor (ORSModel.ors.Color) –
-
setLabelCount(self, aCount: int) → None¶ Sets the label count.
Parameters: aCount (int) – the label count to set (a uint32_t)
-
setScalarValueDescription(self, nScalarValueSlotIndex: int, sDesc: str, iTIndex: int) → None¶ Sets a face scalar description value.
Parameters: - nScalarValueSlotIndex (int) – scalar slot index (a uint16_t)
- sDesc (str) – scalar description value (a std::wstring)
- iTIndex (int) – time step (a uint32_t)
-
setScalarValueMax(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Sets a scalar max value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the scalar max value (a float)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValueMin(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Sets a scalar min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the scalar min value (a float)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValueOffset(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Sets a scalar offset value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the scalar offset value (a float)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValueSlope(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Set a scalar slope value.
Parameters: - nScalarValueSlotIndex (int) – scalar slot index (a uint16_t)
- value (float) – scalar slope value (a float)
- iTIndex (int) – time step (a uint32_t)
-
setScalarValueSlotLookUpTable(self, lookUpTable: dict, nScalarValueSlotIndex: int, iTIndex: int) → None¶ Parameters: - lookUpTable (dict) –
- nScalarValueSlotIndex (int) –
- iTIndex (int) –
-
setScalarValueUnit(self, nScalarValueSlotIndex: int, iUnit: int, iTIndex: int) → None¶ Sets a scalar unit value.
Parameters: - nScalarValueSlotIndex (int) – scalar slot index (a uint16_t)
- iUnit (int) – iUnit (a uint16_t)
- iTIndex (int) – time step (a uint32_t)
-
setScalarValues(self, pScalarValues: ORSModel.ors.Array, nScalarValueSlotIndex: int, iTIndex: int) → None¶ Sets the values of a scalar.
Parameters: - pScalarValues (ORSModel.ors.Array) – an array of values (example an ArrayFloat)
- nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- iTIndex (int) – the the time step (a uint32_t)
-
setScalarValuesDatatype(self, iSlotIndex: int, iTIndex: int, nFaceScalarValuesDatatype: int) → None¶ Parameters: - iSlotIndex (int) –
- iTIndex (int) –
- nFaceScalarValuesDatatype (int) –
-
setScalarValuesFromPandaDataFrame(dataFrame, iTIndex=0)¶
-
setScalarValuesRangeBoundaryMax(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Set a scalar range max boundary value.
Parameters: - nScalarValueSlotIndex (int) – the slot index (a uint16_t)
- value (float) – the value (a double)
- iTIndex (int) – the time step(a uint32_t)
-
setScalarValuesRangeBoundaryMin(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Set a scalar range min boundary value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the value (a double)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValuesRangeMax(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Set a scalar range max value.
Parameters: - nScalarValueSlotIndex (int) – the slot index (a uint16_t)
- value (float) – the value (a double)
- iTIndex (int) – the time step(a uint32_t)
-
setScalarValuesRangeMin(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Set a scalar range min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (auint16_t)
- value (float) – the value (a double)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValuesSlotCount(self, nScalarValueSlotCount: int) → None¶ Sets the number of slots for scalar values.
Parameters: nScalarValueSlotCount (int) – the number of slots (a uint16_t)
-
setScalarValuesWindowMax(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Sets a scalar window max value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the scalar max value (a float)
- iTIndex (int) – the time step (a uint32_t)
-
setScalarValuesWindowMin(self, nScalarValueSlotIndex: int, value: float, iTIndex: int) → None¶ Sets a scalar window min value.
Parameters: - nScalarValueSlotIndex (int) – the scalar slot index (a uint16_t)
- value (float) – the scalar min value (a float)
- iTIndex (int) – the time step (a uint32_t)
-
sortAndRenumberLabelsOnSize(self, bAscending: bool, bRemoveEmptyLabels: bool) → None¶ Sorts and renumbers the labels based on their sizes (number of labels).
Parameters: - bAscending (bool) – TRUE to sort in ascending order, FALSE to sort in descending order
- bRemoveEmptyLabels (bool) – TRUE to remove empty labels, FALSE to keep them
-
updateUndo()¶
-
StructuredGrid¶
-
class
ORSModel.ors.StructuredGrid Bases:
ORSModel.ors.Node-
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)
-
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) –
-
getIsIdenticalTo(self, pStructuredGrid: ORSModel.ors.StructuredGrid) → bool Verifies if the structured grid is identical to another structured grid (see note below).
Note
Comparison of shape and data.
Parameters: pStructuredGrid (ORSModel.ors.StructuredGrid) – a comparison structured grid (a StructuredGrid) Returns: output (bool) – TRUE if the comparison structured grid has the same shape and data as receiver structured grid, FALSE otherwise
-
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) –
-
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) –
-
getVoxelToWorldCoordinates(self, anIndex: ORSModel.ors.Vector3) → Vector3 Gets a given voxel’s location in DICOM Reference Coordinates System.
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.__init__() -> 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) –
-
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) –
-
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) –
-
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)
-
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
-
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
-
attachChildAtPosition(self, anINode: ORSModel.ors.Node, position: int) → bool Attaches a child node at a given position.
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)
- position (int) – the position 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
-
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
-
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
-
getMaxTSize(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)
-
none() Node.__init__() -> Node
-
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.
-
refreshAll3DParentViews(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed.
-
refreshAllParentViews(self) → None Causes all views in the parent hierarchy of the node to be refreshed.
-
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: The “mother” of all 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)
-
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)
-
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
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
-
getCanBeDeleted(self) → bool Queries the object to know if it can safely be deleted.
Returns: output (bool) –
-
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
-
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 uint32_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
-
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
-
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
-
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)
-
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
-
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)
-
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)
-
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.__init__() -> 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(self, sEventName: str, sCallbackName: str) → bool Removes a callback subscription to an event.
Parameters: - sEventName (str) – name of the callback event (a string)
- sCallbackName (str) – name of the callback (a string)
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
-
setCanBeDeleted(self, bFlag: bool) → None Sets the object to be deletable or not.
Parameters: bFlag (bool) –
-
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
-
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
-
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)
-
setVisibilityDirty() Calls for a setDirty with the flag OrsVisibilityDirty
-
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 -
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]) –
-