OrsLibraries

globalvariables

class OrsLibraries.globalvariables.OrsValueDictionary(*args, **kwargs)

This wrapper allows the dictionary keys to be accessed as attributes

For example: OrsGlobalVariables = OrsValueDictionary() OrsGlobalVariables.obj = obj print(OrsGlobalVariables.obj == OrsGlobalVariables[‘obj’] ) #prints True

libfilters

Bilateral

class OrsLibraries.libfilters.Bilateral
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelFullsize, sigmaColor, sigmaSpatial)

Gabor

class OrsLibraries.libfilters.Gabor
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kSize, sigma, theta, lambd, gamma)

LocalEntropyMinimization

class OrsLibraries.libfilters.LocalEntropyMinimization
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, nodeCount, iterationCount, compensationMethod)
static isLocalEntropyMinimizationAvailable()

MeanShift

class OrsLibraries.libfilters.MeanShift
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelHalfsizeX, kernelHalfsizeY, kernelHalfsizeZ, maximalDistanceX, maximalDistanceY, noiseSpread)

NonLocalMeans

class OrsLibraries.libfilters.NonLocalMeans
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelSize, ricianNoise, smoothing)
static isNonLocalMeansAvailable()

SamplingRBF2D

class OrsLibraries.libfilters.SamplingRBF2D
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelSize, primitiveId, smoothing, compensationMethod)
static isSamplingRBF2DAvailable()

Sobel

class OrsLibraries.libfilters.Sobel
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, bUseGradientX, bUseGradientY, bUseGradientZ)

Moments

class OrsLibraries.libfilters.Moments
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelSizeX, kernelSizeY, kernelSizeZ, order)

HistogramOfIntensities

class OrsLibraries.libfilters.HistogramOfIntensities
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, kernelSizeX, kernelSizeY, kernelSizeZ, binCounts)

SuperPixel

class OrsLibraries.libfilters.SuperPixel
static apply(inputChannelId, outputChannelId, xMin, yMin, zMin, tMin, xMax, yMax, zMax, tMax, xIndexFirstVoxelInput, yIndexFirstVoxelInput, zIndexFirstVoxelInput, tIndexFirstVoxelInput, xIndexFirstVoxelOutput, yIndexFirstVoxelOutput, zIndexFirstVoxelOutput, tIndexFirstVoxelOutput, progressId, nSuperpixels, sigma)

libfunctions

class OrsLibraries.libfunctions.LibFunctions
static checkIfUpdatesAreAvailable()
static getDICOMAttributes(file_path)
static getDICOMSequenceData(file_path, group=0, element=0)
static getIs3DAllowed()
static getIsAllowedToUpdate()
static getMessageReturnedFromServerWhenCheckingForUpdates()
static getObjectsThatIntersectWithSurfaceOfMask(sourceROI, maskROI, tIndex, connectedROI, nonConnectedROI)
static getSaveFileNameForViewAnimator(parent=None, view=None)
static getShouldCheckIfUpdateIsAvailable()
static getUpdateInformation()

libpython

libutil

class OrsLibraries.libutil.LibUtil
static createUpdateDatasetGroup(sGroupID, sGroupName, sGroupDescription, sGroupDemographicChannelGUID)
static exportLUTToTFIFile(lutGuid, filename)
static getDatasetDateTime(datasetGuid)
static getDatasetDescription(datasetGuid)
static getDatasetGroupChannelForDemographicGUID(groupGuid)
static getDatasetGroupDescription(groupGuid)
static getDatasetGroupName(groupGuid)
static getDatasetGroups(datasetGuid)
static getDatasetImageCount(datasetGuid)
static getDatasetModality(datasetGuid)
static getDatasetProtocol(datasetGuid)
static getDerivedState(datasetGuid)
static getExistingCredentialsFilePath()
static getIsDatasetGroup(groupGuid)
static getQPixmapForAbstractMesh(datasetGuid)
static getQPixmapForChannel(datasetGuid)
static importLUTFromTFIFile(lutGuid, filename)
static setDatasetDescription(datasetGuid, description)
static setDefaultDatasetMetaData(datasetGuid, title)

logger

class OrsLibraries.logger.Logger(className)
debug(*messages)
error(*messages)
fatal(*messages)
info(*messages)
static initialize()
warn(*messages)

luteditor

class OrsLibraries.luteditor.LUTEditor
static createLUTEditor(legendGUID: str, displayGUID: str)
static createLUTEditorFromLUT(lutGUID: str, volumeGUID: str, displayGUID: str)

MakeAMaze

Functions to create 3d maze in a numpy array. Each maze functions return a numpy array that can be made into a channel with createChannelFromNumpyArray()

Use KruskalMaze for huge maze. Creating huge maze may take a while and use lots of memory.

class OrsLibraries.MakeAMaze.BacktrackMaze

Backtrack Maze

based on : http://weblog.jamisbuck.org/2010/12/27/maze-generation-recursive-backtracking

