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(*args, **kwargs)

Bases: StructuredGrid

A 4D data container with configurable dimensions and type specifications.

Channel serves as a four-dimensional (XYZT) data container with the following key features:

  • Configurable depth based on channel type

  • Customizable data description

  • Adjustable spacing for data representation

  • Dynamic memory management for data storage

    1. Set XYZT dimensions

    2. Define channel type

    3. Initialize channel data structure

    4. Populate data array

See also

CxvChannel_Description

See also

CxvChannel_Data_Type

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)

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)

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) ORSModel.ors.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) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

applyLevelingAndGammaTransformationToData(self, minValue: float, maxValue: float, gamma: float)
Parameters:
  • minValue (float) –

  • maxValue (float) –

  • gamma (float) –

applyLevelingTransformationToData(self, minValue: float, maxValue: float)
Parameters:
  • minValue (float) –

  • maxValue (float) –

applyLinearTransformationToData(self, slope: float, offset: float)
Parameters:
  • slope (float) –

  • offset (float) –

convertToType(self, datatype: int, bNormalize: bool, iLowNormalizationRange: float, iHighNormalizationRange: float, bFilter: bool, iLowFilterRange: float, iHighFilterRange: float, iReplacementLowerValue: float, iReplacementUpperValue: float, outputChannel: ORSModel.ors.Channel, IProgress: ORSModel.ors.Progress) ORSModel.ors.Channel

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)

  • iReplacementLowerValue (float) – replacement lower value for the filter (a double)

  • iReplacementUpperValue (float) – replacement upper 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)

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)

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 = True)

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)

copyDataFromCommonRegionWithThicknessAverage(self, inputChannelToFill: ORSModel.ors.Channel, tOffset: int, IProgress: ORSModel.ors.Progress)

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:
  • inputChannelToFill (ORSModel.ors.Channel) – the companion channel (a Channel)

  • tOffset (int) – the time step to use in the channel (a uint32_t)

  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress)

copyDataFromCommonRegionWithThicknessMaxIntensityProjection(self, inputChannelToFill: ORSModel.ors.Channel, tOffset: int, IProgress: ORSModel.ors.Progress)

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:
  • inputChannelToFill (ORSModel.ors.Channel) – the companion channel (a Channel)

  • tOffset (int) – the time step to use in the channel (a uint32_t)

  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress)

copyDataFromCommonRegionWithThicknessMinIntensityProjection(self, inputChannelToFill: ORSModel.ors.Channel, tOffset: int, IProgress: ORSModel.ors.Progress)

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:
  • inputChannelToFill (ORSModel.ors.Channel) – the companion channel (a Channel)

  • tOffset (int) – the time step to use in the channel (a uint32_t)

  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress)

copyInto(self, aDestinationChannel: ORSModel.ors.Channel)

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)

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)

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)

emptySuggestedWindowLevelValues(self)

Cleans the suggested window leveling values.

executeGPGPUCommand(self, outputChannel: ORSModel.ors.Channel, shaderFilename: str, Slabsize: int, iNbIteration: int, numericArguments: dict, iKernelSize: int) ORSModel.ors.Channel

Compute given compute shader program on an channel.

Parameters:
  • outputChannel (ORSModel.ors.Channel) – the result channel (an ORS::Channel)

  • shaderFilename (str) – filename of the compute shader program (a string)

  • Slabsize (int) – the number of images in the input slab (an uint32_t)

  • iNbIteration (int) – number of iteration to run the program (an uint32_t)

  • numericArguments (dict) – a dictionnary of numeric arguments (an std::map)

  • iKernelSize (int) – size of the kernel (an uint32_t)

Returns:

output (ORSModel.ors.Channel) –

extractPhiThetaOrientationFromXYZVectorField(chanX: ORSModel.ors.Channel, chanY: ORSModel.ors.Channel, chanZ: ORSModel.ors.Channel, chanPhi: ORSModel.ors.Channel, chanTheta: ORSModel.ors.Channel) bool
Parameters:
Returns:

output (bool) – true if successfull

fillValueWithAssociatedScalarValue(self, sourcePosition: ORSModel.ors.Vector3, mesh: ORSModel.ors.Mesh, vertexScalarSlotId: int, iTIndex: int)

Note

The current channel represents the detector. Then, the origin and world coordinate position of the current structured grid matted for the computation.

Parameters:
  • sourcePosition (ORSModel.ors.Vector3) – source position in world coordinate (an ORS::Vector3)

  • mesh (ORSModel.ors.Mesh) – mesh (an ORS::Mesh)

  • vertexScalarSlotId (int) – the selected vertex Scalar Slot Id

  • iTIndex (int) – T index (an uint32_t)

fillValueWithCrossingMeshValue(self, sourcePosition: ORSModel.ors.Vector3, mesh: ORSModel.ors.Mesh, iTIndex: int)

(Context of a radiography) Compute the number of intersection of the mesh from a source, and store the value to the detector

Note

The current channel represents the detector. Then, the origin and world coordinate position of the current structured grid matted for the computation.

Parameters:
  • sourcePosition (ORSModel.ors.Vector3) – source position in world coordinate (an ORS::Vector3)

  • mesh (ORSModel.ors.Mesh) – mesh (an ORS::Mesh)

  • iTIndex (int) – T index (an uint32_t)

fillValueWithOpticalPath(self, sourcePosition: ORSModel.ors.Vector3, mesh: ORSModel.ors.Mesh, iTIndex: int)

(Context of a radiography) Compute the optical path of the mesh from a source, and store the value to the detector

Note

The current channel represents the detector. Then, the origin and world coordinate position of the current structured grid matted for the computation

Parameters:
  • sourcePosition (ORSModel.ors.Vector3) – source position in world coordinate (an ORS::Vector3)

  • mesh (ORSModel.ors.Mesh) – mesh (an ORS::Mesh)

  • iTIndex (int) – T index (an uint32_t)

getAllSliceIntersectionLength(self, arrayOfIntersectionLengthPerSlice: float, timeStep: int) float
Parameters:
  • arrayOfIntersectionLengthPerSlice (float) –

  • timeStep (int) –

Returns:

output (float) –

getAllSlicesHaveSameOrientation(self, pTIndex: int) bool

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.

See also

ORSModel.ors.Channel.setIsData3D(), getOrientationComparisonEpsilon()

