Channel

Inheritance diagram

Inheritance diagram of ORSModel.ors.Channel, ORSModel.ors.StructuredGrid, ORSModel.ors.Node, ORSModel.ors.Managed, ORSModel.ors.ORSBaseClass

Classes

Channel

class ORSModel.ors.Channel

Bases: ORSModel.ors.StructuredGrid

brief_description: A container for channel data. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005 see: CxvChannel_Description, CxvChannel_Data_Type This is used as a channel data container. Channels are used as 4D data containers, that have a depth, a description, a type, and some spacing for representation. Depth value is directly related to the channel type. To create a channel the XYZT sizes and type must be set before initializing the channel data. The channel must be initialized before the data array is set.

addGaussianNoise(std, mean=0)

Add gaussian noise to the channel

Parameters:
  • std (float) – standard deviation
  • mean (float) – mean of the gaussian distribution
addSlice(self, pSliceData: ORSModel.ors.Array) → None

Adds a slice of data to the channel.

Note

The array should be of similar channel type (ArrayUnsignedChar, ArrayUnsignedShort, ArrayUnsignedInt or ArrayFloat).

Note

It is assumed that the slice added is of same shape as the existing slices within the channel.

Note

The slice data is copied to the channel. You are responsible for releasing the array.

Parameters:pSliceData (ORSModel.ors.Array) – the slice data (an Array), see note below
addSuggestedWindowLevelValues(self, pWidth: float, pCenter: float) → None

Adds a pair of suggested window width and center values (for leveling).

Note

The window width should be >= 1.

Note

The suggested leveling values are only used to present suitable values to end users.

Parameters:
  • pWidth (float) – a window width (a double)
  • pCenter (float) – a window center (a double)
apply2DAffinePixelWise(self, offsetX: float, offsetY: float, xx: float, xy: float, yx: float, yy: float, mode: int, outputChannel: ORSModel.ors.Channel) → Channel

Copies a slice to another.

Note

If any index is invalid no copy occurs.

Parameters:
  • offsetX (float) – T source index (an uint32_t)
  • offsetY (float) – Z source index (an uint32_t)
  • xx (float) – T target index (an uint32_t)
  • xy (float) – Z target index (an uint32_t)
  • yx (float) –
  • yy (float) –
  • mode (int) –
  • outputChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) –

apply2DFlip(self, flipX: bool, flipY: bool, outputChannel: ORSModel.ors.Channel) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

applyLevelingAndGammaTransformationToData(self, minValue: float, maxValue: float, gamma: float) → None
Parameters:
  • minValue (float) –
  • maxValue (float) –
  • gamma (float) –
applyLevelingTransformationToData(self, minValue: float, maxValue: float) → None
Parameters:
  • minValue (float) –
  • maxValue (float) –
applyLinearTransformationToData(self, slope: float, offset: float) → None
Parameters:
  • slope (float) –
  • offset (float) –
convertToType(self, datatype: int, bNormalize: bool, iLowNormalizationRange: float, iHighNormalizationRange: float, bFilter: bool, iLowFilterRange: float, iHighFilterRange: float, iReplacementValue: float, outputChannel: ORSModel.ors.Channel, IProgress: ORSModel.ors.Progress) → Channel

Converts the data type of the receiver.

Note

The first argument should be one of CxvChannel_Data_Type (see ors_def.h for valid values).

Parameters:
  • datatype (int) – the target data type (a uint16_t, see note below)
  • bNormalize (bool) – true to normalize the output
  • iLowNormalizationRange (float) – lower bound of normalization range (a double)
  • iHighNormalizationRange (float) – higher bound of normalization range (a double)
  • bFilter (bool) – true to filter the output
  • iLowFilterRange (float) – lower bound of filter range (a double)
  • iHighFilterRange (float) – higher bound of filter range (a double)
  • iReplacementValue (float) – replacement value for the filter (a double)
  • outputChannel (ORSModel.ors.Channel) – optional output channel. if none, a new channel will be created (a Channel). output channel must have the number of voxels as the input channel and must have the same datatype aas the target type.
  • IProgress (ORSModel.ors.Progress) – a progress object, NULL for no progress (an Progress)
Returns:

output (ORSModel.ors.Channel) – a new converted channel (a Channel)

copyDICOMAttributesFrom(self, pInputChannel: ORSModel.ors.Channel, bCopyPrivateAttributes: bool) → None

Copies the DICOM attributes from another channel.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the source channel (a Channel)
  • bCopyPrivateAttributes (bool) – true to copy also private attributes, false to exclude them
copyDICOMDatasetForSlice(self, pInputChannel: ORSModel.ors.Channel, iTSource: int, iZSource: int, iTTarget: int, iZTarget: int) → None

Copies the DICOM attributes of a given slice to another channel.

Note

If any index is invalid no copy occurs.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the destination channel (a Channel)
  • iTSource (int) – T source index (an uint32_t)
  • iZSource (int) – Z source index (an uint32_t)
  • iTTarget (int) – T target index (an uint32_t)
  • iZTarget (int) – Z target index (an uint32_t)
copyDataFromCommonRegionInto(self, pAChannel: ORSModel.ors.Channel, tOffset: int, filterMode: int, IProgress: ORSModel.ors.Progress, clearValue: bool) → None

Copies the data common with another channel into that channel.

Note

This method copies the data from the receiver into a supplied channel, for the area that is common to both channels. This area is computed based on the world coordinates of both channels.

Parameters:
  • pAChannel (ORSModel.ors.Channel) – the companion channel (a Channel)
  • tOffset (int) – the time step to use in the channel (a uint32_t)
  • filterMode (int) – a CxvFiltering_Mode (a uint16_t)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
  • clearValue (bool) – true to clear the companion channel before copying the channel (a boolean)
copyInto(self, aDestinationChannel: ORSModel.ors.Channel) → None

Copies the receiver channel into another channel.

Parameters:aDestinationChannel (ORSModel.ors.Channel) – a destination channel (a Channel)
copyShapeFromChannelSubset(self, pISourceChannel: ORSModel.ors.Channel, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int) → None

Initializes the channel’s shape based on a subset of another channel.

Note

Shape includes size, spacing, type, description, position and location.

Note

This method does not handle the channel data array.

Parameters:
  • pISourceChannel (ORSModel.ors.Channel) – a source channel (a Channel)
  • 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)
copySliceData(self, iTSource: int, iZSource: int, iTTarget: int, iZTarget: int) → None

Copies a slice to another.

Note

If any index is invalid no copy occurs.

Parameters:
  • iTSource (int) – T source index (an uint32_t)
  • iZSource (int) – Z source index (an uint32_t)
  • iTTarget (int) – T target index (an uint32_t)
  • iZTarget (int) – Z target index (an uint32_t)
dtype
emptySuggestedWindowLevelValues(self) → None

Cleans the suggested window leveling values.

classmethod fromNDArray(data, channelGUID='', ZAxis=True, TimeAxis=False) → ORSModel.ors.Channel
getAllSliceIntersectionLength(self, arrayOfIntersectionLengthPerSlice: float, timeStep: int) → float
Parameters:
  • arrayOfIntersectionLengthPerSlice (float) –
  • timeStep (int) –
Returns:

output (float) –

getAllSlicesHaveSameOrientation(self, pTIndex: int) → bool

Verifies if the channel is consistent in its slice orientations.

Note

Normally a channel has consistent slice orientations, but in some poorly formed DICOM datasets it can happen that slices do not have the same orientation. Those channels become of limited use.

Parameters:pTIndex (int) –
Returns:output (bool) – true if all slices have identical orientations, false otherwise
getAreAllZSlicesDataAvailable(self) → bool

Gets the availability of all the Z slices’ data.

Note

The channel can be set to work in “lazy” mode, where slices are made available as they are read.

Note

Use this method to know if the entire data has arrived, instead of querying each slice with getIsZSliceDataAvailable().

Returns:output (bool) – true if all the Z slices’ data is available, false otherwise
getAsAbsoluteDifferenceChannel(self, pCompareChannel: ORSModel.ors.Channel, pOutputChannel: ORSModel.ors.Channel, IProgress: ORSModel.ors.Progress) → None

Gets a channel of the same type as the receiver containing the absolute difference between the two.

Note

The provided channel serves as the reference grid and the receiver is linearly interpolated.

Parameters:
getAsChannelClosedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Creates a new channel which is the receiver dilated and afterward eroded with the provided kernel.

Parameters:
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelCrossSection(self, path: ORSModel.ors.VisualPath, iTIndex: int, aTransformationMatrix: ORSModel.ors.Matrix4x4, x: int, y: int, pInChannel: ORSModel.ors.Channel) → Channel

Samples the channel data for a given path.

Note

This method finds all the voxel data found along a path, and fills another channel with that data.

Note

The X and Y sizes define a box that will contain the data along the path.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • path (ORSModel.ors.VisualPath) – the path to sample (an VisualPath)
  • iTIndex (int) – an X size (an uint32_t), see note below
  • aTransformationMatrix (ORSModel.ors.Matrix4x4) – a Y size (an uint32_t), see note below
  • x (int) – The T index to be processed (an uint32_t)
  • y (int) – an optional output channel (a Channel)
  • pInChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelCurved(self, pIInputChannel: ORSModel.ors.Channel, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, forTimeStep: int, xAxisDirectionX: float, xAxisDirectionY: float, xAxisDirectionZ: float, xSize: int, ySize: int, xSpacing: float, bestYSizeAndSpacing: bool, bNearest: bool) → Channel
Parameters:
  • pIInputChannel (ORSModel.ors.Channel) –
  • path (ORSModel.ors.VisualPath) –
  • aTransformationMatrix (ORSModel.ors.Matrix4x4) –
  • forTimeStep (int) –
  • xAxisDirectionX (float) –
  • xAxisDirectionY (float) –
  • xAxisDirectionZ (float) –
  • xSize (int) –
  • ySize (int) –
  • xSpacing (float) –
  • bestYSizeAndSpacing (bool) –
  • bNearest (bool) –
Returns:

output (ORSModel.ors.Channel) –

