OrsImageProcessing

Plugin used to apply a set of filters to datasets

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.
date:July 2017
dragonflyVersion:
 3.0
UUID:bb7822c0761411e7a1d5448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsImageProcessing.orsimageprocessing.OrsImageProcessing(varname=None, managed=True)
classmethod OrsImageProcessing_openToolbox()
UIDescriptors = [<ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>, <ORSServiceClass.OrsPlugin.uidescriptor.UIDescriptor object>]
interfacemethod addOperation(filterCategory, filterName, configuration='', uuid=None)
Parameters:
  • filterCategory (str) – category of the filter
  • filterName (str) – name of the filter
  • configuration (str) – xml configuration of the filter
  • uuid (str) – str
Returns:

output (str) – operationId or empty string if the operation was invalid

interfacemethod addOutputNode(operationId, idx, title)

add a node that will result in a new output channel being generated after an operation

Parameters:
  • operationId (str) – the id of the operation
  • idx (int) – the index of the output channel to saave
  • title (str) – title of the new channel
Returns:

output (ORSModel.ors.Channel) – the new channel

classmethod applyOperationStack(fname, inputDataset, generateOutputDataset)
interfacemethod applySetupDescriptionsToOperation(description, operationID)
Parameters:
  • description (str) – xml description of the operation
  • operationID (str) –
Returns:

output (bool) –

availableOperations = []
availableOperationsDict = {}
interfacemethod clearOperations()

clear all operations

closable = True
closeWidget(name)
computeGraph = <networkx.classes.digraph.DiGraph object>
classmethod computeOutput(node, outputRange=None)

Given an operaion, calculate the output

Parameters:
  • node – an operation
  • outputRange – the range to calculate
Returns:

output

interfacemethod computeOutputs()

compute the outputs of the compute graph

Returns:output (str) – status
computePreviews(previews)
This function will compute previews. The previews is a list of tuples containing:
  1. the operationId from which the preview is derived,
  2. output index for the output channel
  3. the preview Channel GUID to write in
  4. the View GUID that the output channel is being displayed on
Parameters:previews
Return:
interfacemethod connectOperationOutputToOperationInput(outOperation, outIdx, inOperation, inIdx)

set the output from one operation as the input of another operation

Parameters:
  • outOperation (str) – the id of the output operation
  • outIdx (int) – the index of the output channel
  • inOperation (str) – the id of the input operation
  • inIdx (int) – the index of the input channel
Returns:

output (bool) – a boolean if the operation was successful

classmethod copyOutputsToFinalOutputs(isInApply: bool, finalOutputsThatAreToBeKept)
deletePlugin(aWidget=None)
classmethod deleteProgressBar()
disableSceneSynchronization(views)

Disables the scene view synchronization for each view.

Returns a type containing:
1: scene view instance 2: list of status of the zoom sync status 3: list of status of the position sync status
Parameters:views
Return:
classmethod disconnectPredecessorEdge(operationId, previousInput)
displayTextOnView(text: str, view: ORSModel.ors.View)

This is used to show Original and Preview on the display Also, create invisible visualText for channel names

Parameters:
  • text
  • view
Return:
fitToView(view: ORSModel.ors.View)
classmethod getAbout()
getAnnotationPublishedCallbackId()
getBoundedPlaneCoordinatesForInputChannel(channelGUID)

returns the visible range of the input channel guid on the display

Parameters:channelGUID
Return:returns a tuple (bool, range). bool is true if the channel is displayed in our context
getContextualViews()
Return:
Rtype:list[ors.Views]
classmethod getIsOperationsStackValid(fname)
classmethod getOperationCategoryFromFilterName(filterName)
classmethod getOperationsStackDescription(fname)
classmethod getOperationsStackOutputChannelName(fname)
classmethod getOutputs()
classmethod getPluginInstance(operationId)
classmethod getProgressBarGUID()
getState()
getVisualChannelCallbackId()
interfacemethod inputOutputCountChanged(operationId, nInputs, nOutputs)

the number of operations changed for an operation

Parameters:
  • operationId (str) – id of the operation to change
  • nInputs (int) – the new number of inputs
  • nOutputs (int) – the new number of outputs
Returns:

output (bool) – success

keepAlive = False
classmethod loadConfiguration(fileLocation)
loadOperationsStack(fname)
multiple = True
static openGUI()
static openToolBox(operationStackFilename=None)
openWidget(name, dock=None, tab=None, x=-1, y=-1, w=-1, l=-1, order=-1)
interfacemethod populateListOfAvailableFilters(refresh=False)

Populate the list of available filters

Parameters:refresh (bool) – should the list be refreshed
progressBarId = None
classmethod reconnectSceneSynchronization(views, sync, zoomSynced, panSynced)
interfacemethod removeOperation(operationId)
Parameters:operationId (str) – the operation id to remove
Returns:output (bool) – true if the operationId existed and is succesfully removed
interfacemethod removeOutputs()
savable = False
classmethod saveConfiguration(fileLocation)
interfacemethod setOperationConfiguration(operationId, configuration)
Parameters:
  • operationId (str) –
  • configuration (str) – xml configuration obtained from filter.getSetupDescription
Returns:

output (bool) – if the function was succesful

interfacemethod setOperationInputChannel(operationId, idx, channel)

set the input of an operation to a an existing channel

Parameters:
  • operationId (str) – the id of the operation
  • idx (int) – the index of the input channel to et
  • channel (ORSModel.ors.Channel) – the channel
Returns:

output (bool) – status

interfacemethod setOperationOutput(outoperation, outIdx, channel)

set one of the output operations to an existing channel

Parameters:
  • outoperation (str) – the operation id
  • outIdx (int) – output index
  • channel (ORSModel.ors.Channel) – the existing channel
Returns:

output (bool) – if the operation was successful

classmethod setOperationOutputRange(operationId, outIdx, outputRange)

Internal usage

Parameters:
  • operationId – the output operation id
  • outIdx – the index of the operation
  • outputRange – the range to calculate [x min, y min, z min, t min, x max, y max, z max, t max]
Type:

str

Type:

int

Type:

list[str]

Returns:

output (bool) – status

interfacemethod setOperationOutputType(outOperation, outIdx, outputType)

set the output type of an operation

Parameters:
  • outOperation (str) – the operation id
  • outIdx (int) – the output index
  • outputType (int) – the output type, defined by ORSDEF
Returns:

output (bool) – success or not

classmethod setProgressBar()
setState(state)
title = 'OrsImageProcessing'
classmethod toolsMenu()
updateViewVisualText(text: str, channel=None, views=None)
interfacemethod validateOperations()

Determines if the stack of operations is valid. It will only chec if the parameters of the operation are valid.

Returns a string. If the length of the string is 0, it means it is valid.

Returns:output (str) –
classmethod validateThatAllOperationsLeadingToThisOperationHasInputs(operationId)

validate that allOperations leading to this operation has an input and output :param operationId: :return:

version = '1.0'