East = 8
Nadir = 64
North = 2
South = 4
West = 16
Zenith = 32
dx = {8: 2, 16: -2, 2: 0, 4: 0, 32: 0, 64: 0}
dy = {8: 0, 16: 0, 2: 2, 4: -2, 32: 0, 64: 0}
dz = {8: 0, 16: 0, 2: 0, 4: 0, 32: 2, 64: -2}
generate(width, height, depth)

Backtrack maze generation algorithm

Parameters:
  • width (int) –
  • height (int) –
  • depth (int) –
Returns:

grid (numpy array) – A numpy array

class OrsLibraries.MakeAMaze.PrimMaze

Prim’s Maze

based on : http://weblog.jamisbuck.org/2011/1/10/maze-generation-prim-s-algorithm

generate(width, height, depth)

Prim”s maze generation algorithm

Parameters:
  • width (int) –
  • height (int) –
  • depth (int) –
Returns:

grid (numpy array) – A numpy array

class OrsLibraries.MakeAMaze.KruskalMaze

Kruskal’s Maze

based on : https://www.youtube.com/watch?v=5xosHRdxqHA

generate(width, height, depth)

Kruskal’s maze generation algorithm

Parameters:
  • width (int) –
  • height (int) –
  • depth (int) –
Returns:

grid (numpy array) – A numpy array

preferences

class OrsLibraries.preferences.Preferences
static getAttribute(sXPath, sName)
static getBoolAttribute(sXPath, sName)
static getBoolValue(sXPath, default=False)
static getCOLORREFAttribute(sXPath, sName)
static getCOLORREFValue(sXPath, default=0)
static getDefaultAngleUnit()
static getDefaultLengthUnit()
static getDefaultSurfaceUnit()
static getDefaultUnitOfSameType(dimensionUnit)
static getDefaultVolumeUnit()
static getDoubleAttribute(sXPath, sName)
static getDoubleValue(sXPath, default=0)
static getInt64Attribute(sXPath, sName)
static getInt64Value(sXPath, default=0)
static getORSColorAttribute(sXPath)
static getORSColorValue(sXPath, default=0)
static getPrecisionOfMeasures()
static getQColorAttribute(sXPath)
static getQColorValue(sXPath)
static getRGBAttribute(sXPath)
static getRGBValue(sXPath, default=0)
static getUInt64Attribute(sXPath, sName)
static getUInt64Value(sXPath, default=0)
static getValue(sXPath, default='')
static getZoomAtCursorPosition()
unitFactory = orsObj('7395821760633923004CxvDimensionUnit')

savedstate

class OrsLibraries.savedstate.SavedState
static addRecentDataset(filename)
static addRecentImageProcessingOperations(filename)
static addRecentMesh(filename)
static addRecentSession(filename)
static getNumericStateData(key, defaultvalue=None)
static getRecentDatasets()
static getRecentDatasetsCount()
static getRecentImageProcessingOperations()
static getRecentImageProcessingOperationsCount()
static getRecentMeshes()
static getRecentMeshesCount()
static getRecentSessions()
static getRecentSessionsCount()
static getStringStateData(key, defaultvalue=None)
static removeRecentImageProcessingOperations(filename)
static removeRecentSession(filename)
static setNonUnicodeStringStateData(key, value)
static setNumericStateData(key, value)
static setStringStateData(key, value)

thicknessoperator

class OrsLibraries.thicknessoperator.ThicknessOperator
computeThicknessMesh(source, tIndex, bShowProgress, bAllowToCancelProgress, iResult)
computeThicknessMeshSampled(source, xSampling, ySampling, zSampling, tIndex, bShowProgress, bAllowToCancelProgress, iResult)

visualmain

class OrsLibraries.visualmain.VisualMain
static OrsMainInitialize()
static OrsMainInstantiate()
static OrsMainPostInstantiate()
static OrsMainPreInstantiate()
static OrsMainTerminate()

workingcontext

class OrsLibraries.workingcontext.WorkingContext
static actOnClickedMenu(instance, aMenuParams, actionData)
static addMultipleToEntities(instance, entityClass, values)

Add multiples values to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param values: a list of str

static addOrsWidget(impl, widgetName, widget, dock=None, tab=None, x=-1, y=-1, w=-1, l=-1, order=-1, show=True)
static addToEntities(instance, entityClass, value)

Add a value to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param value: a str

static addToNamedEntities(instance, entityClass, entityName, value)
static addWorkingArea(instance, widget)
static callEntryPointNoArguments(instance, name)
static callEntryPointOneArgument(instance, name, param=None)
static callEntryPointTwoArguments(instance, name, param1=None, param2=None)
static clearEntities(instance, entityClass)
static clearNamedEntities(instance, entityClass, entityName)
static closeWidget(instance, name)
static deleteContext(instance)
static deletePlugin(instance)
static deregisterOrsWidget(pluginName, instance, widget)
static executeActionNamed(instance, action_name)
static forbidActions(instance, actions=None)
static forbidMenuItemIds(instance, ids=None)
static forbidStates(instance, states=None)
static getContextNameFor(instance)
static getCurrentContextName()
static getCurrentContextWindow()
static getCurrentEntity(instance, entityClass)

Get the value associated to an entity class name :param instance: context instance :param entityClass: entity class name (str) :return: a str