getAsChannelCurvedProjected(self, pIInputChannel: ORSModel.ors.Channel, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, forTimeStep: int, upVect: ORSModel.ors.Vector3, rightVect: ORSModel.ors.Vector3, xSize: int, ySize: int, optimalXSizeAndSpacing: bool, optimalYSizeAndSpacing: bool, zSliceTickness: float, minProjection: bool, maxProjection: bool, averageProjection: bool, stretch: bool, bNearest: bool) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelCurvedProjectedRotational(self, pIInputChannel: ORSModel.ors.Channel, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, forTimeStep: int, upVect: ORSModel.ors.Vector3, rightVect: ORSModel.ors.Vector3, xSize: int, numberOfStep: int, bNearest: bool, IProgress: ORSModel.ors.Progress) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelCurvedRotational(self, pIInputChannel: ORSModel.ors.Channel, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, forTimeStep: int, normalX: float, normalY: float, normalZ: float, downX: float, downY: float, downZ: float, xSize: int, ySize: int, numberOfStep: int, xSpacing: float, bestYSizeAndSpacing: bool) → Channel
Parameters:
  • pIInputChannel (ORSModel.ors.Channel) –
  • path (ORSModel.ors.VisualPath) –
  • aTransformationMatrix (ORSModel.ors.Matrix4x4) –
  • forTimeStep (int) –
  • normalX (float) –
  • normalY (float) –
  • normalZ (float) –
  • downX (float) –
  • downY (float) –
  • downZ (float) –
  • xSize (int) –
  • ySize (int) –
  • numberOfStep (int) –
  • xSpacing (float) –
  • bestYSizeAndSpacing (bool) –
Returns:

output (ORSModel.ors.Channel) –

getAsChannelCutAlongZWithNormal(self, normal: ORSModel.ors.Vector3, timeStep: int, outXSizeInworld: float, nearest: bool, inputChannel: ORSModel.ors.Channel) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelCutAlongZWithNormalCurved(self, InputPath: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, normal: ORSModel.ors.Vector3, timeStep: int, outXSizeInworld: float, nearest: bool, inputChannel: ORSModel.ors.Channel) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelDilatedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Creates a new channel which is the receiver dilated with the provided kernel.

Note

the simple tone of gray dilatation is a convolution operation selecting the maximum value in the kernel

Parameters:
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelDilatedWithKernelInRange(self, pKernel: ORSModel.ors.ConvolutionKernel, zmin: int, zmax: int, zOffsetInputToOutput: int, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Computes the dilation of the input channel in a range of slices.

Note

If no channel is provided to put the result in, a new channel is created with the number of slices corresponding to the number of slices computed.

Note

When the output channel have the same characteristics as the input channel, the output channel is not re-initialized before writing in the result of the dilation of the desired slices.

Parameters:
  • pKernel (ORSModel.ors.ConvolutionKernel) – the dilatation kernel made of 0 or 1 (an ConvolutionKernel)
  • zmin (int) – the index of the first slice to compute the dilation on
  • zmax (int) – the index of the last slice to compute the dilation on
  • zOffsetInputToOutput (int) – the number of slices of offset (the dilation on the slice Z of the input channel will be written at the slice “Z-offset” in the output channel)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress), or NULL for no progress
  • pOutChannel (ORSModel.ors.Channel) – the channel to put the result in (cannot be the receiver) (a Channel)
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelEmptyCrossSection(self, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, x: int, y: int, z: int, timeStep: int, pInChannel: ORSModel.ors.Channel) → Channel

Samples the channel data for a given path.

Note

This method finds all the voxel data found along a path, and fills another channel with that data.

Note

The X and Y sizes define a box that will contain the data along the path.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • path (ORSModel.ors.VisualPath) – the path to sample (an VisualPath)
  • aTransformationMatrix (ORSModel.ors.Matrix4x4) – an X size (a uint32_t), see note below
  • x (int) – a Y size (a uint32_t), see note below
  • y (int) – true to have the channel contain the voxel indicies, false to contain the voxel themselves
  • z (int) – an optional output channel (a Channel)
  • timeStep (int) –
  • pInChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelErodedWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Creates a new channel which is the receiver eroded with the provided kernel.

Note

the simple tone of grey erosion is a convolution operation selecting the minimum value in the kernel

Parameters:
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelErodedWithKernelInRange(self, pKernel: ORSModel.ors.ConvolutionKernel, zmin: int, zmax: int, zOffsetInputToOutput: int, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Computes the erosion of the input channel in a range of slices.

Note

If no channel is provided to put the result in, a new channel is created with the number of slices corresponding to the number of slices computed.

Note

When the output channel have the same characteristics as the input channel, the output channel is not re-initialized before writing in the result of the erosion of the desired slices.

Parameters:
  • pKernel (ORSModel.ors.ConvolutionKernel) – the erosion kernel made of 0 or 1 (an ConvolutionKernel)
  • zmin (int) – the index of the first slice to compute the erosion on
  • zmax (int) – the index of the last slice to compute the erosion on
  • zOffsetInputToOutput (int) – the number of slices of offset (the erosion on the slice Z of the input channel will be written at the slice “Z-offset” in the output channel)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress), or NULL for no progress
  • pOutChannel (ORSModel.ors.Channel) – the channel to put the result in (cannot be the receiver) (a Channel)
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelFromMean(self, pBoxSize: int, pOutChannel: ORSModel.ors.Channel) → Channel

Finds the mean in a box surrounding each voxel and writes it to the channel.

Note

The box size needs to be an odd number.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • pBoxSize (int) – the box size (a uint16_t)
  • pOutChannel (ORSModel.ors.Channel) – an optional output channel (an ORSChannelPtr)
Returns:

output (ORSModel.ors.Channel) – the result channel (an ORSChannelPtr)

getAsChannelFromROI(self, pInputROI: ORSModel.ors.ROI, pOutChannel: ORSModel.ors.Channel) → Channel

Creates a new channel from a given Region of Interest.

Note

This method extracts the channel data matching the given Region of Interest into the resulting channel.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:

pInputROI (ORSModel.ors.ROI) – a region of interest (an ROI)

Returns:
getAsChannelGaussianSmoothed(self, kernelSize: int, pOutChannel: ORSModel.ors.Channel) → Channel

Applies a 2 sigma gaussian convolution.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • kernelSize (int) – the kernel size (a uint16_t, should be an odd number)
  • pOutChannel (ORSModel.ors.Channel) – an optional output channel (an ORSChannelPtr)
Returns:

output (ORSModel.ors.Channel) – the resulting channel (an ORSChannelPtr)

getAsChannelObliqueAverageFromRectangleBetweenPlanes(self, pIInputChannel: ORSModel.ors.Channel, forTimeStep: int, aBoundedPlane: ORSModel.ors.Rectangle, startPlane: ORSModel.ors.Plane, endPlane: ORSModel.ors.Plane, xSize: int, ySize: int, nbZSlice: int, zSliceThickness: float, fitOnData: bool, uniformSpacing: bool, bOptimalSizeAndSpacingInXY: bool, bOptimalSizeAndSpacingInZ: bool, nearest: bool, IProgress: ORSModel.ors.Progress) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelObliqueFromRectangleBetweenPlanes(self, pIInputChannel: ORSModel.ors.Channel, forTimeStep: int, aBoundedPlane: ORSModel.ors.Rectangle, startPlane: ORSModel.ors.Plane, endPlane: ORSModel.ors.Plane, xSize: int, ySize: int, nbZSlice: int, fitOnData: bool, uniformSpacing: bool, bOptimalSizeAndSpacingInXY: bool, bOptimalSizeAndSpacingInZ: bool, nearest: bool, IProgress: ORSModel.ors.Progress) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelObliqueMaxIntensityProjectionFromRectangleBetweenPlanes(self, pIInputChannel: ORSModel.ors.Channel, forTimeStep: int, aBoundedPlane: ORSModel.ors.Rectangle, startPlane: ORSModel.ors.Plane, endPlane: ORSModel.ors.Plane, xSize: int, ySize: int, nbZSlice: int, zSliceThickness: float, fitOnData: bool, uniformSpacing: bool, bOptimalSizeAndSpacingInXY: bool, bOptimalSizeAndSpacingInZ: bool, nearest: bool, IProgress: ORSModel.ors.Progress) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelObliqueMinIntensityProjectionFromRectangleBetweenPlanes(self, pIInputChannel: ORSModel.ors.Channel, forTimeStep: int, aBoundedPlane: ORSModel.ors.Rectangle, startPlane: ORSModel.ors.Plane, endPlane: ORSModel.ors.Plane, xSize: int, ySize: int, nbZSlice: int, zSliceThickness: float, fitOnData: bool, uniformSpacing: bool, bOptimalSizeAndSpacingInXY: bool, bOptimalSizeAndSpacingInZ: bool, nearest: bool, IProgress: ORSModel.ors.Progress) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelOpenWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Creates a new channel which is the receiver eroded and afterwards dilated with the provided kernel.

Parameters:
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelPadded(self, xPadd: int, yPadd: int, zPadd: int, pValue: float, pOutChannel: ORSModel.ors.Channel) → Channel

Pads the channel with a normalized value.

Note

The 3 padding values are applied to the beginning and end of each dimension.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • xPadd (int) – the X padding in pixels (an uint32_t, see note below)
  • yPadd (int) – the Y padding in pixels (an uint32_t, see note below)
  • zPadd (int) – the Z padding in pixels (an uint32_t, see note below)
  • pValue (float) – the padding value, normalized (a double)
  • pOutChannel (ORSModel.ors.Channel) – an optional output channel (an ORSChannelPtr)
Returns:

output (ORSModel.ors.Channel) – the resulting channel (an ORSChannelPtr)