Parameters:

pTIndex (int) –

Returns:

output (bool) – true if all slices have identical orientations, false otherwise

getAreAllZSlicesDataAvailable(self) bool

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)

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) ORSModel.ors.Channel
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) ORSModel.ors.Channel

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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

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

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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

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) ORSModel.ors.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) – an optional output channel (an ORSChannelPtr)

  • pOutChannel (ORSModel.ors.Channel) –

Returns:

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

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

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) ORSModel.ors.Channel

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) – an optional output channel (an ORSChannelPtr)

  • pOutChannel (ORSModel.ors.Channel) –

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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getAsChannelOpenWithKernel(self, pKernel: ORSModel.ors.ConvolutionKernel, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) ORSModel.ors.Channel
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) ORSModel.ors.Channel

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 padding value, normalized (a double)

  • yPadd (int) – an optional output channel (an ORSChannelPtr)

  • zPadd (int) –

  • pValue (float) –

  • pOutChannel (ORSModel.ors.Channel) –

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) ORSModel.ors.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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

Samples the channel data along a specified plane, interpolating the voxel values.

Note

The general plane equation used for sampling is ax + by + cz + d = 0.

Note

The up-vector (upX, upY, upZ) helps determine the plane’s orientation.

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 coefficient of the x-term in the plane equation.

  • b (float) –

    • The coefficient of the y-term in the plane equation.

  • c (float) –

    • The coefficient of the z-term in the plane equation.

  • d (float) –

    • The constant term in the plane equation (ax + by + cz + d = 0).

  • upX (float) –

    • The x-component of the up-vector used to define the orientation of the plane.

  • upY (float) –

    • The y-component of the up-vector used to define the orientation of the plane.

  • upZ (float) –

    • The z-component of the up-vector used to define the orientation of the plane.

  • timeStep (int) –

    • The time step at which to sample the channel.

  • pInChannel (ORSModel.ors.Channel) –

    • The input channel containing the voxel data to be sampled.

Returns:

output (ORSModel.ors.Channel) – A new channel containing the interpolated voxel values from the specified plane.

getAsChannelSampledInterpolatedFromPlane2(self, aBoundedPlane: ORSModel.ors.Rectangle, nearest: bool, timeStep: int, pInChannel: ORSModel.ors.Channel) ORSModel.ors.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) –

    • timestep

  • pInChannel (ORSModel.ors.Channel) – an optional output channel (a 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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

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) ORSModel.ors.Channel

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, pMesh: ORSModel.ors.Mesh) ORSModel.ors.Mesh

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) – true to snap vertices to contour, false to interpolate

  • bSnapToContour (bool) – true flips normals, false doesn’t

  • flipNormal (bool) – the time step to use in the channel (an uint32_t)

  • timeStep (int) – the X sampling (a uint16_t, 1 means no sampling)

  • xSample (int) – the Y sampling (a uint16_t, 1 means no sampling)

  • ySample (int) – the Z sampling (a uint16_t, 1 means no sampling)

  • zSample (int) – true to sample to nearest value, false to sample linearly (if sampling is 1 this flag is ignored)

  • pNearest (bool) – true to have the resulting mesh in world coordinates, false in local

  • pWorld (bool) – a progress object (an ORSProgressPtr) to show a progress bar, NULL doesn’t show one

  • pMesh (ORSModel.ors.Mesh) –

Returns:
getAsMultiROIInArea(self, minX: int, minY: int, minZ: int, maxX: int, maxY: int, maxZ: int, IProgress: ORSModel.ors.Progress, pInputMultiROI: ORSModel.ors.MultiROI) ORSModel.ors.MultiROI

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) ORSModel.ors.ROI

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) ORSModel.ors.ROI

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) ORSModel.ors.ROI

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) ORSModel.ors.ROI

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) ORSModel.ors.ROI

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

getCalibrationKey1(self) str

Gets the channel first calibration key.

Returns:

output (str) – the first calibration key (a string)

getCalibrationKey2(self) str

Gets the channel second calibration key.

Returns:

output (str) – the second calibration key (a string)

getCalibrationRawValue1(self) float

Gets the channel raw value associated to the first calibration key.

Returns:

output (float) – the raw value associated to the first calibration key (a double)

getCalibrationRawValue2(self) float

Gets the channel raw value associated to the second calibration key.

Returns:

output (float) – the raw value associated to the second calibration key (a double)

getChannelLocalMaxAsROI(self, pKernel: ORSModel.ors.ConvolutionKernel, fMinValue: float, fMaxValue: float, pOutROI: ORSModel.ors.ROI) ORSModel.ors.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) ORSModel.ors.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) –

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

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

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

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

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

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.

See also

CxvChannel_Description, ORSModel.ors.Channel.setDataDescription()

Returns:

output (int) – a description index (a int32_t*)

getDataRange(self) float

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) ORSModel.ors.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

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) ORSModel.ors.Array
Parameters:
Returns:

output (ORSModel.ors.Array) –

getInterpolatedPositionOnSlice(self, pTIndex: int, pZSlice: float, xPos: float, yPos: float) ORSModel.ors.Vector3

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) ORSModel.ors.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

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

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, perSlice: bool, IProgress: ORSModel.ors.Progress, pInVolumeROI: ORSModel.ors.ROI, pOutData: ORSModel.ors.MultiROI) ORSModel.ors.MultiROI

Note

This method labels areas of the channel by finding adjacent voxels and labelling them with sequential numbering.

Note

The perSlice parameter is useful when loading a time series of 2d images as a 3d volume.

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

  • perSlice (bool) – a progress object (an Progress), or NULL for no progress

  • IProgress (ORSModel.ors.Progress) – if True, labelling will only apply within an xy slice.

  • 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) ORSModel.ors.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
Returns:

output (float) –

getMaximumValueInPhysicalUnits(self) float

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

output (float) –

getMicroscopySurfaceCorrection(self, depthMap: ORSModel.ors.Channel, zSpacing: float, iTIndex: int) ORSModel.ors.Channel

(Context of microscopy) Compute a surface correction (2.5D image) from depth map

Parameters:
  • depthMap (ORSModel.ors.Channel) – the depth image (an ORS::Channel)

  • zSpacing (float) – the z spacing of the corrected image output (a float)

  • iTIndex (int) – T index (an uint32_t)