static getCurrentGlobalState(instance)

Gets the current global state :param instance: context instance :return: the state (str)

static getCurrentNamedEntity(instance, entityClass, entityName)

Get the named value associated to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param entityName: entity name (str) :return: a str

static getCurrentState()
static getCurrentView(instance) → ORSModel.ors.View

Returns the currently active view :param instance: context instance :return: a View or None

static getCursorFileForHandle(instance, handlename)
static getEntities(instance, entityClass)
static getEntitiesCount(instance, entityClass)
static getEntitiesDataFlattened(instance)
static getEntitiesOfClass(instance, entityClass, progid)
static getEntitiesOfClassAsObjects(instance, entityClass, progid)
static getEntityDataFlattened(instance)
static getEntityNamesForMultipleEntities(instance, entityClass)
static getEntityNamesForSingleEntity(instance, entityClass)
static getEventData(instance) → OrsEvent.eventdata.EventData
static getExistsInEntities(instance, entityClass, value)
static getExistsInNamedEntities(instance, entityClass, entityName, value)
static getForbiddenActions(instance)
static getForbiddenMenuItemIds(instance)
static getForbiddenStates(instance)
static getListOfPluginsThatCanBeOpened()
static getNamedEntities(instance, entityClass, entityName)
static getNamedEntitiesCount(instance, entityClass, entityName)
static getNamedEntitiesDataFlattened(instance)
static getNamedEntitiesOfClass(instance, entityClass, entityName, progid)
static getNamedEntitiesOfClassAsObjects(instance, entityClass, entityName, progid)
static getNamedEntityDataFlattened(instance)
static getOrsMenu(instance, aClassMenu, guidsList)
static getStateTitle(instance, state)

Get’s the title of the state :param instance: context instance :param state: state (str) :return: a string

static getVariableNameForClass(className)
static getViewUnderCursor(instance) → ORSModel.ors.View

Returns the view under the cursor :param instance: context instance :return: a View or None

static getWidgetDisposition(instance, plugin_name, form_name)
static initContext(name, varName)
static initMenus()
static initOrsMenu(menu, aMenuParams)
static initPlugin(name, varName)
static initPythonPlugin(name, varName)
static isPluginInCurrentContext(instance)
static numScreens()
static openWidget(instance, name, dock=None, tab=None, x=-1, y=-1, w=-1, l=-1, order=-1)
static postInitPlugin(instance)
static postLoadSession(instance)
static prePublishInSession(instance)
static pushContext(name, varName)
static pythonPluginRemoved(instance)
static refreshAllUI()
static refreshUIFromModel(instance)
static registerOrsWidget(pluginName, instance, widgetName, widget)
static removeCurrentNamedEntity(instance, entityClass, entityName)

Remove a named value associated to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param entityName: entity name (str)

static removeFromEntities(instance, entityClass, value)

Remove a value from an entity class name :param instance: context instance :param entityClass: entity class name (str) :param value: a str

static removeFromEntitiesAllObjectsOfClass(instance, entityClass, progid)

Remove all values that represent an object of the given class from an entity class name :param instance: context instance :param entityClass: entity class name (str) :param progid: an ORS class name (str)

static removeFromNamedEntities(instance, entityClass, entityName, value)
static removeFromNamedEntitiesAllObjectsOfClass(instance, entityClass, progid)
static removeMultipleFromEntities(instance, entityClass, values)

Remove multiples values from an entity class name :param instance: context instance :param entityClass: entity class name (str) :param values: a list of str

static removeWorkingArea(instance, widget)
static saveAllWidgetDispositions(instance)
static saveWidgetDisposition(instance, plugin_name, form_name, state)
static setContextName(instance, name)
static setCurrentEntity(instance, entityClass, value)

Set the value associated to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param value: a str

interfacemethod setCurrentGlobalState(instance, state)

Sets the currently active global state

Parameters:
  • instance (plugin instance) – context instance
  • state (str) – new state
Returns:

globalStateChangeIsSuccessful (bool) – indicates if the change was successful

static setCurrentNamedEntity(instance, entityClass, entityName, value)

Set the named value associated to an entity class name :param instance: context instance :param entityClass: entity class name (str) :param entityName: entity name (str) :param value: a str

static setCurrentView(instance, view)

Sets the current view. :param instance: context instance :param view: a View

static setEventConsumed(instance, state=True)
static setMultipleEntities(instance, entityClass, values)

Sets multiples values to an entity class name, thus erasing any previous values :param instance: context instance :param entityClass: entity class name (str) :param values: a list of str

static setScreen(screen)
static setUIEnabled(instance, state)
static setWorkingAreaCursor(instance, cursor)
static showStatusMessage(instance, message)
static stackGlobalState(instance, state)

Stacks a new global state. Stacking is used to set a temporary state that will eventually be unstacked :param instance: context instance :param state: new state (str) :return: a Boolean indicate if the change was successful

static unforbidActions(instance, actions=None)
static unforbidMenuItemIds(instance, ids=None)
static unforbidStates(instance, states=None)
static unstackGlobalState(instance)

Unstacks the global state :param instance: context instance

static updateContextWindows(instance)