getAsChannelSampled(self, samplingMethod: int, newXSize: int, newYSize: int, newZSize: int, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Samples the channel according to a sampling method.

Note

This method samples the source channel and produces an output channel according to the sampling method specified.

Note

If a target channel is supplied, data is written to it and the channel is returned as a result, otherwise a new channel is created.

Note

See the ORS_def.h file for enum CxvSamplingMethod values.

Parameters:
  • samplingMethod (int) – a CxvSamplingMethod (a uint16_t)
  • newXSize (int) – the new X size (an uint32_t)
  • newYSize (int) – the new Y size (an uint32_t)
  • newZSize (int) – the new Z size (an uint32_t)
  • IProgress (ORSModel.ors.Progress) – progress object (NULL for no progress bar)
  • pOutChannel (ORSModel.ors.Channel) – a target channel (a Channel)
Returns:

output (ORSModel.ors.Channel) – the resulting channel (a Channel)

getAsChannelSampledConverted(self, samplingMethod: int, newXSize: int, newYSize: int, newZSize: int, datatype: int, bNormalize: bool, iLowNormalizationRange: float, iHighNormalizationRange: float, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Samples the channel according to a sampling method, and converts its type.

Note

This method samples the source channel and produces an output channel according to the sampling method specified.

Note

If a target channel is supplied, data is written to it and the channel is returned as a result, otherwise a new channel is created.

Note

See the ORS_def.h file for enum CxvSamplingMethod values.

Parameters:
  • samplingMethod (int) – a CxvSamplingMethod (a uint16_t)
  • newXSize (int) – the new X size (an uint32_t)
  • newYSize (int) – the new Y size (an uint32_t)
  • newZSize (int) – the new Z size (an uint32_t)
  • datatype (int) – the target data type (a uint16_t, see note below)
  • bNormalize (bool) – true to normalize the output
  • iLowNormalizationRange (float) – lower bound of normalization range (a double)
  • iHighNormalizationRange (float) – higher bound of normalization range (a double)
  • IProgress (ORSModel.ors.Progress) – progress object (NULL for no progress bar)
  • pOutChannel (ORSModel.ors.Channel) – a target channel (a Channel)
Returns:

output (ORSModel.ors.Channel) – the resulting channel (a Channel)

getAsChannelSampledInterpolatedFromPlane(self, a: float, b: float, c: float, d: float, upX: float, upY: float, upZ: float, timeStep: int, pInChannel: ORSModel.ors.Channel) → Channel

Samples the channel data for a given plane, interpolating the voxels.

Note

The general plane equation is ax + by + cz + dw = 0.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • a (float) – The bounded plane
  • b (float) – true to have the channel contain the voxel indicies, false to contain the voxel themselves
  • c (float) – an optional output channel (a Channel)
  • d (float) –
  • upX (float) –
  • upY (float) –
  • upZ (float) –
  • timeStep (int) –
  • pInChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelSampledInterpolatedFromPlane2(self, aBoundedPlane: ORSModel.ors.Rectangle, nearest: bool, timeStep: int, pInChannel: ORSModel.ors.Channel) → Channel

Samples the channel data for a given plane, interpolating the voxels.

Note

The general plane equation is ax + by + cz + dw = 0.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • aBoundedPlane (ORSModel.ors.Rectangle) – The bounded plane
  • nearest (bool) – true to have the channel contain the voxel indicies, false to contain the voxel themselves
  • timeStep (int) – an optional output channel (a Channel)
  • pInChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelSampledViaSpacing(self, samplingMethod: int, newXSpacing: float, newYSpacing: float, newZSpacing: float, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) → Channel

Samples the channel according to a sampling method.

Note

This method samples the source channel and produces an output channel according to the sampling method specified.

Note

If a target channel is supplied, data is written to it and the channel is returned as a result, otherwise a new channel is created.

Note

See the ORS_def.h file for enum CxvSamplingMethod values.

Parameters:
  • samplingMethod (int) – a CxvSamplingMethod (a uint16_t)
  • newXSpacing (float) – the new X spacing (a double)
  • newYSpacing (float) – the new Y spacing (a double)
  • newZSpacing (float) – the new Z spacing (a double)
  • IProgress (ORSModel.ors.Progress) – progress object (None() for no progress bar)
  • pOutChannel (ORSModel.ors.Channel) – a target channel (a Channel)
Returns:

output (ORSModel.ors.Channel) – the resulting channel (a Channel)

getAsChannelWithEqualizedHistogram(self, anHistogram: ORSModel.ors.HistogramData, normalizeData: bool, zmin: int, zmax: int, zOffsetInputToOutput: int, pIOutputChannel: ORSModel.ors.Channel) → Channel

Creates a new channel with the data of the receiver transformed to equalize its histogram.

Note

algorithm to be descibed later

Parameters:
  • anHistogram (ORSModel.ors.HistogramData) – histogram to be used for the equalization (OPTIONAL)
  • normalizeData (bool) – true if the output has to be normalized to the total spread of the data type (unsigned char [0,255] unsigned short [0,65535] float[0,1])
  • zmin (int) – the channel to be filled with the result (can be the receiver ) (a Channel)
  • zmax (int) –
  • zOffsetInputToOutput (int) –
  • pIOutputChannel (ORSModel.ors.Channel) –
Returns:

output (ORSModel.ors.Channel) – a result channel (a Channel)

getAsChannelWithinRange(self, minValue: float, maxValue: float, lowerReplacementValue: float, upReplacementValue: float, pIInputChannel: ORSModel.ors.Channel) → Channel

Creates a new channel within a given range.

Note

This method creates a new channel having the same shape (characteristics) as the receiver. It extracts the channel data that falls within the given range of data into the resulting channel. The lower and upper replacement values define what value gets written to the resulting channel for the data falling outside the given range.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • minValue (float) – the lower boundary of the range (a double)
  • maxValue (float) – the upper boundary of the range (a double)
  • lowerReplacementValue (float) – the lower replacement value (a double, see note)
  • upReplacementValue (float) – the upper replacement value (a double, see note)
Returns:
getAsMarchingCubeMesh(self, isovalue: float, bSnapToContour: bool, flipNormal: bool, timeStep: int, xSample: int, ySample: int, zSample: int, pNearest: bool, pWorld: bool, pProgress: ORSModel.ors.Progress, pMesh: ORSModel.ors.Mesh) → Mesh

Creates a marching cube from the channel.

Note

The isovalue is used as a threshold, any value below it (inclusive) is not considered.

Note

The channel needs to have a minimum size of 3 in its X, Y and Z axis.

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

If a progress object is supplied, a cancellable progress bar will be displayed, otherwise no progression is shown.

Parameters:
  • isovalue (float) – an isovalue (a double)
  • 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 in the channel (an 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 in world coordinates, false in local
  • pProgress (ORSModel.ors.Progress) – a progress object (an ORSProgressPtr) to show a progress bar, NULL doesn’t show one
Returns:
getAsMultiROIInArea(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, IProgress: ORSModel.ors.Progress, pInputMultiROI: ORSModel.ors.MultiROI) → MultiROI

Creates a labeled region of interest (MultiROI) from a specified channel area, within supplied ranges.

Note

If a target MultiROI is supplied, data is written to it and returned, otherwise a new MultiROI is created.

Note

The area is expressed in X, Y and Z min/max pairs.

Parameters:
  • minX (int) – an X minimum coordinate, in pixel size (an uint32_t)
  • minY (int) – a Y minimum coordinate, in pixel size (an uint32_t)
  • minZ (int) – a Z minimum coordinate, in pixel size (an uint32_t)
  • maxX (int) – an X maximum coordinate, in pixel size (an uint32_t)
  • maxY (int) – a Y maximum coordinate, in pixel size (an uint32_t)
  • maxZ (int) – a Z maximum coordinate, in pixel size (an uint32_t)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress) or NULL for no progress
  • pInputMultiROI (ORSModel.ors.MultiROI) – a target ROI (an ROI)
Returns:

output (ORSModel.ors.MultiROI) – the resulting ROI (an ROI)

getAsROIWithinRange(self, minValue: float, maxValue: float, IProgress: ORSModel.ors.Progress, pInputROI: ORSModel.ors.ROI) → ROI

Creates a region of interest (ROI) from all the channel data within a given range.

Note

The range must be supplied in a normalized fashion, no matter the data type of the channel.

Note

If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.

Parameters:
  • minValue (float) – the lower range, a normalized value (a double)
  • maxValue (float) – the upper range, a normalized value (a double)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress) or NULL for no progress
  • pInputROI (ORSModel.ors.ROI) – a target ROI (an ROI)
Returns:

output (ORSModel.ors.ROI) – the resulting ROI (an ROI)

getAsROIWithinRangeInArea(self, minValue: float, maxValue: float, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, IProgress: ORSModel.ors.Progress, pOutputROI: ORSModel.ors.ROI) → ROI

Creates a region of interest (ROI) from a specified channel area, within a range.

Note

The range must be supplied in a normalized fashion, no matter the data type of the channel.

Note

If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.

Note

The area is expressed in X, Y and Z min/max pairs.

Parameters:
  • minValue (float) – the lower range, a normalized value (a double)
  • maxValue (float) – the upper range, a normalized value (a double)
  • minX (int) – an X minimum coordinate, in pixel size (an uint32_t)
  • minY (int) – a Y minimum coordinate, in pixel size (an uint32_t)
  • minZ (int) – a Z minimum coordinate, in pixel size (an uint32_t)
  • maxX (int) – an X maximum coordinate, in pixel size (an uint32_t)
  • maxY (int) – a Y maximum coordinate, in pixel size (an uint32_t)
  • maxZ (int) – a Z maximum coordinate, in pixel size (an uint32_t)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress) or NULL for no progress
  • pOutputROI (ORSModel.ors.ROI) – a target ROI (an ROI)
Returns:

output (ORSModel.ors.ROI) – the resulting ROI (an ROI)

getAsROIWithinRangeInterpolated(self, minValue: float, maxValue: float, IProgress: ORSModel.ors.Progress, pInputROI: ORSModel.ors.ROI, cubic: bool) → ROI

Creates a region of interest (ROI) from all the channel data within a given range.

Note

The range must be supplied in a normalized fashion, no matter the data type of the channel.

Note

If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.

Parameters:
  • minValue (float) – the lower range, a normalized value (a double)
  • maxValue (float) – the upper range, a normalized value (a double)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress) or NULL for no progress
  • pInputROI (ORSModel.ors.ROI) – a target ROI (an ROI)
  • cubic (bool) –
Returns:

output (ORSModel.ors.ROI) – the resulting ROI (an ROI)

getAsROIWithinRanges(self, rangeDuplets: float, nbRangeDuplets: int, IProgress: ORSModel.ors.Progress, pInputROI: ORSModel.ors.ROI) → ROI

Creates a region of interest (ROI) from all the channel data within the given ranges.

Note

The ranges must be supplied in a normalized fashion, no matter the data type of the channel.

Note

If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.

Parameters:
  • rangeDuplets (float) – the pairs of ranges (a double*)
  • nbRangeDuplets (int) – number of pairs (a uint16_t), so rangeDuplet size should be nbRangeDuplet*2
  • IProgress (ORSModel.ors.Progress) – a target ROI (an ROI)
  • pInputROI (ORSModel.ors.ROI) – a progress object (an Progress) or NULL for no progress
