ConvolutionHelper

Inheritance diagram

Inheritance diagram of ORSModel.ors.ConvolutionHelper, ORSModel.ors.Unmanaged, ORSModel.ors.ORSBaseClass

Classes

ConvolutionHelper

class ORSModel.ors.ConvolutionHelper(self)

Bases: Unmanaged

fastGaussian2D(self, pInputChannel: ORSModel.ors.Channel, nMinZ: int, nMaxZ: int, nMinT: int, nMaxT: int, pKernelSize: int, standarDeviation: float, nBorderHandling: int, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

get1DConvolution(self, inputValues: ORSModel.ors.Array, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, values: ORSModel.ors.Array) ORSModel.ors.Array

Convolutes a given 1D kernel through a Float array.

Note

The convolution’s size needs to be an odd number.

Note

The kernel is a one dimension array where the dimension is of equal size to the convolution.

Parameters:
  • inputValues (ORSModel.ors.Array) – the input array (an ORS::Array)

  • pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (a ORS::ConvolutionKernel, see note below)

  • nBorderHandling (int) – The border handling algorithm to use(an int). One of: CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution.

  • values (ORSModel.ors.Array) – an optional output array to fill (an Array)

Returns:

output (ORSModel.ors.Array) – the resulting output array (an Array)

get1DMedian(self, inputValues: ORSModel.ors.Array, kernelSize: int, nBorderHandling: int, values: ORSModel.ors.Array) ORSModel.ors.Array
Parameters:
Returns:

output (ORSModel.ors.Array) –

getClassNameStatic() str

getClassNameStatic

Returns:

output (str) –

getConvolution(self, pInputChannel: ORSModel.ors.Channel, nMinZ: int, nMaxZ: int, nMinT: int, nMaxT: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, nOutputChannelDatatype: int, bLeaveDataOfOutChannelOutsizeZRangeUnaffected: bool, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) ORSModel.ors.Channel

Note

The convolution’s size needs to be an odd number.

Note

The kernel is a two dimensional array where each dimension is of equal size to the convolution. Thus a convolution size of 5 needs a kernel of 5 x 5. It should be arranged in [y][x] order.

Note

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

Parameters:
Returns:

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

getConvolutionSubsetOnOther(self, pInputChannel: ORSModel.ors.Channel, xMinInput: int, yMinInput: int, zMinInput: int, tMinInput: int, xSize: int, ySize: int, zSize: int, tSize: int, xMinOutput: int, yMinOutput: int, zMinOutput: int, tMinOutput: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, nOutputChannelDatatypeIfOutputChannelIsNull: int, IProgress: ORSModel.ors.Progress, 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 of the minimal size needed to agree with the indexes of output specified.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the minimal y index of the input channel to compute the convolution on (an unsigned int)

  • xMinInput (int) – the minimal z (slice) index of the input channel to compute the convolution on (an unsigned int)

  • yMinInput (int) – the minimal t (time) index of the input channel to compute the convolution on (an unsigned int)

  • zMinInput (int) – the number of pixels to compute in x (an unsigned int)

  • tMinInput (int) – the number of pixels to compute in y (an unsigned int)

  • xSize (int) – the number of pixels to compute in z (an unsigned int)

  • ySize (int) – the number of time steps to compute (an unsigned int)

  • zSize (int) – the minimal x index of the output channel to write the result in (an unsigned int)

  • tSize (int) – the minimal y index of the output channel to write the result in (an unsigned int)

  • xMinOutput (int) – the minimal z index of the output channel to write the result in (an unsigned int)

  • yMinOutput (int) – the minimal t index of the output channel to write the result in (an unsigned int)

  • zMinOutput (int) – the kernel

  • tMinOutput (int) – The border handling algorithm to use(an int). One of: CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution.

  • pKernel (ORSModel.ors.ConvolutionKernel) – the data type of the output channel, if the output channel is not given

  • nBorderHandling (int) – a progress object (an Progress)

  • nOutputChannelDatatypeIfOutputChannelIsNull (int) – an optional output channel to fill(an Channel)

  • IProgress (ORSModel.ors.Progress) –

  • pOutChannel (ORSModel.ors.Channel) –

Returns:

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

getConvolutionSubsetOnSelf(self, pInputChannel: ORSModel.ors.Channel, xMinInput: int, yMinInput: int, zMinInput: int, tMinInput: int, xSize: int, ySize: int, zSize: int, tSize: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, IProgress: ORSModel.ors.Progress)

Convolutes a given 1D, 2D or 3D kernel through the channel’s data.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the input channel (an Channel), in which the result is written

  • xMinInput (int) – the minimal x index of the input channel to compute the convolution on (an unsigned int)

  • yMinInput (int) – the minimal y index of the input channel to compute the convolution on (an unsigned int)

  • zMinInput (int) – the minimal z (slice) index of the input channel to compute the convolution on (an unsigned int)

  • tMinInput (int) – the minimal t (time) index of the input channel to compute the convolution on (an unsigned int)

  • xSize (int) – the number of pixels to compute in x (an unsigned int)

  • ySize (int) – the number of pixels to compute in y (an unsigned int)

  • zSize (int) – the number of pixels to compute in z (an unsigned int)

  • tSize (int) – the number of time steps to compute (an unsigned int)

  • pKernel (ORSModel.ors.ConvolutionKernel) – the kernel

  • nBorderHandling (int) – The border handling algorithm to use(an int). One of: CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution.

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

getMaximumSubsetOnOther(self, pInputChannel: ORSModel.ors.Channel, xMinInput: int, yMinInput: int, zMinInput: int, tMinInput: int, xSize: int, ySize: int, zSize: int, tSize: int, xMinOutput: int, yMinOutput: int, zMinOutput: int, tMinOutput: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) ORSModel.ors.Channel

Gets the maximum value over a given 1D, 2D or 3D kernel through the channel’s data.

Note

If a channel is supplied as the last argument, the results are written to it, otherwise a new channel is created of the minimal size needed to agree with the indexes of output specified.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the input channel (a Channel)

  • xMinInput (int) – the minimal x index of the input channel to evaluate the maximum value on (a uint32_t)

  • yMinInput (int) – the minimal y index of the input channel to evaluate the maximum value on (a uint32_t)

  • zMinInput (int) – the minimal z (slice) index of the input channel to evaluate the maximum value on (a uint32_t)

  • tMinInput (int) – the minimal t (time) index of the input channel to evaluate the maximum value on (a uint32_t)

  • xSize (int) – the number of pixels to evaluate in x (a uint32_t)

  • ySize (int) – the number of pixels to evaluate in y (a uint32_t)

  • zSize (int) – the number of pixels to evaluate in z (a uint32_t)

  • tSize (int) – the number of time steps to evaluate (a uint32_t)

  • xMinOutput (int) – the minimal x index of the output channel to write the result in (a uint32_t)

  • yMinOutput (int) – the minimal y index of the output channel to write the result in (a uint32_t)

  • zMinOutput (int) – the minimal z index of the output channel to write the result in (a uint32_t)

  • tMinOutput (int) – the minimal t index of the output channel to write the result in (a uint32_t)

  • pKernel (ORSModel.ors.ConvolutionKernel) – the kernel

  • nBorderHandling (int) – The border handling algorithm to use(a uint16_t). One of CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution.

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

  • pOutChannel (ORSModel.ors.Channel) – an optional output channel to fill (a Channel)

Returns:

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

getMedian(self, pInputChannel: ORSModel.ors.Channel, nMinZ: int, nMaxZ: int, nMinT: int, nMaxT: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, nOutputChannelDatatype: int, bLeaveDataOfOutChannelOutsizeZRangeUnaffected: bool, IProgress: ORSModel.ors.Progress, pOutChannel: ORSModel.ors.Channel) ORSModel.ors.Channel
Parameters:
Returns:

output (ORSModel.ors.Channel) –

getMinimumSubsetOnOther(self, pInputChannel: ORSModel.ors.Channel, xMinInput: int, yMinInput: int, zMinInput: int, tMinInput: int, xSize: int, ySize: int, zSize: int, tSize: int, xMinOutput: int, yMinOutput: int, zMinOutput: int, tMinOutput: int, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, IProgress: ORSModel.ors.Progress, 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 of the minimal size needed to agree with the indexes of output specified.

Parameters:
  • pInputChannel (ORSModel.ors.Channel) – the minimal y index of the input channel to evaluate the minimum value on (a uint32_t)

  • xMinInput (int) – the minimal z (slice) index of the input channel to evaluate the minimum value on (a uint32_t)

  • yMinInput (int) – the minimal t (time) index of the input channel to evaluate the minimum value on (a uint32_t)

  • zMinInput (int) – the number of pixels to evaluate in x (a uint32_t)

  • tMinInput (int) – the number of pixels to evaluate in y (a uint32_t)

  • xSize (int) – the number of pixels to evaluate in z (a uint32_t)

  • ySize (int) – the number of time steps to evaluate (a uint32_t)

  • zSize (int) – the minimal x index of the output channel to write the result in (a uint32_t)

  • tSize (int) – the minimal y index of the output channel to write the result in (a uint32_t)

  • xMinOutput (int) – the minimal z index of the output channel to write the result in (a uint32_t)

  • yMinOutput (int) – the minimal t index of the output channel to write the result in (a uint32_t)

  • zMinOutput (int) – the kernel

  • tMinOutput (int) – The border handling algorithm to use(a uint16_t). One of: CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution.

  • pKernel (ORSModel.ors.ConvolutionKernel) – a progress object (a Progress)

  • nBorderHandling (int) – an optional output channel to fill (a Channel)

  • IProgress (ORSModel.ors.Progress) –

  • pOutChannel (ORSModel.ors.Channel) –

Returns:

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

getPaddingValue(self) float
Returns:

output (float) –

getZOffsetInputToOutputWithOutsideZRangeUnaffected(self) int
Returns:

output (int) –

none() ConvolutionHelper
Returns:

output (ConvolutionHelper) –

setPaddingValue(self, aValue: float)
Parameters:

aValue (float) –

setZOffsetInputToOutputWithOutsideZRangeUnaffected(self, aValue: int)
Parameters:

aValue (int) –

Unmanaged

class ORSModel.ors.Unmanaged

Bases: ORSBaseClass

Abstract class for objects that are not managed by the core library. Unmanaged objects are transient objects.

atomicLoad(sFilename: str) Unmanaged

Creates an object from a file where an object was saved.

Parameters:

sFilename (str) – path of the file to load

Returns:

output (Unmanaged) – an unmanaged object, or none() if the load fails

atomicSave(self, aFilename: str) int

Saves the object to a file.

Parameters:

aFilename (str) – path of the file to save

Returns:

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

createFromPythonRepresentation(aPythonRepresentation: str) ORSModel.ors.Unmanaged

Create aUnmanaged Object from a python representation a static method.

Parameters:

aPythonRepresentation (str) –

Returns:

output (ORSModel.ors.Unmanaged) –

fromPythonRepresentation(self, aPythonRepresentation: str) bool

Create aUnmanaged object from a Python string representation.

Parameters:

aPythonRepresentation (str) – a Python evaluable string representation (a string)

Returns:

output (bool) – true if parsing worked, false otherwise (a bool)

getClassName(self) str

Retrieves the class name of the core object wrapped by this Interface object.

Returns:

output (str) –

getClassNameStatic() str

getClassNameStatic

Returns:

output (str) –

getDataChecksum(self) str
Returns:

output (str) –

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

getPythonRepresentation(self) str

Gets a Python evaluable string representation.

Returns:

output (str) –

isNone(self) bool

Checks if the receiver is none.

Returns:

output (bool) –

isNotNone(self) bool

Checks if the receiver is not none.

Returns:

output (bool) –

none() Unmanaged
Returns:

output (Unmanaged) –

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