Returns:

output (ORSModel.ors.Channel) –

getMinMaxMeanAlongAnnotationWithDiskOrSquare(self, annotation: ORSModel.ors.Annotation, radius: float, nbPoint: int, timestep: int, min: ORSModel.ors.ArrayDouble, max: ORSModel.ors.ArrayDouble, mean: ORSModel.ors.ArrayDouble, samplingPointsX: ORSModel.ors.ArrayDouble, samplingPointsY: ORSModel.ors.ArrayDouble, samplingPointsZ: ORSModel.ors.ArrayDouble, isDisk: bool, useLinearInterpolation: bool) bool
Parameters:
  • annotation (ORSModel.ors.Annotation) – the annotation along which to compute the arrays

  • radius (float) – the radius (diagonal in case of the square) of the shape around the annotation where used for the computation (a double)

  • nbPoint (int) – the number of points taken along the annotation (a uint32_t)

  • timestep (int) – if true, the points will be reordered to have a counter-clockwise winding; if false, the windinw will be clockwise.

  • min (ORSModel.ors.ArrayDouble) – the array where the computed min values are stored

  • max (ORSModel.ors.ArrayDouble) – the array where the computed max values are stored

  • mean (ORSModel.ors.ArrayDouble) – the array where the computed mean values are stored

  • samplingPointsX (ORSModel.ors.ArrayDouble) – the array where the x position of the points taken along the annotation are stored

  • samplingPointsY (ORSModel.ors.ArrayDouble) – the array where the y position of the points taken along the annotation are stored

  • samplingPointsZ (ORSModel.ors.ArrayDouble) – the array where the z position of the points taken along the annotation are stored

  • isDisk (bool) – if true, the shape constructed for the computation will be a disk

  • useLinearInterpolation (bool) – if true, the channel values will be interpolated by linear interpolation

Returns:

output (bool) –

getMinMaxSubsetAsVector(self, xmin: int, ymin: int, zmin: int, tmin: int, xmax: int, ymax: int, zmax: int, tmax: int) ORSModel.ors.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
Returns:

output (float) –

getMinimumValueInPhysicalUnits(self) float

Note

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

Returns:

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

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

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:

output (int) – the number of pairs (a uint16_t)

getOffset(self) float

Gets the channel offset.

Returns:

output (float) – the offset (a double)

getOrientationComparisonPrecision() float

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=None)

Get the Otsu Threshold

Parameters:
  • timestep (int) – timestep to analyse

  • bins (int) – bin count for the calculation

getPhysicalMax(self) float

Note

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

Returns:

output (float) –

getPhysicalMin(self) float

Note

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

Returns:

output (float) –

getPositionOnLine(self, pT: int, iZSlice: int, iYLine: int, xIndex: float) ORSModel.ors.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) ORSModel.ors.Vector3

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)

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) ORSModel.ors.ArrayDouble

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) ORSModel.ors.ArrayDouble

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

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) ORSModel.ors.Vector3
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) ORSModel.ors.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)

getSobel(is3D: bool = True, sigma: int = 1)

Apply Sobel filter (with Gaussian before) and output the resulting new channel

Parameters:
  • is3D (bool) – Determines if the sobel should be 2D or 3D

  • sigma (int) – sigma used for the gaussian kernel

Return:

the output Channel that is the result of the Sobel filtering

Rtype:

ORSModel.ors.Channel

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

Note

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

See also

getSuggestedWIndowLevelCenterAt(), ORSModel.ors.Channel.getNumberOfSuggestedWindowLevelValues()

Parameters:

pIndex (int) – the index (a uint16_t)

Returns:

output (float) – the window center (a double)

getSuggestedWindowLevelWidthAt(self, pIndex: int) float

Note

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

See also

getSuggestedWIndowLevelCenterAt(), ORSModel.ors.Channel.getNumberOfSuggestedWindowLevelValues()

Parameters:

pIndex (int) – the index (a uint32_t)

Returns:

output (float) – the window width (a double)

getTRawDataChunk(self, iLevel1: int) int

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 (unsigned char**)

getTimeFrame(self, pTimeStep: int)

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) ORSModel.ors.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) –

getValueAsDoubleAtWorldCoordinateCubic(self, aWorldCoordinate: ORSModel.ors.Vector3, tIndex: int) float

Get cubic interpolated value at world position.

Note

return 0 if the world coordinate is outside of the Channel

Parameters:
  • aWorldCoordinate (ORSModel.ors.Vector3) – a world coordinate (a Vector3)

  • tIndex (int) – the T index (an uint32_t)

Returns:

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

getValueAsDoubleAtWorldCoordinateLinear(self, aWorldCoordinate: ORSModel.ors.Vector3, tIndex: int) float

Get linear interpolated value at world position.

Note

return 0 if the world coordinate is outside of the Channel

Parameters:
  • aWorldCoordinate (ORSModel.ors.Vector3) – a world coordinate (a Vector3)

  • tIndex (int) – the T index (an uint32_t)

Returns:

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

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

Get nearest interpolated value at world position.

Note

return 0 if the world coordinate is outside of the Channel

Parameters:
  • aWorldCoordinate (ORSModel.ors.Vector3) – a world coordinate (a Vector3)

  • tIndex (int) – the T index (an uint32_t)

Returns:

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

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

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

initializeDataForFLOAT(self) bool

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

initializeDataForUCHAR(self) bool

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

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) ORSModel.ors.Channel

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: bytes)

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

mergeWithBAndProjectInC(self, channelB: ORSModel.ors.Channel, channelC: ORSModel.ors.Channel, IProgress: ORSModel.ors.Progress)

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

Note

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

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

Move the data from the source channel to the target channel, adding to the target channel’s data.

Note

After calling this method, the source channel has no pixel data.

Parameters:

otherChannel (ORSModel.ors.Channel) – The channel to move data into (a Channel)

Returns:

output (bool) –

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

Move the data from the source channel to the target channel.

Note

After calling this method, the source channel has no pixel data.

Parameters:

otherChannel (ORSModel.ors.Channel) – The channel to move data into (a Channel)

Returns:

output (bool) –

moveSlicedata(self, zIndex: int, timeStep: int, xTranslation: int, yTranslation: int)
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) –