Returns:

output (ORSModel.ors.ROI) – the resulting ROI (an ROI)

getAsROIWithinRangesInArea(self, rangeDuplet: float, nbRangeDuplet: int, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, IProgress: ORSModel.ors.Progress, pInputROI: ORSModel.ors.ROI) → ROI

Creates a region of interest (ROI) from a specified channel area, within supplied ranges.

Note

The ranges must be supplied in a normalized fashion, no matter the data type of the channel.

Note

If a target ROI is supplied, data is written to it and returned, otherwise a new ROI is created.

Note

The area is expressed in X, Y and Z min/max pairs.

Parameters:
  • rangeDuplet (float) – the pairs of ranges (a double*)
  • nbRangeDuplet (int) – number of pairs (a uint16_t), so rangeDuplet size should be nbRangeDuplet*2
  • minX (int) – an X minimum coordinate, in pixel size (an uint32_t)
  • minY (int) – a Y minimum coordinate, in pixel size (an uint32_t)
  • minZ (int) – a Z minimum coordinate, in pixel size (an uint32_t)
  • maxX (int) – an X maximum coordinate, in pixel size (an uint32_t)
  • maxY (int) – a Y maximum coordinate, in pixel size (an uint32_t)
  • maxZ (int) – a Z maximum coordinate, in pixel size (an uint32_t)
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress) or NULL for no progress
  • pInputROI (ORSModel.ors.ROI) – a target ROI (an ROI)
Returns:

output (ORSModel.ors.ROI) – the resulting ROI (an ROI)

getAttenuationOnLine(self, aLine: ORSModel.ors.Line, attenuationFactor: float, timeStep: int, spacing: float, bNormalize: bool, bConvertToPhysicalUnits: bool) → float

Calculates the attenuation on the line.

Parameters:
  • aLine (ORSModel.ors.Line) – a line
  • attenuationFactor (float) – the timestep
  • timeStep (int) – the number of samples required (an int)
  • spacing (float) – true normalizes the results, false doesn’t
  • bNormalize (bool) – true returns the values in physical units, false doesn’t
  • bConvertToPhysicalUnits (bool) –
Returns:

output (float) –

getBitCount(self) → int

Gets the number of bits used to represent one pixel.

Note

It can be 8, 16 or 32.

Returns:output (int) – the bit count (a uint16_t)
getByteCountPerSample(self) → int
Returns:output (int) –
getChannelLocalMaxAsROI(self, pKernel: ORSModel.ors.ConvolutionKernel, fMinValue: float, fMaxValue: float, pOutROI: ORSModel.ors.ROI) → ROI

Find the local maximum of a dataset and returns it into a volumeROI.

Parameters:
  • pKernel (ORSModel.ors.ConvolutionKernel) – the computation kernel made of 0 or 1 (an ConvolutionKernel)
  • fMinValue (float) – a minimum thresholdValue under which the localMax found are ignored (double)
  • fMaxValue (float) – a maximum thresholdValue over which the localMax found are ignored (double)
  • pOutROI (ORSModel.ors.ROI) – an output ROI
Returns:

output (ORSModel.ors.ROI) –

getChannelLocalMinAsROI(self, pKernel: ORSModel.ors.ConvolutionKernel, fMinValue: float, fMaxValue: float, pOutROI: ORSModel.ors.ROI) → ROI

Find the local minimum of a dataset and returns it into a volumeROI.

Parameters:
  • pKernel (ORSModel.ors.ConvolutionKernel) – the computation kernel made of 0 or 1 (an ConvolutionKernel)
  • fMinValue (float) – a minimum thresholdValue under which the localMin found are ignored (double)
  • fMaxValue (float) – a maximum thresholdValue over which the localMin found are ignored (double)
  • pOutROI (ORSModel.ors.ROI) – an output ROI
Returns:

output (ORSModel.ors.ROI) –

classmethod getClassDenomination()
getClassNameStatic() → str

getClassNameStatic

Returns:output (str) –
getClassicalStandardDeviation(self) → float

Computes the standard deviation.

Returns:output (float) – the standard deviation (a float)
getClipBox(timestep=0, display=None)

Gets the clip box of the channel

Parameters:
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 channel

Parameters:
Returns:
getDICOMAttribute(self, iTIndex: int, iZIndex: int, pGroup: int, pElement: int, bSearchSubs: bool) → str
Parameters:
  • iTIndex (int) –
  • iZIndex (int) –
  • pGroup (int) –
  • pElement (int) –
  • bSearchSubs (bool) –
Returns:

output (str) –

