OrsSimpleFilters

Filter for general purposes, including basic kernel specifications

author:ORS Team
contact:http://theobjects.com
email:info@theobjects.com
organization:Object Research Systems (ORS), Inc.
address:760 St-Paul West, suite 101, Montréal, Québec, Canada, H3C 1M4
copyright:Object Research Systems (ORS), Inc. All rights reserved 2020.
date:Nov 06 2015 09:38
dragonflyVersion:
 3.1.0.286 (D)
UUID:8d2f34a8761a11e7988b448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsSimpleFilters.OrsSimpleFilters.OrsSimpleFilters(varname=None, managed=True, pluginParentName=None)
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
apply(xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax)

Starts the computation of the current filter over the specified area

The output datasets should have their data overwritten in the area described by the indexes xMin, yMin, zMin, tMin, xMax, yMax, zMax and tMax and remain unchanged outside this area.

Parameters:
  • xMin (int) – minimal index in X to be computed
  • yMin (int) – minimal index in Y to be computed
  • zMin (int) – minimal index in Z to be computed
  • tMin (int) – minimal index in T to be computed
  • xMax (int) – maximal index in X to be computed
  • yMax (int) – maximal index in Y to be computed
  • zMax (int) – maximal index in Z to be computed
  • tMax (int) – maximal index in T to be computed
availableFilterModules = {}
canBeGenericallyOpened = False
closable = True
closeWidget(name)
filterModulesInfo = []
finalize()
getAbbreviatedOutputName(outputIndex)

Gets the abbreviated output name

Parameters:outputIndex (int) – index of the output of the current filter
Return:abbreviated output name of the current filter
Rtype:str
getArgumentDescriptors()
classmethod getArgumentDescriptorsForFilter(uuid: str)
getBooleanArgument(argumentName)
getClassCount()

Gets the count of classes produced by the filter, if this is defined

Return:filter output class count
Rtype:int
classmethod getDefaultArgumentsForFilter(uuid)
classmethod getDescriptionOfFilter(filterUUID)
getDisplayUI()
classmethod getFilterCanBeUsedForFeatureExtraction(aFilterUUID)

Deprecated since version 3.1.

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (bool) –
classmethod getFilterClassFromFilter(filterUUID) → OrsPythonPlugins.OrsSimpleFilters.filters.filterabstract.FilterAbstract
classmethod getFilterExist(aFilterUUID, aFilterVersion=None, pluginName=None)

Gets if the filter is found

Parameters:
  • aFilterUUID (str) – the filter UUID
  • aFilterVersion (str) – the filter version
  • plugin (str) – the name of a plugin using filters
Returns:

output (bool) – True if the filter is found; False otherwise.

getFilterInfo()
classmethod getFilterIs2D(aFilterUUID)

Gets if the filter can be applied in 2D

Deprecated since version 3.1.

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (bool) – True if the filter can be applied in 2D; False otherwise.
classmethod getFilterIs3D(aFilterUUID)

Gets if the filter can be applied in 3D

Deprecated since version 3.1.

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (bool) – True if the filter can be applied in 3D; False otherwise.
getFilterName()
getFilterUUID()
getFilterUserDescription()

Gets a readable description of the filter and of his parameters

Return:readable description
Rtype:str
getFilterVersion()
classmethod getFilters(pluginName=None)

Gets the set of filters supported by this plugin.

It is a concatenation of strings, each having this syntax:

'categoryName/filterName/uuid;'

Example:

strToReturn = ''  # Initialization
for aFilter in listOfFilters:
    filterCategory = aFilter._getFilterCategory()
    filterName = aFilter._getFilterName()
    uuid = aFilter._getUUID()
    strToReturn += '{category}/{filterName}/{uuid};'.format(category=filterCategory, filterName=filterName, uuid=uuid)
return strToReturn
Parameters:plugin (str) – the name of a plugin using filters
Returns:output (str) – details of filters supported by this plugin
getInputChannel(inputChannelIndex)

Gets an input channel

Parameters:inputChannelIndex (int) – index of the input of the current filter
Return:a Channel GUID
Rtype:str
classmethod getInputChannelCountForFilter(aFilterUUID)

Gets the input channel count for a filter

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (int) – the input channel count
getInputChannelLabel(inputChannelIndex)

Gets the label (identification) of an input

Parameters:inputChannelIndex (int) – index of the input of the current filter
Return:a label
Rtype:str
classmethod getInputChannelLabelForFilter(uuid, index)
Parameters:
  • uuid – uuid of the filter
  • index – index of the input channel
Returns:

output – the label of the input channel

getInputChannelsCount()

Gets how many inputs (datasets) are required

Return:input count
Rtype:int
getIsVisibleKernelDim()
getIsVisibleKernelShape()
getIsVisibleKernelSize()
getKernelDim()
getKernelShape()
getKernelSize()
getLengthDependenceX(inputChannelIndex)

Gets the extent required in X to perform computations on a subset of the dataset.

This is the largest number of pixels required in X from the pixel of computation (either side). If all the pixels are required, return -1.

Examples:

  • if only the current pixel is required, this method should return 0;
  • if only the immediate neighbors are required, this method should return 1.
Parameters:inputChannelIndex (int) – index of the input of the current filter
Return:extent in pixels
Rtype:int
getLengthDependenceY(inputChannelIndex)

Gets the extent required in Y to perform computations on a subset of the dataset.