overwriteRangeWithValue(self, minValue: float, maxValue: float, replacementValue: float)

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

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)

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)

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)
Parameters:
overwriteValueWithMultiROIConsideringOpacity(self, aMultiROI: ORSModel.ors.MultiROI, labelOffset: int, fHightlightOpacity: float, fHightlightOpacityOutRange: float, fROIOpacity: float, fROIOpacityOutRange: float)
Parameters:
  • aMultiROI (ORSModel.ors.MultiROI) –

  • labelOffset (int) –

  • fHightlightOpacity (float) –

  • fHightlightOpacityOutRange (float) –

  • fROIOpacity (float) –

  • fROIOpacityOutRange (float) –

overwriteValueWithMultiROIOnSubBox(self, aMultiROI: ORSModel.ors.MultiROI, labelOffset: int, subBox: ORSModel.ors.Box, iTIndex: int = 0)

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:
overwriteValueWithMultiROIOnSubBoxConsideringOpacity(self, aMultiROI: ORSModel.ors.MultiROI, labelOffset: int, subBox: ORSModel.ors.Box, fHightlightOpacity: float, fHightlightOpacityOutRange: float, fROIOpacity: float, fROIOpacityOutRange: float, iTIndex: int = 0)

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:
  • aMultiROI (ORSModel.ors.MultiROI) – the time step index (uint32_t)

  • labelOffset (int) –

  • subBox (ORSModel.ors.Box) –

  • fHightlightOpacity (float) –

  • fHightlightOpacityOutRange (float) –

  • fROIOpacity (float) –

  • fROIOpacityOutRange (float) –

  • iTIndex (int) –

overwriteValueWithROI(self, aVolumeROI: ORSModel.ors.ROI, pReplacementValue: float)
Parameters:
overwriteValueWithROIOnSubBox(self, aROI: ORSModel.ors.ROI, pReplacementValue: float, subBox: ORSModel.ors.Box, iTIndex: int = 0)

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:
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) ORSModel.ors.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) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

removeAllPrivateDICOMAttributes(self)

Removes all private DICOM attributes.

removeSlice(self, pSliceIndex: int)

Note

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

Parameters:

pSliceIndex (int) –

resetSettingsOfPhysicalTransformation()

Resets the settings associated to the transformation to physical values. Slope is set as 1.0, offset is set as 0.0, dimensionUnit is set as generic continuous and calibration values are erased.

Dirty flags: OrsDataDirty

setAllData(self, aValue: float)

Dirty flags: OrsDataDirty

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 = 0)

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)

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)

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

setCalibrationValues(self, sCalibrationKey1: str, calibrationRawValue1: float, sCalibrationKey2: str, calibrationRawValue2: float)

Sets the channel’s calibration values.

Dirty flags: OrsDataDirty

Note

This is only to store information about calibration. There is no enforcement of coherence with the slope/offset/dimension unit contained in the channel instance.

See also

ORSModel.ors.Channel.getCalibrationKey1(), getPreCalibratedValue1(), ORSModel.ors.Channel.getCalibrationKey2(), getPreCalibratedValue2()

Parameters:
  • sCalibrationKey1 (str) – the first calibration key to use from the dimension unit (a string)

  • calibrationRawValue1 (float) – the raw value of the channel associated to the first calibration key (a double)

  • sCalibrationKey2 (str) – the second calibration key to use from the dimension unit (a string)

  • calibrationRawValue2 (float) – the raw value of the channel associated to the second calibration key (a double)

setDICOMAttribute(self, sValue: str, iTIndex: int, iZIndex: int, pGroup: int, pElement: int, bReplaceExisting: bool) bool

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

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

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

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

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

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

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

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: bytes)

Private.

Parameters:
  • iTIndex (int) –

  • iZIndex (int) –

  • sData (bytes) –

setDataDescription(self, pChannelDescriptionEnumValue: int)

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.

See also

CxvChannel_Description, ORSModel.ors.Channel.getDataDescription()

Parameters:

pChannelDescriptionEnumValue (int) – a description index (a int32_t*)

setDataRange(self, pValue: float)

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)

Sets the channel data type.

Dirty flags: OrsDataDirty

Note

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

Parameters:

pDataType (int) –

setDataUnit(self, bDimensionalUnit: str)

Sets the channel data unit description.

Parameters:

bDimensionalUnit (str) – a string

setDimensionUnit(self, dimUnit: ORSModel.ors.DimensionUnit)

Sets the channel’s dimension unit.

Dirty flags: OrsDataDirty

Parameters:

dimUnit (ORSModel.ors.DimensionUnit) – the dimension unit (a DimensionUnit)

setInitialWindowLevelValues(self, pWidth: float, pCenter: float)

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)

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)

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)

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)

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)

Sets the channel offset.

Dirty flags: OrsDataDirty

Parameters:

pOffset (float) – the offset (a double)

setSavePixelDataWhileSavingNode(self, pFlag: int)

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

seriesHasBeenChangedFlag (bool) –

setSliceDirection0Size(self, timeStep: int, sliceIndex: int, direction0Size: float)
Parameters:
  • timeStep (int) –

  • sliceIndex (int) –

  • direction0Size (float) –

setSliceDirection0Spacing(self, timeStep: int, sliceIndex: int, direction0Spacing: float)
Parameters:
  • timeStep (int) –

  • sliceIndex (int) –

  • direction0Spacing (float) –

setSliceDirection1Size(self, timeStep: int, sliceIndex: int, direction1Size: float)
Parameters:
  • timeStep (int) –

  • sliceIndex (int) –

  • direction1Size (float) –

setSliceDirection1Spacing(self, timeStep: int, sliceIndex: int, direction1Spacing: float)
Parameters:
  • timeStep (int) –

  • sliceIndex (int) –

  • direction1Spacing (float) –

setSliceOrientation(self, pTIndex: int, pZSlice: int, index: int, value: float)

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)
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)
Parameters:
setSlope(self, pSlope: float)

Sets the channel slope.

Dirty flags: OrsDataDirty

Parameters:

pSlope (float) – the slope (a double)

setSpacingValidity(self, bXSpacing: bool, bYSpacing: bool, bZSpacing: bool)

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)

Writes a channel subset into the current channel data.

Dirty flags: OrsDataDirty

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)

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)

swapSliceData(self, iTSource: int, iZSource: int, iTTarget: int, iZTarget: int)

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