getDICOMAttributeAsDouble(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → float

Retrieves a DICOM attribute as a double.

Note

Applicable to the following VRs: DS, FD.

Note

To distinguish between a return value of 0 because the attribute is absent, check for the presence of the attribute with hasDICOMAttribute().

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (float) – the value (a double)

getDICOMAttributeAsFloat(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → float

Retrieves a DICOM attribute as a float.

Note

Applicable to the following VRs: FL, OF.

Note

To distinguish between a return value of 0 because the attribute is absent, check for the presence of the attribute with hasDICOMAttribute().

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (float) – the value (a float)

getDICOMAttributeAsInt(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → int

Retrieves a DICOM attribute as a signed 32 bit number.

Note

Applicable to the following VRs: IS, SL, SS, UL, US.

Note

To distinguish between a return value of 0 because the attribute is absent, check for the presence of the attribute with hasDICOMAttribute().

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (int) – the value (an int)

getDICOMAttributeAsShort(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → int

Retrieves a DICOM attribute as a signed 16 bit number.

Note

Applicable to the following VRs: SS.

Note

To distinguish between a return value of 0 because the attribute is absent, check for the presence of the attribute with hasDICOMAttribute().

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (int) – the value (a short)

getDICOMAttributeAsUnsignedInt(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → int

Retrieves a DICOM attribute as an unsigned 32 bit number.

Note

Applicable to the following VRs: UL.

Note

The success is indicated in the seventh argument. If you’re not interested in the success, you can use NULL.

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (int) – the value (a uint32_t)

getDICOMAttributeAsUnsignedShort(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bSearchSubs: bool) → int

Retrieves a DICOM attribute as an unsigned 16 bit number.

Note

Applicable to the following VRs: OW, US.

Note

To distinguish between a return value of 0 because the attribute is absent, check for the presence of the attribute with hasDICOMAttribute().

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (int) – the value (a uint16_t)

getDICOMAttributeFromSequence(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iItemNo: int, iElementGroup: int, iElementElement: int) → str
Parameters:
  • iTIndex (int) –
  • iZIndex (int) –
  • iGroup (int) –
  • iElement (int) –
  • iItemNo (int) –
  • iElementGroup (int) –
  • iElementElement (int) –
Returns:

output (str) –

getDICOMContainer(self, iTIndex: int, iZIndex: int) → str
Parameters:
  • iTIndex (int) –
  • iZIndex (int) –
Returns:

output (str) –

getDataDescription(self) → int

Gets the channel description.

Note

enum CxvChannel_Description (in ORS_def.h) is used to categorize channels.

Returns:output (int) – a description index (a int32_t)
getDataRange(self) → float

Gets the size of the spread of data.

Note

Unless a value was supplied via setDataRange(), the value returned by this method is assumed to cover the spread of the data type (i.e. for unsigned short it will return 2^16). Float channels are an exception, where the true data range will be computed from the smallest and largest value found in the channel (because the computed spread is too large).

Returns:output (float) – a value (a double)
getDataType(self) → int

Gets the channel data type.

Note

See CxvChannel_Data_Type (in ORS_def.h) for supported types.

Returns:output (int) – a type (a int32_t)
getDataUnit(self) → str
Returns:output (str) –
getDimensionUnit(self) → DimensionUnit

Gets the channel’s dimension unit.

Returns:output (ORSModel.ors.DimensionUnit) –
getHasDICOMAttributes(self) → bool

Checks to see if the channel has DICOM attributes.

Returns:output (bool) – true if DICOM attributes exist, false otherwise
getHasSliceOrientationAndPosition(self) → bool

Queries the channel to know if it has slice orientation and position.

Note

All channels have a zero origin orientation and position, but some channels have a greater level of detail, where each slice has orientation and position data.

Returns:output (bool) – true if it does, false otherwise
getInitialWindowLevelCenter(self) → float
Returns:output (float) –
getInitialWindowLevelWidth(self) → float
Returns:output (float) –
getInterpolatedLineSegment(self, pLineSegment: ORSModel.ors.LineSegment, nTIndex: int, fSpacing: float, nInterpolationMethod: int, values: ORSModel.ors.Array) → Array
Parameters:
Returns:

output (ORSModel.ors.Array) –

getInterpolatedPositionOnSlice(self, pTIndex: int, pZSlice: float, xPos: float, yPos: float) → Vector3

Gets the interpolated position of a point on a given slice.

Note

The X and Y positions can be outside the channel.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (float) – the Z slice index (a double)
  • xPos (float) – the X voxel position (a double)
  • yPos (float) – the Y voxel position (a double)
Returns:

output (ORSModel.ors.Vector3) – a vector (a Vector3)

getInterpolatedValuesAtPositions(self, aWorldCoordinate: ORSModel.ors.ArrayDouble, tIndex: int, nInterpolationMethod: int, bConvertToPhysicalUnits: bool, values: ORSModel.ors.ArrayDouble) → ArrayDouble
Parameters:
Returns:

output (ORSModel.ors.ArrayDouble) –

getIsClipped(timestep=0, display=None)

Gets to know if there is a clip box attached to the channel

Parameters:
Returns:

isClipped (bool) – if True, the clip box of the channel is visible; False otherwise.

getIsData3D(self) → bool

Verifies if the channel holds 3D data or not.

Note

Normally channels hold 3D data, but there are cases where it is known that the data is not 3D (for example, stacks of screenshots). In those cases channels need to be told that they do not hold 3D data.

Returns:output (bool) – true if data is 3D, false otherwise
getIsDataInitialized(self) → bool

Checks if the internal data is initialized.

Note

The channel must be initialized before you start using the channel.

Returns:output (bool) – true if initialized correctly, false otherwise
getIsDataTypeFloat(self) → bool
Returns:output (bool) –
getIsDataTypeUnsignedBYTE(self) → bool
Returns:output (bool) –
getIsDataTypeUnsignedInt(self) → bool
Returns:output (bool) –
getIsDataTypeUnsignedShort(self) → bool
Returns:output (bool) –
getIsLossy(self) → bool

Verifies if the channel is lossy or not.

Note

A channel can be lossy for two different reasons:

Returns:output (bool) – true if data is lossy, false otherwise
getIsMarkedSlice(self, pTIndex: int, pZSlice: int) → bool

Checks to see if a slice is marked or not.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
Returns:

output (bool) – true if the slice’s marker is on, false otherwise

getIsZSliceDataAvailable(self, pTIndex: int, pZSlice: int) → bool

Gets the availability of a Z slice’s data.

Note

The channel can be set to work in “lazy” mode, where slices are made available as they are read.

Note

If you want to know if the entire data has arrived, use getAreAllZSlicesDataAvailable().

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
Returns:

output (bool) – true if the Z slice’s data is available, false otherwise

getLabelization(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, iTIndex: int, min: float, max: float, considerDiagonal: bool, IProgress: ORSModel.ors.Progress, pInVolumeROI: ORSModel.ors.ROI, pOutData: ORSModel.ors.MultiROI) → MultiROI

Labels the channel data.

Note

This method labels areas of the channel 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 (an uint32_t)
  • minY (int) – the minimum Y range (an uint32_t)
  • minZ (int) – the minimum Z range (an uint32_t)
  • maxX (int) – the maximum X range (an uint32_t)
  • maxY (int) – the maximum Y range (an uint32_t)
  • maxZ (int) – the maximum Z range (an uint32_t)
  • iTIndex (int) – the T index (an uint32_t)
  • min (float) – the minimum data range (a double)
  • max (float) – the maximum data range (a double)
  • considerDiagonal (bool) – true to consider diagonals, false otherwise
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress), or NULL for no progress
  • pInVolumeROI (ORSModel.ors.ROI) – an optional input mask (an ROI)
  • pOutData (ORSModel.ors.MultiROI) – an optional output object (an MultiROI)
Returns:

output (ORSModel.ors.MultiROI) – the resulting object (an MultiROI)

getLineBoundedDoublePlane(self, pT: int, iZSlice: int, iYLine: int) → Rectangle
Parameters:
  • pT (int) –
  • iZSlice (int) –
  • iYLine (int) –
Returns:

output (ORSModel.ors.Rectangle) –

getMarkedSlicesCount(self) → int

Gets the count of marked slices.

Note

Gets the total marked slices count, across all T dimensions.

Returns:output (int) – the count of marked slices (a uint32_t)
getMaximumValue(self) → float

Gets the maximum value found in the data array, always returned as a double.

Note

Min, max and mean are kept statically and are recomputed when the channel data changes.

Returns:output (float) – the maximum value (a double)
getMaximumValueInPhysicalUnits(self) → float

Gets the maximum value found in the data array in physical units, always returned as a double.

Note

Min, max and mean are kept statically and are recomputed when the channel data changes.

Returns:output (float) – the maximum value (a double)
getMeanValue(self) → float

Gets the mean value computed with the data array, always returned as a double.

Note

Min, Max and Mean are kept statically and are recomputed when the channel data changes.

Returns:output (float) – the mean value (a double)
getMinMaxSubsetAsVector(self, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int) → Vector3
Parameters:
  • xmin (int) –
  • ymin (int) –
  • zmin (int) –
  • tmin (int) –
  • xmax (int) –
  • ymax (int) –
  • zmax (int) –
  • tmax (int) –
Returns:

output (ORSModel.ors.Vector3) –

getMinimumValue(self) → float

Gets the minimum value found in the channel, always returned as a double.

Note

Min, max and mean are kept statically and are recomputed when the channel data changes.

Returns:output (float) – the minimum value (a double)
getMinimumValueInPhysicalUnits(self) → float

Gets the minimum value found in the channel in physical unit, always returned as a double.

Note

Min, max and mean are kept statically and are recomputed when the channel data changes.

Returns:output (float) – the minimum value (a double)
getNDArray(timestep=0)
getNormalizedMaxPossibleValue(self) → float

Gets the normalized maximum possible value, according to the channel’s data type.

Returns:output (float) – max value (a double)
getNormalizedMinPossibleValue(self) → float

Gets the normalized minimum possible value, according to the channel’s data type.

Returns:output (float) – min value (a double)
getNormalizedValueAt(self, x: int, y: int, z: int, t: int) → float

Gets the normalized data value at the specified coordinate.

Note

For an 8 bit channel, return value is normalized on 256.

Note

For a 16 bit channel, return value is normalized on 65536.

Note

For a 32 bit channel, return value is normalized on the spread found in the channel.

Parameters:
  • x (int) – X coordinate (an uint32_t)
  • y (int) – Y coordinate (an uint32_t)
  • z (int) – Z coordinate (an uint32_t)
  • t (int) – T coordinate (an uint32_t)
Returns:

output (float) – value (a double)

getNumberOfSuggestedWindowLevelValues(self) → int

Returns the number of known pairs of suggested window width and center values (for leveling).

Returns:output (int) – the number of pairs (a uint16_t)
getOffset(self) → float

Gets the channel offset.

Returns:output (float) – the offset (a double)
getOrientationComparisonPrecision(self) → float

Gets the channel’s orientation comparison precision.

Note

To deem if a channel is well behaved or not in terms of its orientations, one can compare all the channel slices’ orientations. This method returns the precision to use to determine if orientations are close enough.

Returns:output (float) – a double (see note)
getOtsu(timestep=0, bins=256)

Get the Otsu Threshold

Parameters:
  • timestep (int) – timestep to analyse
  • bins (int) – bin count for the calculation
getPhysicalMax(self) → float

Gets the maximum value found in the data array, always returned as a double.

Note

Min and max are kept statically and are recomputed when the channel data changes.

Note

The return value is not normalized, but it is always typecast to a double.

Returns:output (float) – the maximum value (a float)
getPhysicalMin(self) → float

Gets the minimum value found in the data array, always returned as a float.

Note

Min and max are kept statically and are recomputed when the channel data changes.

Note

The return value is not normalized, but it is always typecast to a float.

Returns:output (float) – the minimum value (a float)
getPositionOnLine(self, pT: int, iZSlice: int, iYLine: int, xIndex: float) → Vector3
Parameters:
  • pT (int) –
  • iZSlice (int) –
  • iYLine (int) –
  • xIndex (float) –
Returns:

output (ORSModel.ors.Vector3) –

getPositionOnSlice(self, pTIndex: int, pZSlice: int, xPos: int, yPos: int) → Vector3

Gets the position of a point on a given slice.

Note

The X and Y positions can be outside the channel.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
  • xPos (int) – the X voxel position (an uint32_t)
  • yPos (int) – the Y voxel position (an uint32_t)
Returns:

output (ORSModel.ors.Vector3) – a position (an Vector3)

getRawDataChunk(self, iLevel1: int, iLevel2: int) → None

Gets a portion of the channel’s data.

Note

The received array is not a copy, do not release it. It will be released by the interface.

Note

Use with caution, as this method gives you direct access to the channel data. ORS encourages use of the CxvChannelData class wrapper instead of direct access.

Parameters:
  • iLevel1 (int) – the T index (an uint32_t)
  • iLevel2 (int) – the Z index (an uint32_t)
getSampledLine(self, pPoint1: ORSModel.ors.Vector3, pPoint2: ORSModel.ors.Vector3, timeStep: int) → ArrayDouble

Samples the channel data between two points.

Note

This method finds all the voxel data placed on an imaginary line drawn between the two given points, and returns the data in a normalized fashion.

Parameters:
Returns:

output (ORSModel.ors.ArrayDouble) – an array of double values (an ArrayDouble)

getSampledLineOfNPoints(self, pPoint1: ORSModel.ors.Vector3, pPoint2: ORSModel.ors.Vector3, timeStep: int, nbOutputPoint: int, bNormalize: bool, bConvertToPhysicalUnits: bool) → ArrayDouble

Samples the channel data between two points.

Note

This method finds all the voxel data placed on an imaginary line drawn between the two given points.

Parameters:
  • pPoint1 (ORSModel.ors.Vector3) – a starting coordinate (an ORSVector3Ptr)
  • pPoint2 (ORSModel.ors.Vector3) – an ending coordinate (an ORSVector3Ptr)
  • timeStep (int) – the timestep (an uint32_t)
  • nbOutputPoint (int) – the number of points required (a uint32_t)
  • bNormalize (bool) – true normalizes the results, false doesn’t
  • bConvertToPhysicalUnits (bool) – true returns the values in physical units, false doesn’t
Returns:

output (ORSModel.ors.ArrayDouble) – an array containing the results (an ArrayDouble)

getSavePixelDataWhileSavingNode(self) → int

Gets if and how the channel should save its pixel data to XML.

Note

The save mode has these meanings:

Returns:output (int) – the current save mode (a short between 0 and 2, see below)
getSerieHasBeenModified(self) → bool
Returns:output (bool) –
getSliceDirection0Size(self, timeStep: int, sliceIndex: int) → float
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (float) –

getSliceDirection0Spacing(self, timeStep: int, sliceIndex: int) → float
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (float) –

getSliceDirection1Size(self, timeStep: int, sliceIndex: int) → float
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (float) –

getSliceDirection1Spacing(self, timeStep: int, sliceIndex: int) → float
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (float) –

getSliceIntersectionLength(self, timeStep: int, sliceIndex: int) → float
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (float) –

getSliceOrientation(self, pTIndex: int, pZSlice: int, index: int) → float

Gets the orientation of a given slice.

Note

First three indicies indicate X orientation, next three indicate Y orientation and last three are for Z.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
  • index (int) – an index (from 0 to 9)
Returns:

output (float) – the orientation value (a double)

getSlicePosition(self, pTIndex: int, pZSlice: int) → Vector3

Gets the position of a given slice.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
Returns:

output (ORSModel.ors.Vector3) – the position (an Vector3)

getSliceRectangle(self, timeStep: int, sliceIndex: int) → Rectangle
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
Returns:

output (ORSModel.ors.Rectangle) –

getSlope(self) → float

Gets the channel slope.

Returns:output (float) – the slope (a double)
getSpacingXValidity(self) → bool

Checks if X spacing is valid.

Returns:output (bool) – true if X spacing is valid, false otherwise
getSpacingYValidity(self) → bool

Checks if Y spacing is valid.

Returns:output (bool) – true if Y spacing is valid, false otherwise
getSpacingZValidity(self) → bool

Checks if Z spacing is valid.

Returns:output (bool) – true if Z spacing is valid, false otherwise
getSuggestedWindowLevelCenterAt(self, pIndex: int) → float

Gets the Nth suggested window venter value (for leveling).

Note

The suggested leveling values are only used to present suitable values to end users.

Parameters:pIndex (int) – the index (a uint16_t)
Returns:output (float) – the window center (a double)
getSuggestedWindowLevelWidthAt(self, pIndex: int) → float

Gets the Nth suggested window width value (for leveling).

Note

The suggested leveling values are only used to present suitable values to end users.

Parameters:pIndex (int) – the index (a uint32_t)
Returns:output (float) – the window width (a double)
getTRawDataChunk(self, iLevel1: int) → int

Gets a T portion of the channel’s data.

Note

The received array is not a copy, do not release it. It will be released by the interface.

Note

Use with caution, as this method gives you direct access to the channel data. ORS encourages use of the CxvChannelData class wrapper instead of direct access.

Parameters:iLevel1 (int) – the T index (an uint32_t)
Returns:output (int) – an array of array of bytes (char)
getTimeFrame(self, pTimeStep: int, pYear: int, pMonth: int, pDay: int, pHour: int, pMinutes: int, pSeconds: int, pMicroSeconds: int) → None

Gets the value of a time frame.

Note

Time frames represent the exact time at each T increment.

Note

-1 is returned if no time frames are defined or if the T index argument is invalid.

Parameters:

pTimeStep (int) – the T index (an uint32_t)

Returns:
  • pYear (int) – the year (a uint16_t*)
  • pMonth (int) – the month (a uint16_t*)
  • pDay (int) – the day (a uint16_t*)
  • pHour (int) – the hour (a uint16_t*)
  • pMinutes (int) – the minutes (a uint16_t*)
  • pSeconds (int) – the seconds (a uint16_t*)
  • pMicroSeconds (int) – the microseconds (a uint32_t*)
getTotalByteCount(self) → int

Gets the total number of bytes in the internal data.

Note

The size in bytes is represented by the formula: X size * Y size * Z size * T size * bit depth.

Returns:output (int) – number of bytes (a uint64_t)
getTotalSliceIntersectionLength(self, timeStep: int) → float
Parameters:timeStep (int) –
Returns:output (float) –
getTransformationToGoTo(self, pInChannel: ORSModel.ors.Channel) → Matrix4x4
Parameters:pInChannel (ORSModel.ors.Channel) –
Returns:output (ORSModel.ors.Matrix4x4) –
getTypeDescription(self) → str
Returns:output (str) –
getValueAsDoubleAtIndex(self, xIndex: int, yIndex: int, zIndex: int, tIndex: int) → float
Parameters:
  • xIndex (int) –
  • yIndex (int) –
  • zIndex (int) –
  • tIndex (int) –
Returns:

output (float) –

getValueAsDoubleAtWorldCoordinateNearest(self, aWorldCoordinate: ORSModel.ors.Vector3, tIndex: int) → float
Parameters:
Returns:

output (float) –

getValueConvertedFromPhysicalUnits(self, pInput: float) → float

Converts a value from physical units to channel units.

Note

Slope and offset are applied to convert from physical units.

Parameters:pInput (float) – the value to convert (a double)
Returns:output (float) – the result (a double)
getValueConvertedToPhysicalUnits(self, pInput: float) → float

Converts a value from channel units to physical units.

Note

Slope and offset are applied to convert to physical units.

Parameters:pInput (float) – the value to convert (a double)
Returns:output (float) – the result (a double)
hasDICOMAttribute(self, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, bSearchSubs: bool) → bool

Verifies the existence of a DICOM attribute.

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • bSearchSubs (bool) – true to search sequences, false otherwise
Returns:

output (bool) – true if item was found, false otherwise

classmethod imread(files)

Loads a Channel from file(s)

Parameters:files (file or str) – fully qualified file name list or fully qualified file name
Returns:outChannel (ORSModel.ors.Channel) – the resulting Channel
classmethod imreadDICOM(files)

Loads a Channel from files or folder contaning DICOM

Parameters:files (file) [count=[0, None]] – fully qualified file name list
Returns:outChannel (ORSModel.ors.Channel) – the resulting Channel
classmethod imreadDICOMFolder(folder)

Loads a Channel from folder of DICOM files

Parameters:folder (folder) – fully qualified folder
Returns:outChannel (ORSModel.ors.Channel) – the resulting Channel
classmethod imreadFolder(folder)

Loads a Channel from folder

Parameters:folder (folder) – fully qualified folder
Returns:outChannel (ORSModel.ors.Channel) – the resulting Channel
imsave(fileName, extension='tif')

Save a Channel to file in the type specified by the extension

Parameters:
  • fileName (file saving) – fully qualified file name
  • extension (str) – image file format extension
Return:

True or False

Rtype:

bool

imwrite(fileName, extension='tif')

Save a Channel to file in the type specified by the extension

Parameters:
  • fileName (file saving) – fully qualified file name
  • extension (str) – image file format extension
Return:

True or False

Rtype:

bool

initializeData(self) → bool

Initializes the channel’s internal data.

Note

The memory required by the internal data is represented by the formula: X size * Y size * Z size * T size * bitSize.

Note

The channel must be initialized before you start using the channel.

Note

The XYZT sizes, and the data type must be set prior to initializing the channel.

Note

A false result means that a memory allocation error occurred.

Returns:output (bool) – true if initialization was successful, false otherwise
initializeDataForFLOAT(self) → bool

Initializes the channel data array for 32 bit float data.

Note

The size in bytes of the data array is represented by the formula: X * Y * Z * T * 4.

Note

The channel must be initialized before you set the channel data array.

Note

The XYZT sizes must be set prior to initializing the channel.

Note

A false result means that a memory allocation error occurred.

Returns:output (bool) – true if initialization was successful, false otherwise
initializeDataForUCHAR(self) → bool

Initializes the channel data array for 8 bit unsigned data.

Note

The size in bytes of the data array is represented by the formula: X * Y * Z * T.

Note

The channel must be initialized before you set the channel data array.

Note

The XYZT sizes must be set prior to initializing the channel.

Note

A false result means that a memory allocation error occurred.

Returns:output (bool) – true if initialization was successful, false otherwise
initializeDataForUINT(self) → bool

Initializes the channel data array for 32 bit unsigned int data.

Note

The size in bytes of the data array is represented by the formula: X * Y * Z * T * 4.

Note

The channel must be initialized before you set the channel data array.

Note

The XYZT sizes must be set prior to initializing the channel.

Note

A false result means that a memory allocation error occurred.

Returns:output (bool) – true if initialization was successful, false otherwise
initializeDataForUSHORT(self) → bool

Initializes the channel data array for 16 bit unsigned integer data.

Note

The size in bytes of the data array is represented by the formula: X * Y * Z * T * 2.

Note

The channel must be initialized before you set the channel data array.

Note

The XYZT sizes must be set prior to initializing the channel.

Note

A false result means that a memory allocation error occurred.

Returns:output (bool) – true if initialization was successful, false otherwise
invert(self, invertX: bool, invertY: bool, invertZ: bool, invertData: bool, axisTransformation: int, IProgress: ORSModel.ors.Progress, IOutputChannel: ORSModel.ors.Channel) → Channel

Inverts the receiver.

Note

The axis transformation code allows to transpose the axis according to this grid: 0 -> XYZ (no transformation) 1 -> XZY 2 -> YXZ 3 -> YZX 4 -> ZXY 5 -> ZYX

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created.

Parameters:
  • invertX (bool) – true to invert the X axis
  • invertY (bool) – true to invert the Y axis
  • invertZ (bool) – true to invert the Z axis
  • invertData (bool) – true to invert the data
  • axisTransformation (int) – an axis transformation code (a uint16_t), between 0 and 5 (see note)
  • IProgress (ORSModel.ors.Progress) – a progress object, NULL for no progress (an Progress)
  • IOutputChannel (ORSModel.ors.Channel) – an optional output channel (a Channel)
Returns:

output (ORSModel.ors.Channel) – the inverted channel (a Channel)

iterateDICOMAttributes(self, iTIndex: int, iZIndex: int, callbackFunction: int, userdata: int) → None

Iterates through the DICOM attributes, calling a callback function.

Note

The callback function is called with the group and element numbers, the attribute as a string, and any user data supplied to this method. Note that PixelData and OverlayData attributes are excluded from the enumeration. The callback function should return true to continue iterating, but can return false to interrupt the iterating.

Parameters:
  • iTIndex (int) – the T index (an uint32_t)
  • iZIndex (int) – the slice index (an uint32_t)
  • callbackFunction (int) – a callback function (the address of a ORSCHANNELDICOMATTRIBUTESITERATOR function)
  • userdata (bytes) – any user data to be supplied to the callback function
logOOMError(log)
mergeWithBAndProjectInC(self, channelB: ORSModel.ors.Channel, channelC: ORSModel.ors.Channel, IProgress: ORSModel.ors.Progress) → None

Merges the channel with another channel, feeding a third channel.

Note

Merging respects both channels’ orientation, size, spacing, etc.

Parameters:
moveChannelDataInto(self, otherChannel: ORSModel.ors.Channel) → bool

move the data from the left channel to the right channel

Parameters:otherChannel (ORSModel.ors.Channel) – the other channel to move data into
Returns:output (bool) –
moveSlicedata(self, zIndex: int, timeStep: int, xTranslation: int, yTranslation: int) → None
Parameters:
  • zIndex (int) –
  • timeStep (int) –
  • xTranslation (int) –
  • yTranslation (int) –
none() → Channel

Returns a none object, equivalent to a non-existent object (or null).

Returns:output (Channel) –
ones(aShape, dtype=<class 'numpy.uint8'>)
overwriteRangeWithValue(self, minValue: float, maxValue: float, replacementValue: float) → None

Overwrites data within a range with a given value.

Note

All three arguments are supplied in double for convenience only, and are converted into the native type of the channel. For each pixel of the channel, if its value is > minimum range and < maximum range, then its pixel is replaced with the replacement value.

Parameters:
  • minValue (float) – the minimum range value (a double, see note below), non-inclusive
  • maxValue (float) – the maximum range value (a double, see note below), non-inclusive
  • replacementValue (float) – the replacement value (a double, see note below)
overwriteValueAtIndicies(self, indices: int, indicesSize: int, repValue: float) → None

Overwrites the channel data at the specified indicies with a supplied (normalized) value.

Note

The replacement value must be supplied in double format, no matter the data type of the channel.

Note

The sender is responsible for releasing the array of indices.

Parameters:
  • indices (int) – an array of data indicies (an array of int64_t)
  • indicesSize (int) – the array element count (an uint32_t)
  • repValue (float) – the replacement value (a double)
overwriteValueAtWorldCoordinates(self, positionTriplets: float, nbTriplet: int, tIndex: int, replacementValue: float) → None

Overwrites the values at positions specified by world triplets and time T.

Note

The replacement value must be supplied in normalized format, no matter the data type of the channel.

Parameters:
  • positionTriplets (float) – An array of world coordinates triplets (a double*)
  • nbTriplet (int) – The number of triplets in the above array (an uint32_t)
  • tIndex (int) – The T index to be processed (an uint32_t)
  • replacementValue (float) – The replacement value (a double)
overwriteValueWithMultiROI(self, aMultiROI: ORSModel.ors.MultiROI, labelOffset: int) → None

Overwrites the channel data at a givenMultiROI.

Note

The channel and multiROI doesn’t need to have the same shape

Note

This method overwrites the channel data according to a MultiROI.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aMultiROI (ORSModel.ors.MultiROI) – a MultiROI (an MultiROI)
  • labelOffset (int) – the label offset (an uint32_t)
overwriteValueWithMultiROIConsideringOpacity(self, aMultiROI: ORSModel.ors.MultiROI, labelOffset: int, fHightlightOpacity: float, fHightlightOpacityOutRange: float, fROIOpacity: float, fROIOpacityOutRange: float) → None

Overwrites the channel data at a givenMultiROI.

Note

The channel and multiROI doesn’t need to have the same shape

Note

This method overwrites the channel data according to a MultiROI.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aMultiROI (ORSModel.ors.MultiROI) – a MultiROI (an MultiROI)
  • labelOffset (int) – the label offset (an uint32_t)
  • fHightlightOpacity (float) –
  • fHightlightOpacityOutRange (float) –
  • fROIOpacity (float) –
  • fROIOpacityOutRange (float) –
overwriteValueWithMultiROIOnSubBox(self, aVolumeROI: ORSModel.ors.MultiROI, labelOffset: int, subBox: ORSModel.ors.Box, iTIndex: int) → None

Overwrites the channel data at a givenMultiROI included in the given box.

Note

The channel and multiROI doesn’t need to have the same shape

Note

The box must have orthonormal base with the channel box.

Note

This method overwrites the channel data according to a MultiROI.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aVolumeROI (ORSModel.ors.MultiROI) – a MultiROI (an MultiROI)
  • labelOffset (int) – the label offset (an uint32_t)
  • subBox (ORSModel.ors.Box) – the box (a Box)
  • iTIndex (int) – the time step index (uint32_t)
overwriteValueWithMultiROIOnSubBoxConsideringOpacity(self, aVolumeROI: ORSModel.ors.MultiROI, labelOffset: int, subBox: ORSModel.ors.Box, fHightlightOpacity: float, fHightlightOpacityOutRange: float, fROIOpacity: float, fROIOpacityOutRange: float, iTIndex: int) → None

Overwrites the channel data at a givenMultiROI included in the given box.

Note

The channel and multiROI doesn’t need to have the same shape

Note

The box must have orthonormal base with the channel box.

Note

This method overwrites the channel data according to a MultiROI.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aVolumeROI (ORSModel.ors.MultiROI) – a MultiROI (an MultiROI)
  • labelOffset (int) – the label offset (an uint32_t)
  • subBox (ORSModel.ors.Box) – the box (a Box)
  • fHightlightOpacity (float) – the time step index (uint32_t)
  • fHightlightOpacityOutRange (float) –
  • fROIOpacity (float) –
  • fROIOpacityOutRange (float) –
  • iTIndex (int) –
overwriteValueWithROI(self, aVolumeROI: ORSModel.ors.ROI, pReplacementValue: float) → None

Overwrites the channel data at a given Region of Interest.

Note

The channel and ROI doesn’t need to have the same shape

Note

This method overwrites the channel data according to a Region of Interest.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aVolumeROI (ORSModel.ors.ROI) – a ROI (an ROI)
  • pReplacementValue (float) – the new value (a double)
overwriteValueWithROIOnSubBox(self, aROI: ORSModel.ors.ROI, pReplacementValue: float, subBox: ORSModel.ors.Box, iTIndex: int) → None

Overwrites the channel data at a given Region of Interest included in the given box.

Note

The channel and ROI doesn’t need to have the same shape

Note

The box must have orthonormal base with the channel box.

Note

This method overwrites the channel data according to a Region of Interest.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aROI (ORSModel.ors.ROI) – a ROI (an ROI)
  • pReplacementValue (float) – the new value (a double)
  • subBox (ORSModel.ors.Box) – the box (a Box)
  • iTIndex (int) – the time step index (uint32_t)
prepareForObliqueExtractionFromRectangleBetweenPlanes(self, aBoundedPlane: ORSModel.ors.Rectangle, startPlane: ORSModel.ors.Plane, endPlane: ORSModel.ors.Plane, xSize: int, ySize: int, nbZSlice: int, fitOnData: bool, uniformSpacing: bool, bOptimalSizeAndSpacingInXY: bool, bOptimalSizeAndSpacingInZ: bool, IOutChannel: ORSModel.ors.Channel) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

projectInShape(self, aShape: ORSModel.ors.Shape3D, sourceTime: int, channelFilteringMode: int, outputChannel: ORSModel.ors.Channel, outputChannelMask: ORSModel.ors.Channel, destinationTime: int) → Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

removeAllPrivateDICOMAttributes(self) → None

Removes all private DICOM attributes.

removeSlice(self, pSliceIndex: int) → None

Removes a slice of data from the channel.

Note

Note that the same slice index will be removed in all T dimensions of the channel.

Parameters:pSliceIndex (int) – the slice number (an uint32_t, 0 based)
resize(shape, dtype=<class 'numpy.uint8'>)
setAllData(self, aValue: float) → None

Sets the entire channel data to a single value.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:aValue (float) – the new value (a double)
setAllDataOnSubBox(self, aValue: float, subBox: ORSModel.ors.Box, iTIndex: int) → None

Sets the channel data included in a box to a single value.

Note

The box must have orthonormal base with the channel box.

Note

The new value needs to be a normalized value, and will be converted to the native channel type.

Parameters:
  • aValue (float) – the new value (a double)
  • subBox (ORSModel.ors.Box) – the subBox (a Box)
  • iTIndex (int) – the T index (an uint32_t)
setAllMarkedSlices(self, pValue: bool) → None

Sets the boolean marker of all slices.

Note

Each slice has a BOOLEAN marker associated to it.

Parameters:pValue (bool) – true to set the entire slices’ marker on, false otherwise
setAreAllZSlicesDataAvailable(self, pValue: bool) → None

Sets the availability of all Z slices’ data.

Note

The channel can be set to work in “lazy” mode, where slices are made available as they are read.

Parameters:pValue (bool) – true to set the entire Z slices’ data as available, false otherwise
setDICOMAttribute(self, sValue: str, iTIndex: int, iZIndex: int, pGroup: int, pElement: int, bReplaceExisting: bool) → bool

Sets a string DICOM attribute.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Note

Applicable to the following VRs: AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, OB, OF, OW, PN, SH, SL, SS, ST, TM, UI, UL, US, UT.

Parameters:
  • sValue (str) – the string value (a string)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • pGroup (int) – the group number (a uint16_t)
  • pElement (int) – the element number (a uint16_t)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeDouble(self, iValue: float, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets a double DICOM attribute.

Note

Applicable to the following VRs: DS, FD.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (float) – the value (a double)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeFloat(self, iValue: float, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets a float DICOM attribute.

Note

Applicable to the following VRs: FL, OF.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint16_t.

Parameters:
  • iValue (float) – the value (a float)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeInt(self, iValue: int, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets a signed 32 bit DICOM attribute.

Note

Applicable to the following VRs: IS, SL, SS, UL, US.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (int) – the value (an int)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeShort(self, iValue: int, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets a signed 16 bit DICOM attribute.

Note

Applicable to the following VRs: SS.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (int) – the value (a short)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeUnsignedChar(self, iValue: int, iTIndex: int, iZIndex: int, pGroup: int, pElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets an unsigned 8 bit DICOM attribute.

Note

Applicable to the following VRs: OB.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (int) – the value (an short char)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • pGroup (int) – the group number (a uint16_t)
  • pElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeUnsignedInt(self, iValue: int, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets an unsigned 32 bit DICOM attribute.

Note

Applicable to the following VRs: UL.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (int) – the value (a uint32_t)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMAttributeUnsignedShort(self, iValue: int, iTIndex: int, iZIndex: int, iGroup: int, iElement: int, iIndex: int, bReplaceExisting: bool) → bool

Sets an unsigned 16 bit DICOM attribute.

Note

Applicable to the following VRs: OW, US.

Note

To apply to all slices, set the T and Z index to -1. The T and Z values’ true type is uint32_t.

Parameters:
  • iValue (int) – the value (a uint16_t)
  • iTIndex (int) – the T index (an int64_t, see note)
  • iZIndex (int) – the slice index (an int64_t, see note)
  • iGroup (int) – the group number (a uint16_t)
  • iElement (int) – the element number (a uint16_t)
  • iIndex (int) – index of the item in case of multi-valued elements (0..vm-1)
  • bReplaceExisting (bool) – true to replace an existing value, false otherwise
Returns:

output (bool) – true if successful, false otherwise

setDICOMContainer(self, iTIndex: int, iZIndex: int, sData: int) → None

Private.

Parameters:
  • iTIndex (int) –
  • iZIndex (int) –
  • sData (bytes) –
setDataDescription(self, pChannelDescriptionEnumValue: int) → None

Sets the channel description.

Note

Channel description is used to categorize channels.

Note

See the constants defined in ORS_def.h, enum CxvChannel_Description, for valid values.

Parameters:pChannelDescriptionEnumValue (int) – a description index (a int32_t*)
setDataRange(self, pValue: float) → None

Sets the size of the spread of data.

Note

Normally the channel knows its data spread, for example the spread of an 8 bit channel is 256 (from 0 to 255). This method becomes useful when it is known that the pixel data is smaller that the data type. For example, it is common for DICOM data to have its pixel data represented in 12 bits, but the data is stored in 16 bits.

Parameters:pValue (float) – a value (a double)
setDataType(self, pDataType: int) → None

Sets the channel data type.

Note

See CxvChannel_Data_Type (in ORS_def.h) for supported data types.

Parameters:pDataType (int) –
setDataUnit(self, bDimensionalUnit: str) → None

Sets the channel data unit description.

Parameters:bDimensionalUnit (str) – a string
setDimensionUnit(self, dimUnit: ORSModel.ors.DimensionUnit) → None

Sets the channel’s dimension unit.

Parameters:dimUnit (ORSModel.ors.DimensionUnit) –
setInitialWindowLevelValues(self, pWidth: float, pCenter: float) → None

Sets the initial window leveling value.

Note

This leveling will only be applied when the channel is first shown in a volume.

Note

Two special values are accepted: -1 means to normalize from the channel data spread, and 0 means to use no leveling at all.

Parameters:
  • pWidth (float) – the window width (a double)
  • pCenter (float) – the window center (a double)
setIsData3D(self, pValue: bool) → None

Sets the channel to be true 3D data or not.

Note

Normally channels hold 3D data, but there are cases where it is known that the data is not 3D (for example, stacks of screenshots). In those cases channels need to be told that they do not hold 3D data.

Parameters:pValue (bool) – true if data is 3D, false otherwise
setIsLossy(self, pValue: bool) → None

Sets the channel to be lossy or not.

Note

A channel can be lossy for two different reasons:

Parameters:pValue (bool) – true if data is lossy, false otherwise
setIsMarkedSlice(self, pTIndex: int, pZSlice: int, pValue: bool) → None

Sets a slice to be marked or not.

Note

Each slice has a BOOLEAN marker associated to it.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
  • pValue (bool) – true to set the slice to be marked, false otherwise
setIsZSliceDataAvailable(self, pTIndex: int, pZSlice: int, pValue: bool) → None

Sets the availability of a Z slice’s data.

Note

The channel can be set to work in “lazy” mode, where slices are made available as they are read.

Parameters:
  • pTIndex (int) – the T index (a uint32_t)
  • pZSlice (int) – the Z slice index (a uint32_t)
  • pValue (bool) – true to set the Z slice’s data available, false otherwise
setOffset(self, pOffset: float) → None

Sets the channel offset.

Parameters:pOffset (float) – the offset (a double)
setSavePixelDataWhileSavingNode(self, pFlag: int) → None

Controls if and how the channel should save its pixel data to XML.

Note

The save mode has these meanings:

Parameters:pFlag (int) – the save mode (a short between 0 and 2, see below)
setSerieHasBeenModified(self, seriesHasBeenChangedFlag: bool) → None
Parameters:seriesHasBeenChangedFlag (bool) –
setSliceDirection0Size(self, timeStep: int, sliceIndex: int, direction0Size: float) → None
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
  • direction0Size (float) –
setSliceDirection0Spacing(self, timeStep: int, sliceIndex: int, direction0Spacing: float) → None
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
  • direction0Spacing (float) –
setSliceDirection1Size(self, timeStep: int, sliceIndex: int, direction1Size: float) → None
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
  • direction1Size (float) –
setSliceDirection1Spacing(self, timeStep: int, sliceIndex: int, direction1Spacing: float) → None
Parameters:
  • timeStep (int) –
  • sliceIndex (int) –
  • direction1Spacing (float) –
setSliceOrientation(self, pTIndex: int, pZSlice: int, index: int, value: float) → None

Sets the orientation of a given slice.

Note

First three indicies indicate X orientation, next three indicate Y orientation and last three are for Z.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t)
  • index (int) – an index (from 0 to 9)
  • value (float) – the orientation value (a double)
setSlicePosition(self, pTIndex: int, pZSlice: int, pPosition: ORSModel.ors.Vector3) → None

Sets the position of a given slice.

Parameters:
  • pTIndex (int) – the T index (an uint32_t)
  • pZSlice (int) – the Z slice index (an uint32_t
  • pPosition (ORSModel.ors.Vector3) – a position (an Vector3)
setSliceRectangle(self, timeStep: int, sliceIndex: int, pBoundedPlane: ORSModel.ors.Rectangle) → None
Parameters:
setSlope(self, pSlope: float) → None

Sets the channel slope.

Parameters:pSlope (float) – the slope (a double)
setSpacingValidity(self, bXSpacing: bool, bYSpacing: bool, bZSpacing: bool) → None

Sets if the channel has valid spacing.

Parameters:
  • bXSpacing (bool) – validity of X spacing
  • bYSpacing (bool) – validity of Y spacing
  • bZSpacing (bool) – validity of Z spacing
setSubset(self, pSourceChannel: ORSModel.ors.Channel, xMinSource: int, yMinSource: int, zMinSource: int, tMinSource: int, xSize: int, ySize: int, zSize: int, tSize: int, xMinDestination: int, yMinDestination: int, zMinDestination: int, tMinDestination: int) → None

Writes a channel subset into the current channel data.

Parameters:
  • pSourceChannel (ORSModel.ors.Channel) – the channel to read the data from (the “source”)
  • xMinSource (int) – the first index in X to copy from the source channel (a uint32_t)
  • yMinSource (int) – the first index in Y to copy from the source channel (a uint32_t)
  • zMinSource (int) – the first index in Z to copy from the source channel (a uint32_t)
  • tMinSource (int) – the first index in T to copy from the source channel (a uint32_t)
  • xSize (int) – the number of pixels in X to copy from the source channel (a uint32_t)
  • ySize (int) – the number of pixels in Y to copy from the source channel (a uint32_t)
  • zSize (int) – the number of pixels in Z to copy from the source channel (a uint32_t)
  • tSize (int) – the number of pixels in T to copy from the source channel (a uint32_t)
  • xMinDestination (int) – the index in X of the first pixel to copy into the current channel (a uint32_t)
  • yMinDestination (int) – the index in Y of the first pixel to copy into the current channel (a uint32_t)
  • zMinDestination (int) – the index in Z of the first pixel to copy into the current channel (a uint32_t)
  • tMinDestination (int) – the index in T of the first pixel to copy into the current channel (a uint32_t)
setTimeFrame(self, pTimeStep: int, pYear: int, pMonth: int, pDay: int, pHour: int, pMinutes: int, pSeconds: int, pMicroSeconds: int) → None

Sets the value of a time frame.

Note

Time frames represent the exact time at each T increment.

Parameters:
  • pTimeStep (int) – the T index (a uint32_t)
  • pYear (int) – the year (a uint16_t)
  • pMonth (int) – the month (a uint16_t)
  • pDay (int) – the day (a uint16_t)
  • pHour (int) – the hour (a uint16_t)
  • pMinutes (int) – the minutes (a uint16_t)
  • pSeconds (int) – the seconds (a uint16_t)
  • pMicroSeconds (int) – the microseconds (a uint32_t)
shape
swapSliceData(self, iTSource: int, iZSource: int, iTTarget: int, iZTarget: int) → None

Swap two slices.

Note

If any index is invalid no swap occurs.

Parameters:
  • iTSource (int) – T source index (an uint32_t)
  • iZSource (int) – Z source index (an uint32_t)
  • iTTarget (int) – T target index (an uint32_t)
  • iZTarget (int) – Z target index (an uint32_t)
transform(self, transformationMatrix: ORSModel.ors.Matrix4x4) → None
Parameters:transformationMatrix (ORSModel.ors.Matrix4x4) –
updateCrossSection(self, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, timeStep: int, pInChannel: ORSModel.ors.Channel) → None
Parameters:
updateSliceMatricesWithGlobalMatrixValue(self) → None
zeros(shape, dtype=<class 'numpy.uint8'>)

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:
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:
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:
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:
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:
Returns:

output (ORSModel.ors.Vector3) –

getLabelAtPosition(self, tIndex: int, worldPosition: ORSModel.ors.Vector3) → int
Parameters:
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:
Returns:

output (ORSModel.ors.Vector3) –

getShape3DGrownToContain(self, aShape: ORSModel.ors.Shape3D, timeIndex: int) → Shape3D
Parameters:
Returns:

output (ORSModel.ors.Shape3D) –

getSliceAtIndex(self, zIndex: int, inStructuredGridSlice: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → StructuredGrid
Parameters:
Returns:

output (ORSModel.ors.StructuredGrid) –

getSliceIntersectingBoundedPlane(self, aBoundedPlane: ORSModel.ors.Rectangle, inStructuredGridSlice: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → StructuredGrid
Parameters:
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:
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:
paintBoxIfInRange(self, pBox: ORSModel.ors.Box, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None
Parameters:
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:
paintBoxIntersectingMultiROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingMultiROI: ORSModel.ors.MultiROI, fHightlightOpacity: float, fHightlightOpacityOutRange: float, intersectingMultiROIClipBox: ORSModel.ors.Box) → None
Parameters:
paintBoxIntersectingROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box) → None
Parameters:
paintCircleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None
Parameters:
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:
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:
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:
paintPolygonOnPlane(self, pPlane: ORSModel.ors.Rectangle, polygonWorldPos: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None
Parameters:
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:
paintRectangleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Length: float, dir1Length: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None
Parameters:
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:
paintRemoveBox(self, pBox: ORSModel.ors.Box, tStep: int) → None

Removes a box (3D object) from the receiver.

Parameters:
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:
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:
paintShape3D(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int) → None
Parameters:
paintShape3DIfInRange(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None
Parameters:
paintSphere(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int) → None
Parameters:
paintSphereIfInRange(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None
Parameters:
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:
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:
paintSphereIntersectingROI(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box) → None
Parameters:
paintSquareOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble) → None
Parameters:
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:
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:
paintVoxelsFromWorldCoordinatesIfInRange(self, worldPositionArray: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid) → None
Parameters:
projectInto(self, aDestinationStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) → None

Copies the receiver into the destination, keeping the destination shape.

Parameters:
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.Managed

brief_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:
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:
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:
Returns:

output (bool) – true if successful, false otherwise

Managed

class ORSModel.ors.Managed

Bases: ORSModel.ors.ORSBaseClass

brief_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]) –