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

items()

Protecting the iteration over the dictionary by making a copy of the dictionary container. Note that this is a copy, not a deep copy.

keys()

Protecting the iteration over the dictionary by making a copy of the dictionary container. Note that this is a copy, not a deep copy.

values()

Protecting the iteration over the dictionary by making a copy of the dictionary container. Note that this is a copy, not a deep copy.

libfilters

Bilateral

class OrsLibraries.libfilters.Bilateral

Gabor

class OrsLibraries.libfilters.Gabor

LocalEntropyMinimization

class OrsLibraries.libfilters.LocalEntropyMinimization

MeanShift

class OrsLibraries.libfilters.MeanShift

NonLocalMeans

class OrsLibraries.libfilters.NonLocalMeans

SamplingRBF2D

class OrsLibraries.libfilters.SamplingRBF2D

Sobel

class OrsLibraries.libfilters.Sobel

Moments

class OrsLibraries.libfilters.Moments

HistogramOfIntensities

class OrsLibraries.libfilters.HistogramOfIntensities

SuperPixel

class OrsLibraries.libfilters.SuperPixel

libfunctions

class OrsLibraries.libfunctions.LibFunctions
static createChannel(title, dataType, sizeX, sizeY, sizeZ, sizeT, spacingX, spacingY, spacingZ, offset, slope, addNoise, gaussian, noiseStdDev, initValue, randomSeed, nbThreads, progress)

Creates a dataset from parameters.

Parameters:
  • title (str) – title of the dataset

  • dataType (int) – data type. 0: unsigned byte; 2: unsigned short; 4: unsigned int; 6: float.

  • sizeX (int) – X size

  • sizeY (int) – Y size

  • sizeZ (int) – Z size

  • sizeT (int) – T size

  • spacingX (float) – X spacing (in meters)

  • spacingY (float) – Y spacing (in meters)

  • spacingZ (float) – Z spacing (in meters)

  • offset (float) –

  • slope (float) –

  • addNoise (bool) – if True, noise will be added

  • gaussian (bool) – if True, the added noise will have a gaussian distribution

  • noiseStdDev (float) – noise standard deviation

  • initValue (float) – initial value put in each voxel

  • randomSeed (float) – random seed value

  • nbThreads (int) – number of threads

  • progress (ORSModel.ors.Progress) – progress object

Returns:

output (ORSModel.ors.Channel) [count=1] – Created dataset

libpython

libutil

class OrsLibraries.libutil.LibUtil

logger

class OrsLibraries.logger.Logger(className)

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

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

savedstate

class OrsLibraries.savedstate.SavedState

thicknessoperator

class OrsLibraries.thicknessoperator.ThicknessOperator
classmethod computeThicknessMesh(source, tIndex, bShowProgress, bAllowToCancelProgress, smoothingIterationsCount=0)
Returns:

output

a Mesh

classmethod computeThicknessMeshSampled(source, xSampling, ySampling, zSampling, tIndex, bShowProgress, bAllowToCancelProgress, smoothingIterationsCount=0)
Returns:

output – a Mesh

classmethod computeThicknessMeshWithOutMeshAsInput(source, ioMesh, tIndex, bShowProgress, bAllowToCancelProgress)
Returns:

output – True if worked, else False

..note: Compute Thickness Mesh with output mesh as an input

classmethod computeVolumeThickness(source, tIndex, IProgress)
Returns:

output – a channel of the volume thickness

visualmain

class OrsLibraries.visualmain.VisualMain

workingcontext

class OrsLibraries.workingcontext.WorkingContext
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 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 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 getCurrentView(instance) View

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

static getEventData(instance)

Deprecated since version 4.0.

Note

The event data should be obtained from the input argument of ORSServiceClass.OrsPlugin.orsPlugin.OrsPlugin.handleTriggered() or of the action methods.

static getIsAnyStatesInStack(instance, collectionOfState)

Gets to know if any state in collection is in the stack :param instance: context instance :param collectionOfState: iterable of state :return: a Boolean indicate if the state is in the stack

static getIsStateInStack(instance, state)

Gets to know if a state is in the stack :param instance: context instance :param state: a state :return: a Boolean indicate if the state is in the stack

static getSelectedSessionTask(instance)

Gets the currently selected session task to perform :param instance: context instance :return: the state (str)

static getStateTitle(instance, state)

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

static getViewUnderCursor(instance) View

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

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(inst, entityClass, progid)

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

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 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 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

classmethod setSelectedSessionTask(instance, selectedSessionTask)

Sets the currently selected session task to perform

Parameters:
  • instance (plugin instance) – context instance

  • selectedSessionTask (str) – selected session task to perform

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 unstackGlobalState(instance)

Unstacks the global state :param instance: context instance