transformationMatrix (ORSModel.ors.Matrix4x4) –

updateCrossSection(self, path: ORSModel.ors.VisualPath, aTransformationMatrix: ORSModel.ors.Matrix4x4, timeStep: int, pInChannel: ORSModel.ors.Channel)
Parameters:
updateSliceMatricesWithGlobalMatrixValue(self)

StructuredGrid

class ORSModel.ors.StructuredGrid(self, buffer: bytes, nBytes: int, bPreserveIdentity: bool = False)

Bases: Node

Parameters:
  • buffer (bytes) –

  • nBytes (int) –

  • bPreserveIdentity (bool) –

addROIAtTOffset(self, aROI: ORSModel.ors.ROI, label: int, pTOffset: int)

Note

The ROI to add will be projected correctly if it doesn’t share the same characteristics.

See also

AddROI(), MergeWithROI()

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)

Initializes the structured grid’s shape based on a box.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Parameters:
  • pBox (ORSModel.ors.Box) – a box (a Box)

  • tSize (int) – a T size (an uint32_t)

copyShapeFromRectangle(self, pRectangle: ORSModel.ors.Rectangle, zSpacing: float, tSize: int)

Initializes the structured grid’s shape based on a rectangle.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Parameters:
  • pRectangle (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)

Initializes the structured grid’s shape based on another structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

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) ORSModel.ors.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) ORSModel.ors.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.

See also

addToROI(), removeROI(), ORSModel.ors.StructuredGrid.getAsChannel()

Parameters:
Returns:

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

getAsROI(self, inOutStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) ORSModel.ors.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.

See also

addToROI(), removeROI(), ORSModel.ors.StructuredGrid.getAsChannel()

Parameters:
Returns:

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

getBoundingBox(self, pTIndex: int) ORSModel.ors.Box
Parameters:

pTIndex (int) –

Returns:

output (ORSModel.ors.Box) –

getBox(self) ORSModel.ors.Box

Gets the box.

Returns:

output (ORSModel.ors.Box) – the box (an Box)

getClassNameStatic() str

getClassNameStatic

Returns:

output (str) –

getDirtyBox(self, bResetDirtyBox: bool) ORSModel.ors.Box

Gets the dirty box.

Parameters:

bResetDirtyBox (bool) – insicate that the dirty box should be resetted (a bool)

Returns:

output (ORSModel.ors.Box) – the dirty box (a Box)

getHasNonZeroDataOnPlane(self, aPlane: ORSModel.ors.Plane, tStep: int) bool

Test to know if there is a non zero value on plain.

Parameters:
  • aPlane (ORSModel.ors.Plane) – a Plane (ORS::Plane)

  • tStep (int) – a time step (uint32_t)

Returns:

output (bool) – a bool (bool)

getHasNonZeroDataOnSlice(self, sliceIndex: int, timestep: int) bool
Parameters:
  • sliceIndex (int) –

  • timestep (int) –

Returns:

output (bool) –

getHasSameShape(self, pStructuredGrid: ORSModel.ors.StructuredGrid) bool

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) ORSModel.ors.Vector3
Parameters:
Returns:

output (ORSModel.ors.Vector3) –

getLabelAtPosition(self, tIndex: int, worldPosition: ORSModel.ors.Vector3) int
Parameters:
Returns:

output (int) –

getOrigin(self) ORSModel.ors.Vector3
Returns:

output (ORSModel.ors.Vector3) –

getOriginalBox(self) ORSModel.ors.Box
Returns:

output (ORSModel.ors.Box) –

getPositionOfFirstIntersectingNonZeroElement(self, aLine: ORSModel.ors.Line, subBox: ORSModel.ors.Box, timestep: int) ORSModel.ors.Vector3
Parameters:
Returns:

output (ORSModel.ors.Vector3) –

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

output (ORSModel.ors.Shape3D) –

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

output (ORSModel.ors.StructuredGrid) –

getSliceIntersectingBoundedPlane(self, aBoundedPlane: ORSModel.ors.Rectangle, inStructuredGridSlice: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) ORSModel.ors.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) ORSModel.ors.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:
Returns:

output (ORSModel.ors.StructuredGrid) – a StructuredGrid (see notes)

getSubsetFromBox(self, subBox: ORSModel.ors.Box, timeIndex: int, inSGSubset: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress) ORSModel.ors.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:
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) ORSModel.ors.Matrix4x4
Returns:

output (ORSModel.ors.Matrix4x4) –

getTransformationShape3D(self) ORSModel.ors.Shape3D
Returns:

output (ORSModel.ors.Shape3D) –

getValueAlongPrimitivePath(self, aPath: ORSModel.ors.VisualPath, nbPoint: int, timestep: int, values: ORSModel.ors.ArrayDouble, samplingPointsX: ORSModel.ors.ArrayDouble, samplingPointsY: ORSModel.ors.ArrayDouble, samplingPointsZ: ORSModel.ors.ArrayDouble)
Parameters:
getValueAlongPrimitiveRuler(self, aRuler: ORSModel.ors.VisualRuler, nbPoint: int, timestep: int, values: ORSModel.ors.ArrayDouble, samplingPointsX: ORSModel.ors.ArrayDouble, samplingPointsY: ORSModel.ors.ArrayDouble, samplingPointsZ: ORSModel.ors.ArrayDouble)
Parameters:
getValueAtPosition(self, worldPos: ORSModel.ors.Vector3, timestep: int, defaultValue: float = None) float
Parameters:
Returns:

output (float) –

getVoxelToWorldCoordinates(self, anIndex: ORSModel.ors.Vector3) ORSModel.ors.Vector3
Parameters:

anIndex (ORSModel.ors.Vector3) –

Returns:

output (ORSModel.ors.Vector3) –

getWorldToVoxelCoordinates(self, pPointInWorld: ORSModel.ors.Vector3) ORSModel.ors.Vector3

Gets a given voxel’s index from world coordinates.

Parameters:

pPointInWorld (ORSModel.ors.Vector3) – the voxel coordinate encoded in ORS::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)
Parameters:
paintBoxIfInRange(self, pBox: ORSModel.ors.Box, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid)
Parameters:
paintBoxIntersectingChannel(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingChannel: ORSModel.ors.Channel, levelingMinRange: float, levelingMaxRange: float, ILUT: ORSModel.ors.LookupTable, intersectingChannelClipBox: ORSModel.ors.Box)
Parameters:
paintBoxIntersectingMultiROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingMultiROI: ORSModel.ors.MultiROI, fHightlightOpacity: float, fHightlightOpacityOutRange: float, intersectingMultiROIClipBox: ORSModel.ors.Box)
Parameters:
paintBoxIntersectingROI(self, pBox: ORSModel.ors.Box, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box)
Parameters:
paintCircle(self, aCircle: ORSModel.ors.Circle, label: float, timeIndex: int)
Parameters:
paintCircleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, label: float, timeIndex: int)
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)
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)
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)
Parameters:
paintPolygonOnPlane(self, pPlane: ORSModel.ors.Rectangle, polygonWorldPos: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, worldPositionArray: ORSModel.ors.ArrayDouble)
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)
Parameters:
paintRectangleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, dir0Length: float, dir1Length: float, label: float, timeIndex: int)
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)
Parameters:
paintRemoveBox(self, pBox: ORSModel.ors.Box, tStep: int)

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

Parameters:
paintRemoveCircleOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, radius: float, timeIndex: int)

Removes a circle (2D object) from the receiver.

Parameters:
  • pPlane (ORSModel.ors.Rectangle) – The plane of the circle (a Rectangle)

  • worldPos (ORSModel.ors.Vector3) – The center of the circle (a Vector3)

  • radius (float) – The radius of the circle (a double)

  • timeIndex (int) – The T index (a uint32_t)

paintRemoveSphere(self, worldPos: ORSModel.ors.Vector3, fRadius: float, tStep: int)

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)

Removes a square (2D object) from the receiver.

Parameters:
  • pPlane (ORSModel.ors.Rectangle) – The plane of the square (a Rectangle)

  • worldPos (ORSModel.ors.Vector3) – The center of the square (a Vector3)

  • radius (float) – The radius (a double)

  • timeIndex (int) – The T index (a uint32_t)

paintShape3D(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int)
Parameters:
paintShape3DIfInRange(self, aShape: ORSModel.ors.Shape3D, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid)
Parameters:
paintSphere(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int)
Parameters:
paintSphereIfInRange(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, fMinValue: float, fMaxValue: float, pRangeChannel: ORSModel.ors.StructuredGrid)
Parameters:
paintSphereIntersectingChannel(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingChannel: ORSModel.ors.Channel, levelingMinRange: float, levelingMaxRange: float, ILUT: ORSModel.ors.LookupTable, intersectingChannelClipBox: ORSModel.ors.Box)
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)
Parameters:
paintSphereIntersectingROI(self, worldPos: ORSModel.ors.Vector3, fRadius: float, label: float, tStep: int, intersectingROI: ORSModel.ors.ROI, intersectingROIClipBox: ORSModel.ors.Box)
Parameters:
paintSquareOnPlane(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, width: float, label: float, timeIndex: int)
Parameters:
paintSquareOnPlaneIfInRange(self, pPlane: ORSModel.ors.Rectangle, worldPos: ORSModel.ors.Vector3, width: float, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid)
Parameters:
paintSubset(self, startX: int, startY: int, startZ: int, endX: int, endY: int, endZ: int, label: float, tStep: int)
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)
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)
Parameters:
paintVoxelsFromWorldCoordinatesIfInRange(self, worldPositionArray: ORSModel.ors.ArrayDouble, label: float, timeIndex: int, lowerThreshold: float, upperThreshold: float, pRangeChannel: ORSModel.ors.StructuredGrid)
Parameters:
projectInto(self, aDestinationStructuredGrid: ORSModel.ors.StructuredGrid, IProgress: ORSModel.ors.Progress)

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

Parameters:
removeROIAtTOffset(self, aROI: ORSModel.ors.ROI, pTOffset: int)

Note

The ROI to add will be projected correctly if it doesn’t share the same characteristics.

See also

removeROI(), MergeWithROI()

Parameters:
  • aROI (ORSModel.ors.ROI) – the ROI to remove (an ROI)

  • pTOffset (int) – the T offset (a uint32_t)

setBox(self, IInBox: ORSModel.ors.Box)

Sets the box.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Parameters:

IInBox (ORSModel.ors.Box) – the box (an Box)

setCurrentShapeAsOriginal(self)
setOrigin(self, origin: ORSModel.ors.Vector3)

Set the origin.

Dirty flags: OrsGeometryDirty

Parameters:

origin (ORSModel.ors.Vector3) – the new origin (a Vector3)

setTSize(self, pTSize: int)

Sets the T size of the structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Note

The T size is expressed in units.

Parameters:

pTSize (int) – T size (an uint32_t)

setTSpacing(self, pTSpacing: float)

Sets the structured grid’s T spacing.

Dirty flags: OrsGeometryDirty

Note

Spacing is used for structured grid visual representation.

Parameters:

pTSpacing (float) – T spacing (a double)

setTransformationShape3D(self, aShape: ORSModel.ors.Shape3D)
Parameters:

aShape (ORSModel.ors.Shape3D) –

setXSize(self, pXSize: int)

Sets the X size of the structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Note

The size is expressed in pixels.

Parameters:

pXSize (int) – X size (an uint32_t)

setXSpacing(self, pXSpacing: float)

Sets the structured grid’s X spacing.

Dirty flags: OrsGeometryDirty

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)

Sets the X,Y,Z,T sizes of the structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

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)

Sets the Y size of the structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Note

The size is expressed in pixels.

Parameters:

pYSize (int) – Y size (an uint32_t)

setYSpacing(self, pYSpacing: float)

Sets the structured grid’s Y spacing.

Dirty flags: OrsGeometryDirty

Note

Spacing is used for structured grid visual representation.

Parameters:

pYSpacing (float) – Y spacing (a double)

setZSize(self, pZSize: int)

Sets the Z size of the structured grid.

Dirty flags: OrsDataDirty, OrsGeometryDirty

Note

The size is expressed in pixels.

Parameters:

pZSize (int) – Z size (an uint32_t)

setZSliceThickness(self, pZThickness: float)

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)

Sets the structured grid’s Z spacing.

Dirty flags: OrsGeometryDirty

Note

Spacing is used for structured grid visual representation.

Parameters:

pZSpacing (float) – Z spacing (a double)

