ConvolutionHelper

Inheritance diagram

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

Classes

ConvolutionHelper

class ORSModel.ors.ConvolutionHelper

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

output (ORSModel.ors.Channel) –

get1DConvolution(self, inputValues: ORSModel.ors.Array, pKernel: ORSModel.ors.ConvolutionKernel, nBorderHandling: int, values: ORSModel.ors.Array) → 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.

Note

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

Parameters:
  • inputValues (ORSModel.ors.Array) – the input array (an Array)
  • pKernel (ORSModel.ors.ConvolutionKernel) – the kernel (a 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. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then convolve the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • 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) → 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) → Channel

Convolutes a given 2D kernel through the channel’s data.

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:
  • pInputChannel (ORSModel.ors.Channel) – the input channel (an Channel)
  • nMinZ (int) – the minimal z slice index (an int)
  • nMaxZ (int) – the maximal z slice index (an int)
  • nMinT (int) – the kernel (a double**, see note below)
  • nMaxT (int) – the convolution’s size (a short)
  • pKernel (ORSModel.ors.ConvolutionKernel) – The border handling algorithm to use(an int). One of: CXV_CONVOLUTION_BORDER_HANDLING_VALID: Use only the valid portion of the convolution. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then convolve the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • nBorderHandling (int) – a progress object (an Progress)
  • nOutputChannelDatatype (int) – an optional output channel to fill(an Channel)
  • bLeaveDataOfOutChannelOutsizeZRangeUnaffected (bool) –
  • IProgress (ORSModel.ors.Progress) –
  • pOutChannel (ORSModel.ors.Channel) –
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) → Channel

Convolutes 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 (an Channel)
  • 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)
  • xMinOutput (int) – the minimal x index of the output channel to write the result in (an unsigned int)
  • yMinOutput (int) – the minimal y index of the output channel to write the result in (an unsigned int)
  • zMinOutput (int) – the minimal z index of the output channel to write the result in (an unsigned int)
  • tMinOutput (int) – the minimal t index of the output channel to write the result in (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. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then convolve the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • nOutputChannelDatatypeIfOutputChannelIsNull (int) – the data type of the output channel, if the output channel is not given
  • IProgress (ORSModel.ors.Progress) – a progress object (an Progress)
  • pOutChannel (ORSModel.ors.Channel) – an optional output channel to fill(an 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) → None

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. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then convolve the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • 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) → 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 data. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then evalutes the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • 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) → 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) → Channel

Gets the minimum 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 minimum value on (a uint32_t)
  • yMinInput (int) – the minimal y index of the input channel to evaluate the minimum value on (a uint32_t)
  • zMinInput (int) – the minimal z (slice) index of the input channel to evaluate the minimum value on (a uint32_t)
  • tMinInput (int) – the minimal t (time) index of the input channel to evaluate the minimum 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 data. CXV_CONVOLUTION_BORDER_HANDLING_PADDED_SURROUND The image is padded at the borders with extra pixels with a value given by m_fPaddedValue. CXV_CONVOLUTION_BORDER_HANDLING_NEAREST_NEIGHBOR The nearest known pixel value is substituted for the unknown one. CXV_CONVOLUTION_BORDER_HANDLING_CYCLIC Consider the extended image to be a tiled version of the original, and then evalutes the central image using portions of the adjacent tiles at the borders. CXV_CONVOLUTION_BORDER_HANDLING_MIRRORING A mirror image of the known image is created with the border for a mirroring axis. CXV_CONVOLUTION_BORDER_HANDLING_INTERPOLATION Unknown values are estimated by polynomial interpolation.
  • 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)

getPaddingValue(self) → float
Returns:output (float) –
getZOffsetInputToOutputWithOutsideZRangeUnaffected(self) → int
Returns:output (int) –
none() → ConvolutionHelper
Returns:output (ConvolutionHelper) –
setPaddingValue(self, aValue: float) → None
Parameters:aValue (float) –
setZOffsetInputToOutputWithOutsideZRangeUnaffected(self, aValue: int) → None
Parameters:aValue (int) –

Unmanaged

class ORSModel.ors.Unmanaged

Bases: ORSModel.ors.ORSBaseClass

brief_description: Abstract class for objects that are not managed by the core library. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005

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) – a managed 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) → 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)
classmethod getAllSubclasses(outputCollection=None)
classmethod getClassDenomination()
static getClassFromProgId(progId)
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) –
classmethod getIsSubclassOf(parentClass)
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

brief_description: An abstract class from which all objects issued from the author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005

getPythonTraceBack() → typing.List[str]

Set the python traceback for a call from python.

Returns:output (typing.List[str]) –
isManaged(self) → bool
Returns:output (bool) –
isNone(self) → bool
Returns:output (bool) –
setPythonTraceBack(tb: ORSModel.ors.typing.List[str]) → None

Set the python traceback for a call from python.

Parameters:tb (typing.List[str]) –