This is the largest number of pixels required in Y from the pixel of computation (either side). If all the pixels are required, return -1.

Examples:

  • if only the current pixel is required, this method should return 0;
  • if only the immediate neighbors are required, this method should return 1.
Parameters:inputChannelIndex (int) – index of the input of the current filter
Return:extent in pixels
Rtype:int
getLengthDependenceZ(inputChannelIndex)

Gets the extent required in Z to perform computations on a subset of the dataset.

This is the largest number of pixels required in Z from the pixel of computation (either side). If all the pixels are required, return -1.

Examples:

  • if only the current pixel is required, this method should return 0. This is usually the case for 2D filters, working slice by slice;
  • if only the immediate neighbors are required, this method should return 1.
Parameters:inputChannelIndex (int) – index of the input of the current filter
Return:extent in pixels
Rtype:int
getListAvailableKernelDim()
getListAvailableKernelSize()
getMinimalXSizeOfChannelForKernel()

Gets the minimal X size of the input channels for the filter to work properly.

Return:the minimal X size of the input channels
Rtype:int
getMinimalYSizeOfChannelForKernel()

Gets the minimal Y size of the input channels for the filter to work properly.

Return:the minimal Y size of the input channels
Rtype:int
getMinimalZSizeOfChannelForKernel()

Gets the minimal Z size of the input channels for the filter to work properly.

Return:the minimal Z size of the input channels
Rtype:int
getNumericArgument(argumentName)
getOutputChannel(outputChannelIndex)

Gets an output channel

Parameters:outputChannelIndex (int) – index of the output of the current filter
Return:a Channel GUID
Rtype:str
classmethod getOutputChannelCountForFilter(aFilterUUID)

Gets the output channel count for a filter

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (int) – the output channel count
getOutputChannelLabel(outputChannelIndex)

Gets the label (identification) of an output

Parameters:outputChannelIndex (int) – index of the output of the current filter
Return:a label
Rtype:str
classmethod getOutputChannelLabelForFilter(uuid, index)
Parameters:
  • uuid – uuid of the filter
  • index – index of the output channel
Returns:

output – the label of the output channel

getOutputChannelsCount()

Gets how many outputs (datasets) are required

Return:output count
Rtype:int
getOutputSlicesCount()

Gets the count of slices returned for a single slice analysis.

This is for filters producing multiple output values for each input pixel, contained into a single output channel.

An example of use for this is with the Segmentation Trainer, where different features have to be computed for each pixel.

Return:count of slices returned for single slice analysis
Rtype:int
getSetupDescription()

Gets an xml formatted description of the filter and of his parameters

Return:xml formatted description
Rtype:str
getStringArgument(argumentName)
getSuggestedOutputDataType(outputChannelIndex)

Gets the suggested data type of a filter output

Parameters:outputChannelIndex (int) – index of the output of the current filter
Return:suggested data type (from types of class COMWrapper.ORS_def.CxvChannel_Data_Type)
Rtype:int
classmethod getVersionOfFilter(filterUUID)

Gets the version number of a filter

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (str) – version of the filter
isCancelable()
keepAlive = False
multiple = True
openWidget(name, dock=None, tab=None, x=-1, y=-1, w=-1, l=-1, order=-1)
openWidgetInParent(name, parent, layout)
savable = False
setBooleanArgument(argumentName, argumentValue)
setFilter(filterUUID, pluginName=None, version=None)

Sets the current filter

Parameters:
  • filterUUID (str) – the filter UUID
  • plugin (str) – the name of a plugin using filters
setIndexFirstVoxelInputChannel(inputChannelIndex, x, y, z, t)

Tells the filter what is the first voxel represented in memory of an input channel.

Parameters:
  • inputChannelIndex (int) – index of the input of the current filter
  • x (int) – X index of the first voxel represented in memory
  • y (int) – Y index of the first voxel represented in memory
  • z (int) – Z index of the first voxel represented in memory
  • t (int) – T index of the first voxel represented in memory
setIndexFirstVoxelOutputChannel(outputChannelIndex, x, y, z, t)

Tells the filter what is the first voxel represented in memory of an output channel.

Parameters:
  • outputChannelIndex (int) – index of the output of the current filter
  • x (int) – X index of the first voxel represented in memory
  • y (int) – Y index of the first voxel represented in memory
  • z (int) – Z index of the first voxel represented in memory
  • t (int) – T index of the first voxel represented in memory
setInputChannel(inputChannelId, inputChannelIndex)

Sets an input channel

Parameters:
  • inputChannelId (str) – input channel GUID
  • inputChannelIndex (int) – index of the input of the current filter
setIsSelected(isSelected)
setKernelDim(kernelDim)
setKernelShape(kernelShape)
setKernelSize(kernelSize)
setNumericArgument(argumentName, argumentValue)
setOutputChannel(outputChannelId, outputChannelIndex)

Sets an output channel

Parameters:
  • outputChannelId (str) – output channel GUID
  • outputChannelIndex (int) – index of the output of the current filter
setProgress(progressId)
setStringArgument(argumentName, argumentValue)
setWorkingFolder(workingDirectory)
setupFromDescription(description, fromPython=False)

Sets the filter and his parameters from a formatted xml description

Parameters:
  • description (str) – xml formatted description
  • fromPython – True if the xml description needs no modification before being parsed; False if the call comes from C++.
validate()