warpWithDeformationChannels(self, deformationChannelX: ORSModel.ors.Channel, deformationChannelY: ORSModel.ors.Channel, deformationChannelZ: ORSModel.ors.Channel, tIndex: int) ORSModel.ors.StructuredGrid
Parameters:
Returns:

output (ORSModel.ors.StructuredGrid) –

Node

class ORSModel.ors.Node(*args, **kwargs)

Bases: Managed

An abstract class for any object that can be a node in the visualization flow.

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) ORSModel.ors.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) ORSModel.ors.List

Returns a flattened list of the child hierarchy of the node.

Note

The child hierarchy is flattened.

Note

Expect a depth first search ordering of the nodes.

Returns:

output (ORSModel.ors.List) – a list of all nodes below the node (a List)

getAllChildrenOfClass(self, pProgId: str) ORSModel.ors.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 depth-first.

Note

Use static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name of the class to test against (a string)

Returns:

output (ORSModel.ors.List) – a list of nodes (a List)

getAllChildrenOfClassReachableByRenderer(self, pProgId: str) ORSModel.ors.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).

Note

Use static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.List

Returns a flattened list of the parent hierarchy of the node.

Note

The parent hierarchy is flattened.

Note

Expect a depth first search ordering of the nodes.

Returns:

output (ORSModel.ors.List) – a list of all nodes above the node (an List)

getAllParentsOfClass(self, pProgId: str) ORSModel.ors.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 depth-first.

Note

Use static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name of the class to test against (a string)

Returns:

output (ORSModel.ors.List) – a list of nodes (an List)

getChildWithGUID(self, aGUID: str) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.List

Returns the list of immediate child nodes.

Returns:

output (ORSModel.ors.List) – a list of nodes (an List)

getChildrenOfClass(self, pProgId: str) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:
  • pProgId (str) – the name 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) ORSModel.ors.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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:
  • pProgId (str) – the name 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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:
  • pProgId (str) – the name 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) ORSModel.ors.Matrix4x4
Parameters:
Returns:

output (ORSModel.ors.Matrix4x4) –

getImmediateChildOfClass(self, pProgId: str) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name 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) ORSModel.ors.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) ORSModel.ors.List

Gets the immediate parent nodes.

Returns:

output (ORSModel.ors.List) – a list of nodes (a List)

getParentWithGUID(self, pGUID: str) ORSModel.ors.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) ORSModel.ors.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 static class names to search for objects (e.g. ORS::ReferenceFrame::getClassNameStatic())).

Parameters:

pProgId (str) – the name of the class to test against (a string)

Returns:

output (ORSModel.ors.List) – a list of nodes (a List)

getVisual(self) ORSModel.ors.Visual
Returns:

output (ORSModel.ors.Visual) – the visual of a model (a Visual)

isVisibleInView(view: View) bool

Gets the visibility of the receiver in a given view.

Parameters:

view (ORSModel.ors.View) – The current view

Returns:

output (bool) – true if the receiver is visible, false otherwise

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 = False)

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)

Causes all 2D views in the parent hierarchy of the node to be refreshed.

refreshAll2DParentViewsIfVisible(self)

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)

Causes all 3D views in the parent hierarchy of the node to be refreshed.

refreshAll3DParentViewsIfVisible(self)

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)

Causes all views in the parent hierarchy of the node to be refreshed.

refreshAllParentViewsIfVisible(self)

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)

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(*args, **kwargs)

Bases: ORSBaseClass

An abstract class that implements all the default behavior of managed objects.

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)

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 saved.

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)

Loads an object from an XML string.

Parameters:

anXML (str) – an XML (a string)

Managed.atomicLoadFrom(self, buffer: bytes, nBytes: int)

Loads an object from a memory buffer. Used for python pickling.

Parameters:
  • buffer (bytes) – the buffer

  • nBytes (int) – the number of bytes in the buffer (a uint64_t)

Managed.atomicLoadFrom(self, stream: ORSModel.ors.Stream) -> int

Loads an object from a stream (using callback).

Parameters:

stream (ORSModel.ors.Stream) – the stream to read data from

Returns:

output (int) – 0 if successful, otherwise an error code

atomicLoadSpecificNode(self, aFilename: str, aXPathOfTheNodeToLoad: str) bool

Loads an object from a file containing several objects.

Parameters:
  • aFilename (str) – The file name, including entire path (a string)

  • aXPathOfTheNodeToLoad (str) – The XPath specification to find the node

Returns:

output (bool) – true if node was found and loaded, false otherwise

atomicSave(self, aFilename: str, isTemporary: bool = False, iCompressionEngine: int = 1) 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

  • iCompressionEngine (int) – the input compression engine (0: None, 1: ZSTD)

Returns:

output (int) – 0 if successful, otherwise an error code

atomicSaveToLegacyFormat(self, aFilename: str, isTemporary: bool = False, iCompressionEngine: int = 1) int

Saves the object to a file in the legacy (2022.2) format.

Parameters:
  • aFilename (str) – path of the file to save

  • isTemporary (bool) – if true, try to keep file in memory

  • iCompressionEngine (int) – the input compression engine (0: None, 1: ZSTD)

Returns:

output (int) – 0 if successful, otherwise an error code

atomicSaveToStream(self, stream: ORSModel.ors.Stream, iCompressionEngine: int = 1) int

Saves the object to a stream (through callback).

Parameters:
  • stream (ORSModel.ors.Stream) – stream object to save current object in

  • iCompressionEngine (int) – the input compression engine (0: None, 1: ZSTD)

Returns:

output (int) – 0 if successful, otherwise an error code

copy(self) ORSModel.ors.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)

method createScalarValuesCollection

deleteObject(self)

Explicitly deletes the core object wrapped by this Interface object.

deleteObjectAndAllItsChildren(self)

Explicitly deletes the core object wrapped by this Interface object, along with all its children.

ensureInitialization(self)

This is for the Python interface.

getAllGroupsContaining(self, anIObject: ORSModel.ors.Managed) ORSModel.ors.List

Gets all the groups that contain the given object.

Parameters:

anIObject (ORSModel.ors.Managed) –

Returns:

output (ORSModel.ors.List) –

getAllInstancesOf(pProgId: str) ORSModel.ors.List

Gathers all existing objects of the specified class.

