OrsFilterDeepLearning

Filter for deep learning, using deep convolutional networks

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:Jul 26 2017 11:14
dragonflyVersion:
 3.0.0.271 (D)
UUID:21b0413a721511e7a4f240167e7aa998

Class Code

class OrsPythonPlugins.OrsFilterDeepLearning.OrsFilterDeepLearning.OrsFilterDeepLearning(varname=None, managed=True, pluginParentName='')
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
canBeGenericallyOpened = False
cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

closable = True
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
getClassCount()

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

Return:filter output class count
Rtype:int
getCurrentDeepModelID()
getCurrentDeepModelName()
getCurrentOutputLayer()
getDeepModelsManager()
classmethod getFilterCanBeUsedForFeatureExtraction(aFilterUUID)

Deprecated since version 3.1.

Parameters:aFilterUUID (str) – the filter UUID
Returns:output (bool) –
classmethod getFilterExist(aFilterUUID, aFilterVersion=None, plugin=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.

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
classmethod getFilters(plugin=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
getInputChannelsCount()

Gets how many inputs (datasets) are required

Return:input count
Rtype:int
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
classmethod getMainFormClass()

Gets the class of the main form

Returns:output
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
getModelsList()
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
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
getPluginParentName()
getSetupDescription()

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

Return:xml formatted description
Rtype:str
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(aFilterUUID)

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
openWidgetInParent(name, parent, layout)
orsSelectedObjectsChange()
savable = False
setCurrentDeepModelID(newID)
setCurrentDeepModelName(newName)
setCurrentOutputLayer(outputLayer)
setFilter(filterUUID, plugin=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
setInputChannelsCount(inputChannelsCount)
setIsSelected(isSelected)
setModel(deepModel)
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)
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()