Parameters:

pProgId (str) –

Returns:

output (ORSModel.ors.List) –

getAllObjectsOfClassAndPrivateTitle(pProgId: str, pPrivateTitle: str) ORSModel.ors.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) ORSModel.ors.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) ORSModel.ors.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)

getAllRepresentableInstancesOf(pProgId: str) ORSModel.ors.List

Gathers all existing objects of the specified class that are representable.

Parameters:

pProgId (str) –

Returns:

output (ORSModel.ors.List) –

getAllRepresentableObjects() ORSModel.ors.List

Gets all the representable objects of the world.

Returns:

output (ORSModel.ors.List) – a list containing all the representable objects

getAtomicTextRepresentation(self, bSelfContained: bool) str

Retrieves the object’s atomic text representation.

Parameters:

bSelfContained (bool) –

Returns:

output (str) –

getAutoDelete(self) bool

Gets the autodelete value.

Returns:

output (bool) –

getBinaryUserInfo(self, pTag: str)

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)

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

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 the computed checksum of the data.

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) – true if callbacks exist for the event, false otherwise

getHighlightDirtySignature()

Gets the current dirty signature for the flag OrsHighlightDirty

Returns:

highlightDirtySignature (int) – the dirty signature

getIsDirty(self, dirtyFlag: str) bool

Gets if the object is dirty for a specific dirty flag.

Parameters:

dirtyFlag (str) – dirty flag name (a string, see note below)

Returns:

output (bool) – true if object is dirty, false otherwise

getIsDirtyAnyDirtyFlag(self) bool

Gets if the object is dirty for any of the dirty flags.

Returns:

output (bool) – true if object is dirty, false otherwise

getIsEqualTo(self, aManaged: ORSModel.ors.Managed) bool

Checks if the two objects are equal.

Parameters:

aManaged (ORSModel.ors.Managed) – an object to compare with (a Managed)

Returns:

output (bool) – true if the receiver and the argument are equal (class dependent), false otherwise

getIsIdentityPreservedForPickling(self) bool

Returns True if the GUID is preserved when pickling and unpickling an object.

Returns:

output (bool) – Returns True if the GUID is preserved when pickling and unpickling an object

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

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

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 the computed checksum of the metadata.

Returns:

output (str) –

getObjectWithGUID(guid: str) ORSModel.ors.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

getObjectWithGUIDasPointer(guid: str) ORSModel.ors.Managed

Retrieves an object from its GUID.

Parameters:

guid (str) – a GUID (a string)

Returns:

output (ORSModel.ors.Managed) – An object or nullptr 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) ORSModel.ors.ScalarValuesCollection

method getScalarValuesCollection

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) ORSModel.ors.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)

getUserInfoAsDictionary()

User info copy of Managed in a easy way for manipulation

return a copy of the object user info as a dictionary

getUserInfoMatchingPattern(self, pattern: str, case_sensitive_search: bool) List[str]

Searches the user info dictionary based on a pattern matching.

Note

The pattern matching is done via regex.

Parameters:
  • pattern (str) – a search pattern (a string)

  • case_sensitive_search (bool) – true to search case-sensitive, false otherwise (a bool)

Returns:

output (List[str]) – a list of keys and values pairs, for all matching keys (a list of strings)

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

Checks if the underlying core object is None.

Note

Interface objects hold references to core objects, so this method checks to see if a core object is truly referred to.

Returns:

output (bool) – true if the core object is non-existent, false otherwise.

isNotNone(self) bool

Checks if the underlying core object is not None.

Note

Interface objects hold references to core objects, so this method checks to see if a core object is truly referred to.

Returns:

output (bool) – true if the core object is existent, false otherwise.

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)

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)

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)

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.

setAutoDelete(self, value: bool)

When set to true, the interface object will call deleteObject on its core object when it is being deleted.

Parameters:

value (bool) –

setBinaryUserInfo(self, pTag: str, pValue: bytes, iDataSize: int)

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)

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)

Sets the object as being dirty for a given aspect.

Note

A dirty object is an object that has changed, giving its observers a chance to refresh their view on the object. Several aspects of an object can be dirty, see ORS_def.h for dirty signature flags.

Parameters:

dirtyFlag (str) – dirty flag name (a string)

setEventCallbackEnabled(self, sEventName: str, sCallbackName: str, bValue: bool) bool

Enables/disables a callback subscription to an event.

Note

Works for all callback types (object, class and global)

Parameters:
  • sEventName (str) – event name (a string)

  • sCallbackName (str) – callback name (a string)

  • bValue (bool) – true to enable the callback, false to disable it

Returns:

output (bool) – true if callback subscription existed, false otherwise

setGeometryDirty()

Calls for a setDirty with the flag OrsGeometryDirty

setHighlightDirty()

Calls for a setDirty with the flag OrsHighlightDirty

setIdentityIsPreservedForPickling(self, value: bool)

Set to True if the GUID is to be preserved when pickling and unpickling an object.

Parameters:

value (bool) –

setIsNotDirty(self)

Sets the object as not being dirty for all dirty flags.

setIsRepresentable(self, isRepresentable: bool)

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)

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)

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)

Sets the private title of the object.

Note

The private title can later be used to find a reference to that object, given that it’s still alive.

Parameters:

newPrivateTitle (str) – a title (a string)

setPropertyDirty()

Calls for a setDirty with the flag OrsPropertyDirty

setTitle(self, newVal: str)

Sets the title of the object.

Dirty flags: OrsPropertyDirty

Anonymize newVal:

True

Parameters:

newVal (str) – new title (a string)

setUserInfo(self, pTag: str, pValue: str)
Parameters:
  • pTag (str) –

  • pValue (str) –

setUserInfoFromDictionary(aDic)

Add key value pair to the user Info of the Object. an str call are done on the key and values to insure that we respect the UserInfo protocol of Managed Object

Parameters:

aDic (dict) – a dictionary of information to add to the user information

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

An abstract class from which all objects issued from the ORS Core Library inherit.

getPythonTraceBack() List[str]

Set the python traceback for a call from python.

Returns:

output (List[str]) –

isManaged(self) bool
Returns:

output (bool) –

isNone(self) bool
Returns:

output (bool) –

setPythonTraceBack(tb: List[str])

Set the python traceback for a call from python.

Parameters:

tb (List[str]) –