OrsHelpers

abstractLogger

class OrsHelpers.abstractLogger.AbstractLogger

Helper to be used when a layout or a view should be obtained from a genealogical name.

classmethod getBestLayoutForName(aName)
classmethod getBestViewForName(aName)

abstractSelectedObjectHelper

class OrsHelpers.abstractSelectedObjectHelper.AbstractSelectedObjectHelper

Helper related to the objects in the selection.

callSublassManagingContextIfMethodDefined()
classmethod getAbstractDatasetPresentersVisibleInDisplay(*args)
static getAllSubclasses(aClass, outputCollection=None)
classmethod getBestBoxFromSelection(*args)
classmethod getBoxContainingAllSelectedVisualsVisibleInView(*args)
classmethod getBoxForCine(*args)
classmethod getBoxOfVisualRoiInView(aPluginForContext, visualROI, view)
classmethod getFallBackBox(aPluginForContext, view)
classmethod getFirstVisualROI(*args)
classmethod getMaxTimeStepForCine(*args)
classmethod getSelectedVisualVisibleInDisplay(*args)
classmethod getSubclassManagingContext(contextName)
classmethod getVisualROIVisibleInDisplay(*args)
classmethod getVolumeForLeveling(*args)
managedContext = []
classmethod managedContextInclude(contextName)

annotationhelper

class OrsHelpers.annotationhelper.AnnotationHelper

Helper related to the annotations.

interfacemethod setIsVisibleForViewFromLayoutGenealogicalName(aName, annotation, isVisible)

Set view mode for annotation

Deprecated since version 4.0.

Parameters:
  • aName (str) – a genealogical name
  • annotation (ORSModel.ors.Annotation) – an annotation
  • isVisible (bool) – visibility
classmethod setIsVisibleIn2D(annotation, view, value)
Parameters:
interfacemethod setIsVisibleIn2DFromGenealogicalName(name, annotation, isVisible)

Sets the visibility of an annotation in all 2D views of the given scene layout

Parameters:
  • name (str) – a genealogical name of a scene layout
  • annotation (ORSModel.ors.Annotation) – an annotation
  • isVisible (bool) – True to set as visible, False otherwise

arrayhelper

class OrsHelpers.arrayhelper.ArrayHelper(ors_array)

Helper for manipulating ORS arrays with Numpy.

static ConvertNumpyToOrsArray(np_array, packet_size=64)

Convert numpy.ndarray to Ors array

Parameters:np_array (numpy.ndarray) – The input numpy array to copy
Return:The output OrsArray copy
Rtype:OrsArray
static ConvertOrsToNumpyArray(ors_array)

Convert Ors array to numpy.ndarray

Parameters:ors_array (OrsArray) – The input OrsArray to copy
Return:The numpy array copy
Rtype:numpy.ndarray
at(index)
atPut(index, value)
copyFromNumpyArray(np_array)

Copy a numpy.ndarray into this Ors Array

Parameters:np_array (numpy.ndarray) – The numpy array to copy
getNumpyArrayCopy()

Get a numpy.ndarray copy of this Ors Array

Return:A numpy array copy of the underlying OrsArray
Rtype:numpy.ndarray
getSize()
setAll(value)
setSize(new_size)

datasetcompare

class OrsHelpers.datasetcompare.DatasetCompareHelper

Helper to perform comparison on datasets.

This is essentially for testing purposes.

classmethod compare(dataset1, dataset2)

Compares datasets. :param dataset1: First dataset. :param dataset2: Second dataset. :return: True if both datasets are equivalent; False otherwise.

datasethelper

class OrsHelpers.datasethelper.DatasetHelper

Helper related to the class ORSModel.ors.Channel.

interfacemethod copyDataset(aDataset)

Copies a dataset

Parameters:aDataset (ORSModel.ors.Channel) – the dataset to copy
Returns:newDataset (ORSModel.ors.Channel) – the copied dataset
classmethod copyDatasetAndPublish(aDataset)
interfacemethod copyDatasetNotInitialize(aDataset)

Copies a dataset no intialize

Parameters:aDataset (ORSModel.ors.Channel) – the dataset to copy
Returns:newDataset (ORSModel.ors.Channel) – the copied dataset
interfacemethod createDatasetFromMultiROI(aMultiROI, IProgress=None)

Creates a new dataset where the value at each pixel is the label in the MultiROI

Parameters:
Returns:

dataset (ORSModel.ors.Channel) – new dataset

interfacemethod createMultiROIFromDataset(dataset, multiROI, IProgress=None)

Creates a new MultiROI where each pixel is contained in the label matching the dataset value at that location

Parameters:
Returns:

aMultiROI (ORSModel.ors.MultiROI) – new MultiROI

interfacemethod deleteDataset(aDataset)

Deletes a dataset

Parameters:aDataset (ORSModel.ors.Channel) – the dataset to delete
classmethod fitToView(dataset, view)
classmethod getDatasetGroupContainingDataset(dataset)
classmethod getIsDerivedNew(dataset)
classmethod setDerivedNew(dataset)
classmethod setDerivedSaved(dataset)
classmethod setDerivedState(dataset, state)
interfacemethod setIsVisibleForViewFromLayoutGenealogicalName(aName, dataset, isVisible)

Set view mode for dataset

Deprecated since version 4.0: Use setIsVisibleIn2DFromGenealogicalName.

Parameters:
  • aName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • isVisible (bool) – visibility
classmethod setIsVisibleIn2D(dataset, view, value)
Parameters:
interfacemethod setIsVisibleIn2DFromGenealogicalName(name, dataset, isVisible)

Sets the visibility of a dataset in all 2D views of the given scene layout

Parameters:
  • name (str) – a genealogical name of a scene layout
  • dataset (ORSModel.ors.Channel) – a dataset
  • isVisible (bool) – True to set as visible, False otherwise

datasetPresenterLogger

class OrsHelpers.datasetPresenterLogger.DatasetPresenterLogger

Helper related to the class ORSModel.ors.DatasetPresenter.

dimensionUnitHelper

class OrsHelpers.dimensionUnitHelper.DimensionUnitHelper

Helper for manipulating dimension units.

classmethod convertValueToString(value, dimensionUnit=None, view=None)

Convert and format a value in a given dimension unit to a view dimension unit.

Parameters:
  • value – ths source value
  • dimensionUnit – the source dimension unit
  • view – the view
Returns:

output – a string representation of the converted value

classmethod getAngleToString(value, view=None)
classmethod getLenghtToString(value, view=None)
classmethod getSurfaceToString(value, view=None)
static getViewUnitOfSameType(view, dimensionUnit)
classmethod getVolumeToString(value, view=None)

discretecolorsequence

class OrsHelpers.discretecolorsequence.DiscreteColorSequence

Iterator on colors.

XPATH = 'sequentialColorValues_%03d'
classmethod getColorIterator()
classmethod get_next_color()
next_color_index = 0

displayDatasetInLayout

class OrsHelpers.displayDatasetInLayout.DisplayDatasetInLayout

Helper for attaching/detaching channels and related objects (visuals, …) to layouts.

classmethod addChannelToLayout(IChannel, inLayout=None, pluginInContext=None)
classmethod createGridUnderTopFrame(topFrame)
classmethod createObjectsForDisplaysOfLayout(layout, topFrame, pluginInContext=None)
classmethod removeChannelFromLayout(IChannel, layout)
classmethod removeChannelFromLayoutOfDisplay(IChannel, display)

displaymesh

class OrsHelpers.displaymesh.DisplayMesh

Helper for attaching/detaching meshes and related objects (visuals, …) to layouts.

classmethod addModelToLayout(IMeshModel, layout, pluginInContext=None)
classmethod removeModelFromGroupOfDisplay(IMeshModel, IDisplay, disableFusion)

displayROI

class OrsHelpers.displayROI.DisplayROI

Helper for attaching/detaching ROIs and MultiROIs and related objects (visuals, …) to layouts.

classmethod addROIToLayout(aROI, layout) → ORSModel.ors.VisualROI
interfacemethod deleteMultiROI(aMultiROI)

Deletes a MultiROI

Parameters:aMultiROI (ORSModel.ors.MultiROI) – the MultiROI to delete
interfacemethod deleteROI(aROI)

Deletes a ROI

Parameters:aROI (ORSModel.ors.ROI) – the ROI to delete

distancemaphelper

class OrsHelpers.distancemaphelper.DistanceMapHelper

Helper for computing distance maps.

classmethod eucledianDistanceMapFromROI(aROI, reverseROI, ROIMask, IProgress=None, showProgress=False, distanceMap=None)
classmethod geodesicDistanceMapFromROI(aROI, seedROI, timestep)

Computes the geodesic distance in the source ROI from the seedROI

Parameters:
Returns:

geodesicChannel (ORSModel.ors.Channel) – the geodesic channel

classmethod geodesicInexactDistanceMapFromROI(aROI, seedROI, timestep)

Computes the geodesic distance in the source ROI from the seedROI

Parameters:
Returns:

geodesicChannel (ORSModel.ors.Channel) – the geodesic channel

exporthistogramtocsvhelper

class OrsHelpers.exporthistogramtocsvhelper.ExportHistogramToCSVHelper

Helper to export histogram data to a CSV file.

classmethod export1DHistogramToCSV(parent, histogramDataGUID, histogramDataTitle, windowTitle='', defaultPath='')

Export CSV data in a file (including save dialog interface) for 1-dimension histogram using OrsHistogramData

jsonhelper

class OrsHelpers.jsonhelper.JSONHelper

Helper for manipulating JSON data.

static convertStringToUUID(obj)
static convertUUIDToString(obj)
static loadFromFile(filename)
static saveToFile(filename, jsonData)
static traverseNestedStructure(obj, func)

kernelHelper

class OrsHelpers.kernelHelper.KernelHelper

Helper for manipulating kernels.

These kernels are to be used with convolution filters.

applyGaussianShape(kernelMatrix, standardDeviation, normalize=True)
getElementValue()
getKernelDim()
getKernelMatrix()
classmethod getKernelObjectFromNumpyArray(kernelMatrix)
classmethod getKernelObjectGaussianShape(sigma, truncate=2.0)

Gets a ConvolutionKernel object from the specifications of standard deviation in each axe.

Parameters:
  • sigma – list of standard deviation. If a single element is given, a 1D kernel will be created. If 2 elements are given, a 2D kernel will be created. If 3 elements are given, a 3D kernel will be created. The first element in the list is for the “X” axe, the second element is for the “Y” axe, and the third element is for the “Z” axe.
  • truncate – truncate the kernel at this many standard deviations.
Returns:

output – a ConvolutionKernel object

getKernelShape()
getKernelSize()
classmethod normalize(kernelMatrix)
setElementValue(elementValue)
setKernelDim(kernelDim)
setKernelShape(kernelShape)
setKernelSize(kernelSize)

layoutHelper

class OrsHelpers.layoutHelper.LayoutHelper

Helper for manipulating layouts.

classmethod getChildSceneLayoutOfLayout(layout: ORSModel.ors.Layout)
classmethod getIsViewMaximized(display)
classmethod getLayoutOfView(display) → ORSModel.ors.Layout
classmethod getLayoutOfViewFromGUID(displayGUID)
classmethod getSceneLayoutOfLayout(layout)
classmethod getSceneLayoutOfTopFrame(topFrame)
classmethod getSceneLayoutOfView(display) → ORSModel.ors.Layout
classmethod getSceneLayoutOfViewFromGUID(displayGUID)
classmethod getTopLayoutOfContext(pluginInContext, createIfAbsent=True)
classmethod getTopLayoutOfLayout(layout)
classmethod maximizeViewInItsSceneLayout(view)
classmethod refreshAllViewsInSceneLayoutOfView(display)
classmethod refreshViewTitleFromLayout(layout)
classmethod restoreAfterMaximizeViewInItsSceneLayout(view)
classmethod setTopLayoutOfContext(topLayout, pluginInContext)

layoutpropertieshelper

class OrsHelpers.layoutpropertieshelper.LayoutPropertiesHelper

Helper for setting and getting information of the layouts (LUT to use, current time step, …).

class LayoutProperties(propertyId, showLegend=None, showScaleBar=None, showTextAnnotation=None, isLODEnabled2D=None, isLODEnabled3D=None)
currentTimeStep
exportToXml()
get2DLUTUUID(aVisual, aScalarValueTypeTag='')
get3DLUTUUID(aVisual, aScalarValueTypeTag='')
getOpacity2D(anObject)
getOpacity3D(anObject)
getUse2DLUTAlpha(anObject)
getWindowLevel2D(anObject)
getWindowLevel3D(anObject)
isLODEnabled2D
isLODEnabled3D
loadFromOrsObject(anObject)
loadFromXml(xml)
saveToOrsObject(anObject)
set2DLUTUUID(aVisual, lutUUID, aScalarValueTypeTag='')
set3DLUTUUID(aVisual, lutUUID, aScalarValueTypeTag='')
setOpacity2D(anObject, value)
setOpacity3D(anObject, value)
setUse2DLUTAlpha(anObject, value)
setWindowLevel2D(anObject, width, center)
setWindowLevel3D(anObject, width, center)
showLegend
showScaleBar
showTextAnnotation
classesToUpdateAllViews = ['CxvLabeledMultiROI']
defaultLutPath = '\\\\?\\C:\\RootReferences\\OrsQtPlateform\\resource\\lut\\grayscale 7b00da82eefc11e68693448a5b87686a.tfi'
classmethod get2DLUTUUID(layout, anObject, aScalarValueTypeTag='')
classmethod get3DLUTUUID(layout, anObject, aScalarValueTypeTag='')
classmethod getLODEnabled2D(layout)
classmethod getLODEnabled3D(layout)
interfacemethod getLUTFromGenealogicalName(layoutFullName, dataset)

Gets the dataset LUT in layout

Parameters:
Returns:

lut (ORSModel.ors.LookupTable) – a LUT

classmethod getLayoutPropertiesId(layout)
classmethod getOpacity2D(layout, anObject)
classmethod getShowLegend(layout)
classmethod getShowScaleBar(layout)
classmethod getShowTextAnnotation(layout)
classmethod getUse2DLUTAlpha(layout, anObject)
classmethod getWindowLevel2D(layout, anObject)
classmethod getWindowLevel3D(layout, anObject)
interfacemethod getWindowLevel3DMinMaxFromGenealogicalName(layoutFullName, dataset)

Gets the dataset 3D window/level range in layout

Parameters:
Returns:
  • rangeMin (float) – minimal value of the range
  • rangeMax (float) – maximal value of the range
classmethod set2DBackgroundColor(layout, color)
interfacemethod set2DBackgroundColorFromGenealogicalName(layoutFullName, color)

Set show text annotation in layout

Parameters:
classmethod set2DLUTUUID(layout, anObject, lutUUID, aScalarValueTypeTag='')
interfacemethod set2DLUTUUIDFromGenealogicalName(layoutFullName, anObject, lutUUID, aScalarValueTypeTag='')

Set the lut of an object in layout

Parameters:
classmethod set3DLUTUUID(layout, anObject, lutUUID, aScalarValueTypeTag='')
interfacemethod set3DLUTUUIDFromGenealogicalName(layoutFullName, anObject, lutUUID, aScalarValueTypeTag='')

Set the lut of an object in layout

Parameters:
classmethod setCurrentTimeStep(layout, time_step)
interfacemethod setCurrentTimeStepFromGenealogicalName(layoutFullName, time_step)

Change time step in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • time_step (int) – new time step
classmethod setLODEnabled2D(layout, isLODEnabled2D)
interfacemethod setLODEnabled2DFromGenealogicalName(layoutFullName, isLODEnabled2D)

Set the enabled LOD flag for 2D views in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • isLODEnabled2D (bool) – a flag
classmethod setLODEnabled3D(layout, isLODEnabled3D)
interfacemethod setLODEnabled3DFromGenealogicalName(layoutFullName, isLODEnabled3D)

Set the enabled LOD flag for the 3D view in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • isLODEnabled3D (bool) – a flag
classmethod setLayoutPropertiesId(layout, id_)
classmethod setOpacity2D(layout, anObject, value, logging=False)
interfacemethod setOpacity2DFromGenealogicalName(layoutFullName, dataset, value)

Set VisualChannel 2D opacity in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • value (float) – a value
classmethod setOpacity3D(layout, anObject, value, logging=False)
interfacemethod setOpacity3DFromGenealogicalName(layoutFullName, dataset, value)

Set VisualChannel 3D opacity in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • value (float) – a value
classmethod setShowLegend(layout, showLegend, aScalarValueTypeTag='')
interfacemethod setShowLegendFromGenealogicalName(layoutFullName, showLegend, aScalarValueTypeTag='')

Set show legend in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • showLegend (bool) – a flag
  • aScalarValueTypeTag (str) – an Id to know which legend to update
classmethod setShowScaleBar(layout, showScaleBar)
interfacemethod setShowScaleBarFromGenealogicalName(layoutFullName, showScaleBar)

Set show text annotation in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • showScaleBar (bool) – a flag
classmethod setShowTextAnnotation(layout, showTextAnnotation)
interfacemethod setShowTextAnnotationFromGenealogicalName(layoutFullName, showTextAnnotation)

Set show text annotation in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • showTextAnnotation (bool) – a flag
classmethod setUnit(layout, unit_type, unitId)
interfacemethod setUnitFromGenealogicalName(layoutFullName, unit_type, unitId)

Set unit in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • unit_type (IntEnum CxvUniverse_Dimension_Type) – an unit type
  • unitId (IntEnum CxvUniverse_Dimension) – an unit id
classmethod setUse2DLUTAlpha(layout, visualChannel, value)
interfacemethod setUse2DLUTAlphaFromGenealogicalName(layoutFullName, dataset, value)

Set VisualChannel 3D window/level in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • value (bool) – a value
classmethod setWindowLevel2D(layout, anObject, width, center, logging=False, updateWindowLeveling=True)
interfacemethod setWindowLevel2DFromGenealogicalName(layoutFullName, dataset, width, center)

Sets the dataset 2D window/level in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • width (float) – a width
  • center (float) – a center
classmethod setWindowLevel3D(layout, anObject, width, center, logging=False, updateWindowLeveling=True)
interfacemethod setWindowLevel3DFromGenealogicalName(layoutFullName, dataset, width, center)

Sets the dataset 3D window/level in layout

Parameters:
  • layoutFullName (str) – a genealogical name
  • dataset (ORSModel.ors.Channel) – a dataset
  • width (float) – a width
  • center (float) – a center
tmpLutPath = '\\\\?\\C:\\Users\\RD\\AppData\\Local\\ORS\\Dragonfly40\\tempLut.tfi'
classmethod updateLUTAllViews(layout, layoutProperties)
classmethod updateSceneProperties(layout, datasetIsVisible=False)

legendLogic

class OrsHelpers.legendLogic.LegendLogic(implementation)

Helper related to the class ORSModel.ors.VisualLegend.

classmethod createDiscreteLegend(legendTitle, parentObject, layout, lutUUID=None, updateLayoutProperties=False, aScalarValueTypeTag='')
classmethod createLegend(legendTitle, parentObject, layout, lutUUID=None, useColorLUT=False, updateLayoutProperties=True, aScalarValueTypeTag='')
classmethod selectedObjectsChange(implementation)
classmethod updateLegendVisibility(implementation, listOfLegends, setDisplayDirty=True)

ListHelper

class OrsHelpers.ListHelper.ListHelper

Helper for manipulating Python lists and ORS lists.

classmethod asPythonCollection(orslist)
classmethod asPythonCollectionString(orslist)
classmethod convertStringifiedListOfFilenames(string)
classmethod deleteAllObjectInORSList(aListOfObjectToBeDeleted)
classmethod fromPythonCollection(aList, asPythonList=False)
classmethod fromPythonCollectionString(guids)

managedhelper

class OrsHelpers.managedhelper.ManagedHelper

Helper related to the class ORSModel.ors.Managed.

interfacemethod copy(anObject)

Copies a Managed object

Parameters:anObject (ORSModel.ors.Managed) – the Managed object to copy
Returns:newObject (ORSModel.ors.Managed) – the copied Managed
classmethod copyAndPublish(anObject)
classmethod copyAndPublishMany(listOfManaged)
interfacemethod delete(anObject)

Deletes a Managed Object

Parameters:anObject (ORSModel.ors.Managed) – the Managed object to delete
classmethod getDoAFitToView(layout)

Gets to know if a fit to view should be done when setting an instance of Managed as visible.

Parameters:layout – a scene layout
Returns:outputTrue if a fit to view should be performed in the the views of the layout; False otherwise.
interfacemethod publish(anObject)

Publishes an object.

Parameters:anObject (ORSModel.ors.Managed) – an object
classmethod publishStringifiedList(aString)

Publishes a list of objects, where the list is stringified.

No logging of the publish is made, since this method has been designed to be used for the postinstantiate step (to reload autosaved objects).

interfacemethod unpublish(anObject)

Unpublishes an object.

Parameters:anObject (ORSModel.ors.Managed) – an object

meshcompare

class OrsHelpers.meshcompare.MeshCompareHelper

Helper to perform comparison on meshes.

This is essentially for testing purposes.

classmethod compare(mesh1, mesh2)

Compares meshes. :param mesh1: First mesh. :param mesh2: Second mesh. :return: True if both meshes are equivalent; False otherwise.

meshhelper

class OrsHelpers.meshhelper.MeshHelper

Helper related to the class ORSModel.ors.Mesh.

interfacemethod computeGuassianCurvatureAsVertexScalarValues(IMeshModel, iTIndex)

Compute Gaussian curvature and put the result as a vertex scalar values

Parameters:
  • IMeshModel (ORSModel.ors.Mesh) – the mesh to analyse curvature
  • iTIndex (int) – the current time step
interfacemethod computeMeanCurvatureAsVertexScalarValues(IMeshModel, iTIndex)

Compute mean curvature and put the result as a vertex scalar values

Parameters:
  • IMeshModel (ORSModel.ors.Mesh) – the mesh to analyse curvature
  • iTIndex (int) – the current time step
interfacemethod copy(aMesh)

Copies a mesh

Parameters:aMesh (ORSModel.ors.Mesh) – the mesh to copy
Returns:newMesh (ORSModel.ors.Mesh) – the copied mesh
interfacemethod copyMesh(aMesh)

Copies a mesh

Parameters:aMesh (ORSModel.ors.Mesh) – the mesh to copy
Returns:newMesh (ORSModel.ors.Mesh) – the copied mesh
classmethod copyMeshAndPublish(aMesh)
classmethod createMeshFromAbstractMesh(IMeshModel, layout=None)

Creates the mesh visual object from the mesh model object.

Parameters:
Returns:

visualMesh (ORSModel.ors.VisualMesh) – the mesh visual object

interfacemethod createMeshFromMultiROI(aMultiROI, IProgress=None)

Creates a new mesh from a MultiROI

Parameters:
Returns:

aMesh (ORSModel.ors.Mesh) – new mesh

classmethod createOrientedContourPathFromAnOrientedPlaneMeshCutter(IMeshModel, IListOfOrientedPlane, ITIndex)
classmethod exportToVtkPolyData(IMeshModel, IPath, ITIndex)
classmethod exportToXMLVtkPolyData(IMeshModel, IPath, ITIndex)
classmethod generateLinearInterpolatedContourMesh(aStructuredGrid, isovalue, forceAClosedMesh=True, samplingX=1, samplingY=1, samplingZ=1)

Generates a mesh from a structured grid using a vtk marching cube algorithm

Parameters:
  • aStructuredGrid (ORSModel.ors.StructuredGrid) – reference structured grid for mesh generation
  • isovalue (float) – select the intensity value for which the contour mesh will be generated on the structured grid for ROI and Multi-ROI use an isovalue between 0 and 100.
  • forceAClosedMesh (bool) – if true, generate a closed contour mesh
  • samplingX (int) – sampling factor in x direction
  • samplingY (int) – sampling factor in y direction
  • samplingZ (int) – sampling factor in z direction
Returns:

orsSurface (ORSModel.ors.Mesh) – a contour mesh

classmethod getDisplayModelClass()
classmethod getIsEnabledIn3D(obj)
classmethod getLegendTitle(aMesh, aScalarValueTypeTag='')
classmethod getListOfDisplayRenderingMesh(aMesh)

Deprecated : Use getListOfDisplayRendering instead

Deprecated since version 4.0.

classmethod getModelClass()
interfacemethod getNonManifoldEdgesCount(mesh, iTIndex=0, progress=None)

Find non manifold edges count

Parameters:
Returns:

output (int) – non manifold edges count, or -1 if the computation fail

classmethod getPointsFromAPlaneMeshCutter(IMeshModel, IPlane, ITIndex)
classmethod getVisualModelClass()
classmethod loadFromVTKFile(IPath, showProgress, progress, ITIndex)

Deprecated : this function cannot load a VTK file with chinese characters in the path name

classmethod loadFromXMLVTKFile(IPath, showProgress, progress, ITIndex)

Deprecated : this function cannot load a XML VTK file with chinese characters in the path name

classmethod mapAListOfScalarSlotFromAMeshToAnother(sourceMesh: ORSModel.ors.Mesh, referenceMesh: ORSModel.ors.Mesh, listOfSlotId, referenceTIndex, sourceTIndex, defaultScalarValue)

Maps vertices scalar values of a reference mesh to a source mesh

Parameters:
  • sourceMesh (ORSModel.ors.Mesh) – a source mesh
  • referenceMesh (ORSModel.ors.Mesh) – a reference mesh
  • listOfSlotId (int) [count=[1, None]] – a list of scalar slot index
  • referenceTIndex (int) – the time step of the reference mesh
  • sourceTIndex (int) – the time step of the source mesh
  • defaultScalarValue (float) – A default value if no match is possible between a vertex and the Multi ROI label
Returns:

output (bool) – True if the mapping works, else False

classmethod mapAListOfScalarSlotFromAMultiROIToAMesh(sourceMesh: ORSModel.ors.Mesh, referenceMultiROI: ORSModel.ors.MultiROI, listOfSlotId, referenceMultiROITIndex, sourceMeshTIndex, defaulfScalarValue=1.0)

Maps a list of scalar values from a reference multi ROI to a source mesh

Parameters:
  • sourceMesh (ORSModel.ors.Mesh) – a source mesh
  • referenceMultiROI (ORSModel.ors.MultiROI) – a reference MultiROI
  • listOfSlotId (int) [count=[1, None]] – a list of scalar slots index to map
  • referenceMultiROITIndex (int) – the time step of the reference multiROI
  • sourceMeshTIndex (int) – the time step of the source mesh
  • defaulfScalarValue (float) – A default value if no match is possible between a vertex and the Multi ROI label
Returns:

output (bool) – True if the mapping works, else False

classmethod performHanningWindowedSmoothing(mesh, nbOfIterations, boundarySmoothing=False, featureEdgeSmoothing=False, featureAngle=0.5, passBandFactor=0.1, includesScalars=False, createNewMesh=False, iTIndex=0, IProgress=None)

Smooth a mesh with vtkWindowedSincPolyDataFilter algorithm. For more information, check the official vtk vtkWindowedSincPolyDataFilter documentation

Parameters:
  • mesh (ORSModel.ors.Mesh) – a mesh
  • nbOfIterations (int) – number of iterations
  • boundarySmoothing (bool) – perform smoothing of vertices on the boundary of the mesh, default value is False
  • featureEdgeSmoothing (bool) – smoothing along sharp interior edges, default value is False
  • featureAngle (float) – specify the feature angle for sharp edge identification (in degree) 0.5 by default
  • passBandFactor (float) – Set the pass band value for the windowed filter, default value is 0.1
  • includesScalars (bool) – if true scalars values will be keeped, else not. Default value is False
  • createNewMesh (bool) – if true, the output will be an new mesh object, else perform smoothing on the input. Default value is False.
  • iTIndex (int) – current time step, default value is 0
  • IProgress (ORSModel.ors.Progress) – a progress, default value is None
Returns:
  • output (ORSModel.ors.Mesh, None) – a Smoothed mesh if worked, else None
  • errorCode (int) – an error code that provide more information when the computation fail
classmethod performVTKButterflyMeshSubdivision(mesh, numberOfSubdivision=1, includeScalars=False, createNewMesh=False, iTIndex=0, IProgress=None)

Subdivide a mesh by a factor based on the vtkButterflySubdivisionFilter. For more information, check the original documentation.

Parameters:
  • mesh (ORSModel.ors.Mesh) – a mesh model
  • numberOfSubdivision (int) – number of subdivisions
  • createNewMesh (bool) – the number of times that the mesh will be subdivided
  • includeScalars (bool) – Include or not scalar in input
  • iTIndex (int) – current time step
  • IProgress (ORSModel.ors.Progress) – a progress bar object
Returns:
  • output (ORSModel.ors.Mesh) – a subdivided mesh if it worked, else None
  • errorString (str) – give more information why the algorithm did succed
classmethod performVTKLinearMeshSubdivision(mesh, numberOfSubdivision=1, includeScalars=False, createNewMesh=False, iTIndex=0, IProgress=None)

Subdivide a mesh by a factor based on the vtkLinearSubdivisionFilter. For more information, check the original documentation.

Parameters:
  • mesh (ORSModel.ors.Mesh) – a mesh model
  • numberOfSubdivision (int) – number of subdivisions
  • createNewMesh (bool) – the number of times that the mesh will be subdivided
  • includeScalars (bool) – Include or not scalar in input
  • iTIndex (int) – current time step
  • IProgress (ORSModel.ors.Progress) – a progress bar object
Returns:
  • output (ORSModel.ors.Mesh) – a subdivided mesh if it worked, else None
  • errorString (str) – give more information why the algorithm did succed
classmethod performVTKLoopMeshSubdivision(mesh, numberOfSubdivision=1, includeScalars=False, createNewMesh=False, iTIndex=0, IProgress=None)

Subdivide a mesh by a factor based on the vtkLoopSubdivisionFilter. For more information, check the original documentation.

Parameters:
  • mesh (ORSModel.ors.Mesh) – a mesh model
  • numberOfSubdivision (int) – number of subdivisions
  • createNewMesh (bool) – the number of times that the mesh will be subdivided
  • includeScalars (bool) – Include or not scalar in input
  • iTIndex (int) – current time step
  • IProgress (ORSModel.ors.Progress) – a progress bar object
Returns:
  • output (ORSModel.ors.Mesh) – a subdivided mesh if it worked, else None
  • errorString (str) – give more information why the algorithm did succed
classmethod performVTKProMeshDecimation(mesh, targetDecimator=0.5, iTIndex=0, createNewMesh=False, includeScalar=False, bShowProgress=True)
classmethod performVTKProMeshDecimationFromGUID(meshGUID, targetDecimator=0.5, iTIndex=0, createNewMesh=False, includeScalar=False, bShowProgress=True)
classmethod performVTKProMeshDecimationFromGUIDAndPublish(meshGUID, targetDecimator=0.5, iTIndex=0, createNewMesh=True, includeScalar=False, bShowProgress=True)
classmethod performVTKQuadricMeshDecimation(mesh, targetDecimator=0.5, iTIndex=0, createNewMesh=False, bShowProgress=True)
classmethod readAFile(reader, IPath)
classmethod refreshOctree(aMesh)
interfacemethod setIsVisibleForViewFromLayoutGenealogicalName(aName, aMesh, isVisible)

Set view mode for Mesh

Deprecated since version 4.0.

Parameters:
  • aName (str) – a genealogical name
  • aMesh (ORSModel.ors.Mesh) – a Mesh
  • isVisible (bool) – visibility
interfacemethod setIsVisibleIn2DFromGenealogicalName(name, aMesh, isVisible)

Sets the visibility of a mesh in all 2D views of the given scene layout

Parameters:
  • name (str) – a genealogical name of a scene layout
  • aMesh (ORSModel.ors.Mesh) – a Mesh
  • isVisible (bool) – True to set as visible, False otherwise
classmethod setLUT(aMesh, aLUT, aView=None, aScalarValueTypeTag='')

Set LUT for a View, if view is None, the lut will be set for all view

classmethod updateColorFromVertexScalarValue(aMesh, forceToRefresh=False, aScalarValueTypeTag='', iTIndex=0)
classmethod updateLegend(aMesh, display=None, ITopFrame=None, aScalarValueTypeTag='')
classmethod updateMeshColorFromVertexScalarValue(IMeshModel, forceToRefresh=False)

multiroicomparehelper

class OrsHelpers.multiroicomparehelper.MultiROICompareHelper

Helper to perform comparison on MultiROIs.

This is essentially for testing purposes.

classmethod compare(aMultiROI1, aMultiROI2)

Compares MultiROIs. :param aMultiROI1: First Multi-ROI. :param aMultiROI2: Second Multi-ROI. :return: True if both Multi-ROIs are equivalent; False otherwise.

getWarningFromLastCompare()
lastWarning = ''

orschannelregistrationhelper

class OrsHelpers.orschannelregistrationhelper.OrsChannelRegistrationHelper

Helper for performing channel registration.

classmethod getSuggestedHistogramSizesSturgesRule(channelA, channelB)

orsregistrationhelper

class OrsHelpers.orsregistrationhelper.OrsRegistrationHelper

Helper for performing registration.

classmethod addTransformationMatrixToUserInfo(objectGUI, matrix, registrationMethod=None)
classmethod applyTransformationFromAnObjectToAnOtherObject(referenceObjectGUID, movingObjectGUID, iTIndex=0)
classmethod deleteLastTransformationMatrix(objectGUID)
classmethod getAllTransfromationStringMatrixFromUserInfo(objectGUID)
classmethod getCurrentRegistrationIndex(objectGUI)
classmethod getCurrentRegistrationKey(objectGUI)
classmethod getCurrentRegistrationKeyOfManaged(aManaged)
classmethod getEulerAnglesFromTransformMatrix(transformationMatrix, scale)
classmethod getEulerAnglesInDegreeFromTransformMatrix(transformationMatrix, scale)
classmethod getIdentityTransformationMatrix()
classmethod getIsFirstTransformationOn(objectGUI)
classmethod getIsLastTransformationOn(objectGUI)
classmethod getLastRegistrationMethod(objectGUI)
classmethod getLastTransformationMatrix(objectGUI)
classmethod getNumberOfRegistrationKeys(objectGUI)
classmethod getTotalAppliedTransformationMatrix(channelGUID)
classmethod getTransformationMatrixAtIndex(objectGUI, index)
classmethod getTransformationMatrixThatAreDifferentFromAReferenceObject(referenceObjectGUID, anObjectGUID)
classmethod removeTransformationMatrixFromUserInfo(objectGUI)

phantomgenerators

class OrsHelpers.phantomgenerators.PhantomGenerators

Helper for generating testing/debugging datasets.

classmethod circleIntensityToDataset(datasetGUID, circleDiameter, circleDepth, boxHeight, boxWidth, boxDepth, intensityList)

Method that adds circles with the specified dimensions and intensities to an existing dataset. The number of shapes created will depend on the dimensions given and the number of intensities within the intensityList.

Parameters:
  • datasetGUID – string Unique identification of an ORSChannel.
  • circleDiameter – uint Diameter according to the Y and X axis that all shapes will have.
  • circleDepth – uint Depth according to the Z axis that all volumes will have.
  • boxHeight – uint Height according to the Y axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxWidth – uint Width according to the X axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxDepth – uint Depth according to the Z axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • intensityList – list of float Intensity values that will be given to individual volume generated.
classmethod createEmptyChannel(xSize=100, ySize=100, zSize=100, title='New Phantom Dataset', dataType=<class 'numpy.uint8'>, spacing=[1.0, 1.0, 1.0, 1.0])

Method that generates an empty channel with the desired dimensions, spacing, title and data type.

Parameters:
  • xSize – uint Width of the generated dataset.
  • ySize – uint Height of the generated dataset.
  • zSize – uint Depth of the generated dataset.
  • title – string Name that will be given to the generated dataset.
  • dataType – type Numpy data type the array should have. This data type will be the same as the one used in the generated
  • spacing – list of floats Each index specifies the spacing of direction0, direction1, direction2 and T. dataset.
Returns:

output – Dataset’s GUID if it is generated correctly.

static flattenList(listToFlatten, numberOfTime)
static generate4dPhantom(pathToWritte, xySize, imgSize, imgToHidePath=None, posToHide=None, fontsize=50)
static generate5dPhantom(pathToWritte, xySize, imgSize, imgToHidePath=None, posToHide=None, fontsize=50)
static generate6dPhantom(pathToWritte, xySize, imgSize, imgToHidePath=None, posToHide=None, fontsize=50)
static generateHyperDimensionalFromNumpyArray(pathToWritte, array, labels, unit)
classmethod generateIntensities(dataset, listNumbers, fontsize=50)
classmethod rectangleIntensityToDataset(datasetGUID, rectangleHeight, rectangleWidth, rectangleDepth, boxHeight, boxWidth, boxDepth, intensityList)

Method that adds rectangles with the specified dimensions and intensities to an existing dataset. The number of shapes created will depend on the dimensions given and the number of intensities within the intensityList.

Parameters:
  • datasetGUID – string Unique identification of an ORSChannel.
  • rectangleHeight – uint Height according to the Y axis that all shapes will have.
  • rectangleWidth – uint Width according to the X axis that all shapes will have.
  • rectangleDepth – uint Depth according to the Z axis that all volumes will have.
  • boxHeight – uint Height according to the Y axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxWidth – uint Width according to the X axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxDepth – uint Depth according to the Z axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • intensityList – list of float Intensity values that will be given to individual volume generated.
classmethod saveImagesFromNumpyArray(npArray, outputImageFileStringToFormat)

Helper to save a numpy array as a set of images into a directory

Parameters:
  • npArray – numpy array Array to write as individual images. The accepted shape is (z, y, x).
  • outputImageFileStringToFormat – string String to format with an image number, where the images will be saved. Ex: C:tmpImagesTestImage_{:04g}.tif
Returns:

output – None

classmethod saveImagesIntensities(numberMin, numberMax, xSize, ySize, fontsize=50, imgPath='C:\\tmp\\ImagesTest\\Image_{:04g}.tif')
classmethod shapeAndIntensityToDataset(datasetGUID, shape, shapeHeight, shapeWidth, shapeDepth, boxHeight, boxWidth, boxDepth, intensityList)

Method that adds the desired shape with the specified dimensions and intensities to an existing dataset. The number of shapes created will depend on the dimensions given and the number of intensities within the intensityList.

Parameters:
  • datasetGUID – string Unique identification of an ORSChannel.
  • shape – string 2D shape of the area to be painted, either ‘circle’ or ‘rectangle’.
  • shapeHeight – uint Height according to the Y axis that all shapes will have.
  • shapeWidth – uint Width according to the X axis that all shapes will have.
  • shapeDepth – uint Depth according to the Z axis that all volumes will have.
  • boxHeight – uint Height according to the Y axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxWidth – uint Width according to the X axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • boxDepth – uint Depth according to the Z axis of the box surrounding the shape. Having greater box dimensions than shape dimensions will prevent overlapping.
  • intensityList – list of float Intensity values that will be given to individual volume generated.
Returns:

output – None if the intensityList is empty. None if the provided shape is not recognized.

primitivehelper

class OrsHelpers.primitivehelper.PrimitiveHelper

Helper related to the class ORSModel.ors.Annotation.

interfacemethod addControlPoint(anAnnotation, timeStep, position, transformationMatrix=None)

Adds a control point in an annotation.

Parameters:
Returns:

success (bool) – True if successful, False otherwise

interfacemethod createPrimitive(primitiveClass, aLayoutName, associatedState)

Creates an annotation.

Parameters:
  • primitiveClass (ORSModel.ors.Annotation class) – the class of the annotation to create
  • aLayoutName (str) – a layout genealogical name
  • associatedState (str) – edition associated state
Returns:

newAnnotation (ORSModel.ors.Annotation) – the created annotation

interfacemethod deletePrimitive(anAnnotation)

Deletes an annotation.

Parameters:anAnnotation (ORSModel.ors.Annotation) – the annotation object to delete
Returns:success (bool) – True if successful, False otherwise
interfacemethod deselectControlPoint(anAnnotation, controlPointIndex, timeStep)

Deselects a control point from an annotation.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • controlPointIndex (int) – index of the control point in the annotation
  • timeStep (int) – time index of the annotation
Returns:

success (bool) – True if successful, False otherwise

interfacemethod insertControlPoint(index, anAnnotation, timeStep, position, transformationMatrix=None)

Insert a control point.

Parameters:
  • index (int) – index of the control point to insert
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • timeStep (int) – time index of the annotation
  • position (ORSModel.ors.Vector3) – (X, Y, Z) coordinate of the new position
  • transformationMatrix (ORSModel.ors.Matrix4x4) – the transformation matrix (optional)
Returns:

success (bool) – True if successful, False otherwise

interfacemethod removeControlPoint(anAnnotation, controlPointIndex, timeStep)

Removes a control point from an annotation.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • controlPointIndex (int) – index of the control point in the annotation
  • timeStep (int) – time index of the annotation
Returns:

success (bool) – True if successful, False otherwise

interfacemethod selectControlPoint(anAnnotation, controlPointIndex, timeStep)

Selects a control point from an annotation.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • controlPointIndex (int) – index of the control point in the annotation
  • timeStep (int) – time index of the annotation
Returns:

success (bool) – True if successful, False otherwise

interfacemethod setControlPointPosition(anAnnotation, controlPointIndex, timeStep, position, transformationMatrix=None)

Sets the position of a control point.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • controlPointIndex (int) – index of the control point in the annotation
  • timeStep (int) – time index of the annotation
  • position (ORSModel.ors.Vector3) – (X, Y, Z) coordinate of the new position
  • transformationMatrix (ORSModel.ors.Matrix4x4) – the transformation matrix (optional)
Returns:

success (bool) – True if successful, False otherwise

interfacemethod setRegionShape(anAnnotation, regionShape)

Sets the shape of an region annotation.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • regionShape (IntEnum CxvRegion_Shape) – the shape to set
Returns:

success (bool) – True if successful, False otherwise

interfacemethod translatePrimitive(anAnnotation, timeStep, xOffset, yOffset, zOffset)

Translates an annotation.

Parameters:
  • anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
  • timeStep (int) – time index of the annotation
  • xOffset (float) – translation X distance
  • yOffset (float) – translation Y distance
  • zOffset (float) – translation Z distance
Returns:

success (bool) – True if successful, False otherwise

progresslogger

class OrsHelpers.progresslogger.ProgressLogger

Helper related to the class ORSModel.ors.Progress.

Deprecated since version 3.1: Set the optional argument logging at True when calling the constructor or any method to log the call.

interfacemethod closeProgress(aProgress)

Closes the progress bar

This protocol is also called automatically when the interface gets deleted, so it is not necessary to call it.

Parameters:aProgress (ORSModel.ors.Progress) – a Progress object
interfacemethod createProgressObject()

Creates a Progress object

Returns:aProgress (ORSModel.ors.Progress) – the created progress object
interfacemethod decrementRangeBy(aProgress, decrementRangeValue)

Decrements the progress range

This protocol is only relevant when the progress is not a working progress.

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • decrementRangeValue (int) – the range decrement
interfacemethod deleteProgressObject(aProgress)

Deletes a Progress object

Parameters:aProgress (ORSModel.ors.Progress) – a progress object
interfacemethod incrementRangeBy(aProgress, incrementRangeValue)

Increments the progress range

This protocol is only relevant when the progress is not a working progress.

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • incrementRangeValue (int) – the range increment
classmethod logCreateProgressObject(IProgress)

This method is to be able to use the overloaded “new” of Progress.

This is to cover the 4 common situations:
  • call aProgress = Progress() in Python (call “new” with log);
  • calling createProgressObject directly (from Python code or from the execution of a macro);
  • calling aProgress = orsObj(aProgressGUID) (this calls “new” to create a new Python reference,
    but should not log because the logging of that object occurred at its creation);
  • calling a COMWrapper method with a progress at None (this calls “new” from sip
    with a Progress object at none; this should not log).
Parameters:IProgress – the newly created Progress object to log
loggedProgressGUID = []
newProgressGUID = ''
interfacemethod resetCancelledState(aProgress)

Resets the cancelled state

Parameters:aProgress (ORSModel.ors.Progress) – a Progress object
interfacemethod setExtraText(aProgress, text)

Sets the extra text

Parameters:
interfacemethod setIsCancellable(aProgress, isCancellable)

Sets if the progress is cancellable

Parameters:
  • aProgress (ORSModel.ors.Progress) – a progress object
  • isCancellable (bool) – True to make the progress cancellable, False otherwise
interfacemethod setIsCancelled(aProgress, isCancelled)

Sets the progress to be cancelled or not

This protocol is only relevant when the progress is a cancellable progress.

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • isCancelled (bool) – True to set in a cancelled state, False otherwise
interfacemethod startProgressWithCaption(aProgress, caption, range, isCancellable)

Starts a normal progress bar

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • caption (str) – the progress caption
  • range (int) – the range
  • isCancellable (bool) – True if the progress bar is to be cancellable, False otherwise
interfacemethod startProgressWithID(aProgress, progressID, range, isCancellable)

Starts a normal progress bar

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • progressID (int) – the progress ID (see ORSProgressBars.h for supported IDs)
  • range (int) – the range
  • isCancellable (bool) – True if the progress bar is to be cancellable, False otherwise
interfacemethod startWorkingProgressWithCaption(aProgress, caption, isCancellable)

Starts a working progress bar

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • caption (str) – the progress caption
  • isCancellable (bool) – True if the progress bar is to be cancellable, False otherwise
interfacemethod startWorkingProgressWithID(aProgress, progressID, isCancellable)

Starts a working progress bar

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • progressID (int) – the progress ID (see ORSProgressBars.h for supported IDs)
  • isCancellable (bool) – True if the progress bar is to be cancellable, False otherwise
interfacemethod updateProgress(aProgress, progressPosition)

Updates the progress bar

This protocol should not be used with working progress bars, as they do not have a position.

Parameters:
  • aProgress (ORSModel.ors.Progress) – a Progress object
  • progressPosition (int) – the new progress bar position

refreshHelper

class OrsHelpers.refreshHelper.RefreshHelper

Helper for refreshing views.

classmethod getAllParentDisplaysWhereVisualsAreVisible(visuals)

roicomparehelper

class OrsHelpers.roicomparehelper.ROICompareHelper

Helper to perform comparison on ROIs.

This is essentially for testing purposes.

classmethod compare(aROI1, aROI2)

Compares ROIs. :param aROI1: First ROI. :param aROI2: Second ROI. :return: True if both ROIs are equivalent; False otherwise.

getWarningFromLastCompare()
lastWarning = ''

roihelper

class OrsHelpers.roihelper.ROIHelper

Helper related to the classes ORSModel.ors.ROI and ORSModel.ors.MultiROI.

interfacemethod closeHoles(aROI, threshold, progress)

Creates a ROI obtained from the closing operation of the input ROI

Parameters:
Returns:

closedROI (ORSModel.ors.ROI) – a new ROI

interfacemethod computeInterfacialSurface(referenceROI, listOfROIs, iTIndex=0, aProgress=None)

Compute the interfacial surface area between a reference ROI/Multi-ROI and other ROI/Multi-ROI

Parameters:
Returns:

interfacialSurface – the interfacial surface

classmethod convertLabeledMultiROIToROI(LMRSource, ROIDestination, labelList=None)
classmethod copyLabeledMultiROI(LMRSource, LMRDestination, labelList=None)
interfacemethod copyMultiROI(aMultiROI)

Copies a MultiROI

Parameters:aMultiROI (ORSModel.ors.MultiROI) – the MultiROI to copy
Returns:newMultiROI (ORSModel.ors.MultiROI) – the copied MultiROI
classmethod copyMultiROIAndPublish(aMultiROI)
interfacemethod copyROI(aROI)

Copies a ROI

Parameters:aROI (ORSModel.ors.ROI) – the ROI to copy
Returns:newROI (ORSModel.ors.ROI) – the copied ROI
classmethod copyROIAndPublish(aROI)
classmethod createFullVolumeROIWithStructuredGrid(aROI)
interfacemethod createMultiROIFromStructuredGrid(structuredGridReference, MultiROITitle)

Creates a Multi ROI with the same shape of a reference structured grid.

Parameters:
  • structuredGridReference (ORSModel.ors.StructuredGrid) – the structured grid of reference
  • MultiROITitle (str) – title of the MultiROI
Returns:

aMultiROI (ORSModel.ors.MultiROI) – new MultiROI

interfacemethod createROIFromStructuredGrid(structuredGridReference, ROITitle, ROIColor)

Creates a ROI with the same shape of a reference structured grid.

Parameters:
Returns:

aROI (ORSModel.ors.ROI) – new ROI

classmethod executeMethod(listROIGUIDToModify, methodToExecute, args=None, updateUndo=True)
classmethod fitBoundingBoxOfLabelToView(aMultiROI, label, view)
classmethod fitBoundingBoxToView(aROI, view)
classmethod fitToView(aROI, view)
classmethod get2DOpacity(aROI, view=None)
classmethod get3DOpacity(aROI, view=None)
classmethod getCenterOfMass(anOrsObject, iTIndex)
classmethod getColor(aROI, view=None)

Return the color of a ROI for a given display

Parameters:
Returns:

output – (r, g, b, a) a tuple of normalized color

classmethod getEmptyLabels(aMultiROI)
interfacemethod getHighlightOpacityForAllViews(aROI)

Gets the in-range and out-of-range highlight opacity of a ROI or MultiROI for all views

Parameters:

aROI (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – a ROI or a MultiROI

Returns:
  • highlightOpacityInRange (float) – in-range highlight opacity
  • highlightOpacityOutRange (float) – out-of-range highlight opacity
classmethod getIntersectionOfROIAndMultiROIThatIntersectPositionOnRectangle(rectangle, worldposition, roisOrMultiROIs, timestep)
classmethod getIsVisible(roi, display)
classmethod getIsVisibleIn2D(aROI, view)
Parameters:
Returns:

output (bool) – the 2D ROI visibility

classmethod getIsVisibleIn3D(aROI, view)
Parameters:
Returns:

output (bool) – the 3D ROI visibility

classmethod getLUT(aMultiROI)
classmethod getLegend(aMultiROI, forceCreation=False)
classmethod getLegendTitle(aMultiROI)
classmethod getListOf2DDisplayRenderingROI(aROI)
classmethod getListOf3DDisplayRenderingROI(aROI)
classmethod getListOfDisplayRenderingROI(aROI)
classmethod getNonEmptyLabels(aMultiROI)
classmethod getROIInterpolationMode(aROI)
classmethod getShowContour(aROI, view)
classmethod getUseDiscreteLegend(aROI)
classmethod getVisualROI(aROI, forceCreation=False)

Return the VisualROI associated with a ROI

Parameters:
  • aROI (ORSModel.ors.ROI) – a ROI
  • forceCreation (bool) – (optional) Force creation if no aVisualROI found
Returns:

output (ORSModel.ors.VisualROI) – the VisualROI

interfacemethod intersection(inputROIs, destinationROI, clearDestination=False, keepEmptyLabels=False)

Intersects multiple ROIs or Multi-ROi.

The input argument destinationROI cannot be None. If required, create a ROI or a MultiROI prior to calling this method (ex: ROIHelper.createROIFromStructuredGrid).

Parameters:
  • inputROIs (ORSModel.ors.ROI, ORSModel.ors.MultiROI) [count=[2, None]] – list of ROIs and/or Multi-ROIs
  • destinationROI (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – ROI or MultiROI of destination
  • clearDestination (bool) – if True, the destinationROI will be cleared before getting the output result.
  • keepEmptyLabels (bool) – This is only applicable for the situation where the destination is a MultiROI. If False, empty labels of the destination are removed.
interfacemethod keepLabelIntersectingRoiOrMultiROI(iRoiOrMRoi, listOfRoiAndMRoiIntersecting, iTIndex, oRoiorMRoi=None)

Keep label that are intersecting the ROI and Multi-ROI in the list.

Parameters:
  • iRoiOrMRoi (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – input reference ROI or Multi-ROI
  • iTIndex (int) – time step
  • listOfRoiAndMRoiIntersecting (ORSModel.ors.ROI, ORSModel.ors.MultiROI) [count=[1, None]] – list of ROIs and/or Multi-ROIs that will be used for intersection
  • oRoiorMRoi – an output ROI or Multi-ROI that contain the result (labels not removed from the intersection)
interfacemethod loadROIsFromFile(filename)

Loads all ROIs found in an ORSObject file

Parameters:filename (file) – fully qualified file name
Returns:newROIs (ORSModel.ors.ROI) [count=[0, None]] – list of new ROIs
classmethod outputROIListToPNG(ROIList, filename)
classmethod recoverFromUndo(listROIGUIDToRecoverFromUndo)
interfacemethod removeEmptyLabelsAndRenumber(aMultiROI)

Removes the empty labels and renumber the remaining ones

Parameters:aMultiROI (ORSModel.ors.MultiROI) – the MultiROI to modify
interfacemethod removeEmptyLabelsAndRenumberOnSize(aMultiROI, bAscending)

Removes the empty labels and renumber the remaining ones

Parameters:
  • aMultiROI (ORSModel.ors.MultiROI) – the MultiROI to modify
  • bAscending (bool) – a boolean flag indicating the sort order
interfacemethod removeLabelIntersectingRoiOrMultiROI(iRoiOrMRoi, listOfRoiAndMRoiIntersecting, iTIndex, oRoiorMRoi=None)

Remove label that are intersecting the ROI and Multi-ROI in the list.

Parameters:
  • iRoiOrMRoi (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – input reference ROI or Multi-ROI
  • iTIndex (int) – time step
  • listOfRoiAndMRoiIntersecting (ORSModel.ors.ROI, ORSModel.ors.MultiROI) [count=[1, None]] – list of ROIs and/or Multi-ROIs that will be used for intersection
  • oRoiorMRoi – an output ROI or Multi-ROI that contain the result (labels not removed from the intersection)
classmethod roiConnectedComponentBySliceIterator(aROI: ORSModel.ors.ROI, tIndex: int, considerDiagonal: bool, box=None)
Parameters:
  • aROI – ROI to extract connected components from
  • tIndex
  • considerDiagonal – whether to consider areas with touching points on diagonal as connected
Returns:

output – list of connected ROIs in each slice

classmethod set2DOpacity(aROI, view=None, highlightOpacity=None, highlightOpacityInRange=None, highlightOpacityOutRange=None)
classmethod set3DOpacity(aROI, view=None, volumeOpacity=None, highlightOpacity=None, highlightOpacityInRange=None, highlightOpacityOutRange=None, roiOpacity=None, roiOpacityInRange=None, roiOpacityOutRange=None)
interfacemethod setColor(aROI, aColor, highlightOpacityInRange=None)

Sets the ROI color.

Parameters:
  • aROI (ORSModel.ors.ROI) – the ROI to set the color to
  • aColor (ORSModel.ors.Color) – the new color
  • highlightOpacityInRange (float) – the alpha normalized color (between 0.0 and 1.0) (optional)
classmethod setIsVisibleIn2D(aROI, view, value)
Parameters:
interfacemethod setIsVisibleIn2DFromGenealogicalName(name, aROI, isVisible)

Sets the visibility of a ROI or MultiROI in all 2D views of the given scene layout

Parameters:
  • name (str) – a genealogical name of a scene layout
  • aROI (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – a ROI or a MultiROI
  • isVisible (bool) – True to set as visible, False otherwise
classmethod setIsVisibleIn3D(aROI, view, value)
Parameters:
interfacemethod setIsVisibleIn3DFromGenealogicalName(name, aROI, isVisible)

set 3D visibility of a ROI or of a MultiROI

Parameters:
classmethod setLUT(aMultiROI, newLUT, aView=None)

Note if aView is None the LUT will be set for all views

classmethod setLabelAsScalarValue(aMultiROI)
classmethod setROIInterpolationMode(obj, value)
classmethod setShowContour(aROI, view, value)
interfacemethod subtract(firstROI, secondROI, destinationROI, clearDestination=False, keepEmptyLabels=False)

Subtracts a ROI or Multi-ROi from another ROi or Multi-ROI, as: destinationROI = firstROI - secondROI.

The input argument destinationROI cannot be None. If required, create a ROI or a MultiROI prior to calling this method (ex: ROIHelper.createROIFromStructuredGrid).

Parameters:
interfacemethod union(inputROIs, destinationROI, keepEmptyLabels=False)

Makes the union of multiple ROIs or Multi-ROi.

The input argument destinationROI cannot be None. If required, create a ROI or a MultiROI prior to calling this method (ex: ROIHelper.createROIFromStructuredGrid).

Parameters:
classmethod updateLegend(aMultiROI, view, lutUUID, forceUpdate=False)
classmethod updateMultiROIColor(aMultiROI)
classmethod updateROIVisibilityOrder(guidList, topToBottom=True)
classmethod updateUndo(listROIGUIDToUpdate)

SaversHelper

class OrsHelpers.SaversHelper.SaversHelper

Helper to start plugins of the “saver” kind (ex: OrsImageSaver, OrsMeshSaver).

classmethod openImageSaverOnDataset(aChannelGUID)
classmethod openMeshSaverOnDataset(aMeshGUID)

sequentialcolorgenerator

class OrsHelpers.sequentialcolorgenerator.SequentialColorGenerator(lut_name=None, lut_guid=None, startIdx=0)

Generator of colors.

getColorIndex(key)
getDiscreteLUT()
getOrsColor(key)
getQColor(key)
setDiscreteLUT(ILUT)
setOrsColor(key, orsColor)
setQColor(key, qColor)

structuredGridHelper

class OrsHelpers.structuredGridHelper.StructuredGridHelper

Helper related to the manipulation of classes inheriting ORSModel.ors.StructuredGrid (namely, Channel, ROI and MultiROI).

classmethod getClipBox(structuredGrid, viewOrTopFrame, forceCreation=False)
classmethod getClipBoxForCurrentView(structuredGrid, forceCreation=True, implementation=None)
classmethod getClipBoxes(structuredGrid)
classmethod getVisual(structuredGrid)
classmethod getVisualReachableByDisplay(structuredGrid, view)
classmethod refreshVisual(structuredGrid)
classmethod resetVisualBox(structuredGrid, view=None)

Resets the visual box of a structured grid.

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the structured grid object to reset the visual box to
  • view (ORSModel.ors.View) – a specific view in which the visual box is attached to. If set as None, the first parent will be used.
classmethod resetVisualBoxOfChannel(channel, view=None)
classmethod resetVisualBoxOfROI(roiOrLabelROI, view=None)
classmethod setClipBoxVisibility(structuredGrid, isVisible, view=None, logging=True)

Sets the visibility of the clip box associated to a structured grid in the layout of the view

Parameters:
  • structuredGrid (ORSModel.ors.StructuredGrid) – the associated structured grid
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
  • view (ORSModel.ors.View) – the view
classmethod setVisualBox(structuredGrid, aBox, view=None)

Sets the visual box of a structured grid.

Parameters:

structuredGridLogger

class OrsHelpers.structuredGridLogger.StructuredGridLogger

Helper related to the visibility of classes inheriting ORSModel.ors.StructuredGrid (namely, Channel, ROI and MultiROI).

interfacemethod resetVisualBoxOfChannelFromLayoutGenealogicalName(aName, channel)

Resets the visual box of a Channel

Parameters:
interfacemethod resetVisualBoxOfROIFromLayoutGenealogicalName(aName, aROIOrMultiROI)

Resets the visual box of a ROI or of a MultiROI

Parameters:
interfacemethod setBox(aStructuredGrid, aBox)

Sets box of StructuredGrid

Parameters:
classmethod setClipBoxVisibilityOfChannel(channel, isVisible, view=None)
interfacemethod setClipBoxVisibilityOfChannelFromLayoutGenealogicalName(aName, channel, isVisible)

Sets the visual box visibility of a Channel

Parameters:
  • aName (str) – a genealogical name
  • channel (ORSModel.ors.Channel) – a Channel
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
classmethod setClipBoxVisibilityOfROI(aROIOrMultiROI, isVisible, view=None)
interfacemethod setClipBoxVisibilityOfROIFromLayoutGenealogicalName(aName, aROIOrMultiROI, isVisible)

Sets the visual box visibility of a ROI or of a MultiROI

Parameters:
  • aName (str) – a genealogical name
  • aROIOrMultiROI (ORSModel.ors.ROI, ORSModel.ors.MultiROI) – a ROI or a MultiROI
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
classmethod setVisualBox(aROIOrMultiROIOrChannel, aBox, display=None)
interfacemethod setVisualBoxOfChannelFromLayoutGenealogicalName(aName, channel, aBox)

Sets the visual box of a Channel

Parameters:
interfacemethod setVisualBoxOfROIFromLayoutGenealogicalName(aName, aROIOrMultiROI, aBox)

Sets the visual box of a ROI or of a MultiROI

Parameters:

unstructuredGridHelper

class OrsHelpers.unstructuredGridHelper.UnstructuredGridHelper

Helper related to the manipulation of classes inheriting ORSModel.ors.UnstructuredGrid (namely, Mesh and Graph).

classmethod applyTransformToAllClipBoxParents(unstructuredGrid, aTransformationMatrix, iTIndex=0)
classmethod copy(anUnstructuredGrid)

Copies an UnstructuredGrid

Parameters:anUnstructuredGrid (ORSModel.ors.UnstructuredGrid) – the UnstructuredGrid to copy
Returns:newUnstructuredGrid (ORSModel.ors.UnstructuredGrid) – the copied UnstructuredGrid
classmethod copyAndPublish(anUnstructuredGrid)
classmethod createVisualFromModel(aModelUnstructuredGrid, layout=None, aScalarValueTypeTag='')

Creates the mesh object from the model structured object.

Parameters:
Returns:

visual (ORSModel.ors.Visual) – the visual object

classmethod fitToView(anUnstructuredGrid, view)
classmethod getClipBox(unstructuredGrid, viewOrTopFrame, forceCreation=False)
classmethod getClipBoxForCurrentView(structuredGrid, forceCreation=True, implementation=None)
classmethod getClipBoxes(unstructuredGrid)
classmethod getDisplayModelClass()
classmethod getIsEnabledIn3D(obj)
classmethod getIsVisible(anUnstructuredGrid, view)
classmethod getIsVisibleIn2D(anUnstructuredGrid, view)
Parameters:
Returns:

output (bool) – the 2D UnstructuredGrid visibility

classmethod getIsVisibleIn3D(anUnstructuredGrid, view)
Parameters:
Returns:

output (bool) – the 3D ROI visibility

classmethod getLUT(anUnstructuredGrid, aView=None, aScalarValueTypeTag='')
classmethod getLegend(aVisualOrModel, forceCreation=False, aScalarValueTypeTag='')
classmethod getLegendTitle(anUnstructuredGrid, aScalarValueTypeTag='')
classmethod getListOfDisplayRendering(anUnstructuredGrid)
classmethod getModel(obj)
classmethod getModelClass()
classmethod getOpacity(anUnstructuredGrid)
classmethod getUseDiscreteLegend(aVisualOrModel)
classmethod getVisual(obj, forceCreation=False)
classmethod getVisualModelClass()
classmethod getVisualReachableByDisplay(unstructuredGrid, display)
classmethod growVisualBoxForUnstructuredGridVisual(anUnstructureGrid, aBox)
classmethod isclose(a, b, rel_tol=1e-09, abs_tol=0.0)
classmethod refreshUnstructuredGridVisual(unstructuredGrid)
classmethod refreshVisual(unstructuredGrid)
classmethod resetVisualBox(unstructuredGrid, view=None)

Resets the visual box of an unstructured grid.

Parameters:
  • unstructuredGrid (ORSModel.ors.UnstructuredGrid) – the unstructured grid object to reset the visual box to
  • view (ORSModel.ors.View) – a specific display in which the visual box is attached to. If set as None, the first parent will be used.
classmethod resetVisualFrame(unstructuredGrid, display=None)
classmethod resetVisualFrameAndApplyRotation(unstructuredGrid, pivot, axis, angle, display=None)
classmethod resetVisualFrameAndApplyTranslation(unstructuredGrid, translation, display=None)
classmethod resetVisualFrameAndSetTransformation(unstructuredGrid, matrix, display=None)
classmethod resetVisualFrameWithBox(unstructuredGrid, box, display=None)
classmethod setClipBoxVisibility(unstructuredGrid, isVisible, view=None)

Sets the visibility of the clip box associated to an unstructured grid in the layout of the view

Parameters:
  • unstructuredGrid (ORSModel.ors.UnstructuredGrid) – the associated unstructuredGrid grid
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
  • view (ORSModel.ors.View) – the view
classmethod setIsVisibleForViewFromLayoutGenealogicalName(aName, anUnstructuredGrid, isVisible)

Set view mode for Unstructured Grid

Deprecated since version 4.0.

Parameters:
classmethod setIsVisibleIn2D(anUnstructuredGrid, view, value)
Parameters:
classmethod setIsVisibleIn2DFromGenealogicalName(name, anUnstructuredGrid, isVisible)

Sets the visibility of an Unstructured grid in all 2D views of the given scene layout

Parameters:
  • name (str) – a genealogical name of a scene layout
  • anUnstructuredGrid (ORSModel.ors.UnstructuredGrid) – an UnstructuredGrid
  • isVisible (bool) – True to set as visible, False otherwise
classmethod setIsVisibleIn3D(anUnstructuredGrid, view, value)
Parameters:
classmethod setLUT(aModel, aLUT, aView=None, aScalarValueTypeTag='')

Set LUT for a View, if view is None, the lut will be set for all view

classmethod setOpacity(anUnstructuredGrid, opacity: float = None, opacityInRange: float = None, opacityOutRange: float = None)
classmethod setVisualBox(unstructuredGrid, aBox, view=None)

Resets the visual box of an unstructured grid.

Parameters:
classmethod updateColorFromVertexScalarValue(anUnstructuredGrid: ORSModel.ors.UnstructuredGrid, forceToRefresh=False, aScalarValueTypeTag='', iTIndex=0)
classmethod updateLegend(anUnstructuredGrid, display=None, ITopFrame=None, aScalarValueTypeTag='')
classmethod updateMeshVisibilityOrder(guidList, topToBottom=True)
classmethod updateModelColor(anUnstructureGrid)

unstructuredGridLogger

class OrsHelpers.unstructuredGridLogger.UnstructuredGridLogger

Helper related to the visibility of classes inheriting ORSModel.ors.UnstructuredGrid (Mesh, Graph and vector field).

classmethod getClassHelper(anUnstructuredGrid)
interfacemethod resetVisualBoxOfMeshFromLayoutGenealogicalName(aName, mesh)

Resets the visual box of a Mesh

Deprecated since version 4.0.

Parameters:
interfacemethod resetVisualBoxOfUnstrucuredGridFromLayoutGenealogicalName(aName, anUnstructuredGrid, iTIndex=0)

Resets the visual box of a Mesh

Parameters:
  • aName (str) – a genealogical name
  • anUnstructuredGrid (ORSModel.ors.UnstructuredGrid) – an unstructured grid
  • iTIndex (int) – current time step
classmethod setClipBoxVisibilityOfMesh(mesh, isVisible, view=None)

Deprecated since version 4.0.

interfacemethod setClipBoxVisibilityOfMeshFromLayoutGenealogicalName(aName, mesh, isVisible)

Sets the visual box visibility of a Mesh

Deprecated since version 4.0.

Parameters:
  • aName (str) – a genealogical name
  • mesh (ORSModel.ors.Mesh) – a Mesh
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
classmethod setClipBoxVisibilityOfUnstructuredGrid(anUnstructuredGrid, isVisible, view=None)
interfacemethod setClipBoxVisibilityOfUnstructuredGridFromLayoutGenealogicalName(aName, anUnstructuredGrid, isVisible)

Sets the visual box visibility of an anUnstructuredGrid

Parameters:
  • aName (str) – a genealogical name
  • anUnstructuredGrid (ORSModel.ors.UnstructuredGrid) – an unstructured grid
  • isVisible (bool) – if True, the clip box will be set as visible; if False, the clip box will be hidden.
classmethod setVisualBoxOfMesh(mesh, aBox, display=None)

Deprecated since version 4.0.

interfacemethod setVisualBoxOfMeshFromLayoutGenealogicalName(aName, mesh, aBox)

Sets the visual box of a Mesh

Deprecated since version 4.0.

Parameters:
classmethod setVisualBoxOfUnstructuredGrid(anUnstucturedGrid, aBox, display=None, iTIndex=0)
interfacemethod setVisualBoxOfUnstructuredGridFromLayoutGenealogicalName(aName, anUnstructuredGrid, aBox)

Sets the visual box of an unstructured grid

Parameters:

viewhelper

class OrsHelpers.viewhelper.ViewHelper

Helper related to the class ORSModel.ors.View.

classmethod applyRotationInDegree(display, degree, logging=True)
classmethod applyRotationInRadian(display, radian, logging=True)
classmethod copyViewSettings(source: ORSModel.ors.View, destination: ORSModel.ors.View)
classmethod flipViewHorizontally(display, logging=True)
classmethod flipViewVertically(display, logging=True)
classmethod getCursor3DForView(display)
classmethod refreshAllViewsOfSameGroupAs(display, d2D=False, d3D=False)

viewLayoutHelper

class OrsHelpers.viewLayoutHelper.DisplayLayoutHelper

Helper related to the layouts (disposition of the views).

classmethod copyVisibilityStatesOfVisualInView(oldDisplay, newDisplay)
classmethod fitBoxInAllViewsOfLayout(layout, box, logging=True)
classmethod fitBoxInLayoutOfView(display, box)
classmethod fitVisualInAllViewsOfLayout(layout, visual)
classmethod fitVisualInLayoutOfView(display, visual)
classmethod get3DCursorForLayout(layout)
classmethod get3DCursorForView(display)
classmethod get3DCursorPositionForView(display)
classmethod getAll2DViewsInLayout(layout)
classmethod getAll2DViewsOfLayoutOfView(display)
classmethod getAll3DViewsInLayout(layout)
classmethod getAll3DViewsOfLayoutOfView(display)
classmethod getAllOther2DViewsInLayoutOfView(display)
classmethod getAllOther3DViewsInLayoutOfView(display)
classmethod getAllOtherViewsOfLayoutOfView(display)
classmethod getAllViewsOfLayoutOfView(display)
classmethod getExistsVisible2DViewInLayoutOfView(display)
classmethod getGridForLayout(layout)
classmethod getGridForView(display)
classmethod getOrsQtLayoutPluginInstanceForView(IDisplay)
classmethod getScaleBarForLayout(layout)
classmethod getScaleBarForView(display)
classmethod getTopFrameForLayout(layout)
classmethod getTopFrameForView(display)
classmethod move2DLayoutOfViewToIncludePoint(display, worldposition, center=False, logging=True)
classmethod move2DViewOfLayoutToIncludePoint(layout, worldposition, center=False, logging=True)
classmethod move3DLayoutOfViewToIncludePoint(display, worldposition, center=False, logging=True)
classmethod move3DViewOfLayoutToIncludePoint(layout, worldposition, center=False, logging=True)
classmethod refreshAll2DViewsOfLayout(layout)
classmethod refreshAll2DViewsOfLayoutOfView(display)
classmethod refreshAll3DViewsOfLayoutOfView(display)
classmethod refreshAllOtherViewsOfLayoutOfView(display)
classmethod refreshAllViewsOfLayoutOfView(display)
classmethod reset3DCursorOfLayout(layout)
static setTopFrameForAllViewsOfLayout(layout, topFrame)

viewLogger

class OrsHelpers.viewLogger.ViewLogger

Helper related to the class ORSModel.ors.View.

classmethod fitBoundedPlaneInView(view, rectangle)
interfacemethod fitBoundedPlaneInViewFromLayoutGenealogicalName(aName, rectangle)

Fit Rectangle in View

Parameters:
classmethod fitBoxInView(view, box)
interfacemethod fitBoxInViewFromLayoutGenealogicalName(aName, box)

Fit box in View

Parameters:
interfacemethod setCameraFromLayoutGenealogicalName(aName, camera)

Sets the camera of the view based on the fullname of the view layout

Parameters:
classmethod setCameraView(view, camera)
classmethod setProjectionMode2D(view, projectionMode)
interfacemethod setProjectionMode2DFromLayoutGenealogicalName(aName, projectionMode)

Set view mode

Parameters:
  • aName (str) – a genealogical name
  • projectionMode (IntEnum CxvVolumeProjection_Mode) – a viewMode
classmethod setViewMode(view, viewMode)
interfacemethod setViewModeFromLayoutGenealogicalName(aName, viewMode)

Set view mode

Parameters:
  • aName (str) – a genealogical name
  • viewMode (IntEnum CxvView_Mode) – a viewMode
classmethod setViewOrientedPlane(view, orientedPlane, thickness)
interfacemethod setViewOrientedPlaneFromLayoutGenealogicalName(aName, orientedPlane, thickness)

Sets the view oriented plane from genealogical name

Parameters:
  • aName (str) – a genealogical name
  • orientedPlane (ORSModel.ors.OrientedPlane) – the view futur oriented plane
  • thickness (float) – a thickness in meter
classmethod setViewOrientedPlaneWithBox(view, orientedPlane, box)
interfacemethod setViewOrientedPlaneWithBoxFromLayoutGenealogicalName(aName, orientedPlane, box)

Sets the view orientation from box

Parameters:
classmethod setViewOrthoZoomFactor(view, zoomFactor)
interfacemethod setViewOrthoZoomFactorFromLayoutGenealogicalName(aName, zoomFactor)

Sets the view ortho zoom factor

Parameters:
  • aName (str) – a genealogical name
  • zoomFactor (float) – a zoom factor
classmethod setViewPlanePosition(view, point, center)
interfacemethod setViewPlanePositionFromLayoutGenealogicalName(aName, point, center)

Sets the view plane position from genealogical name

Parameters:
  • aName (str) – a genealogical name
  • point (ORSModel.ors.Vector3) – a point
  • center (bool) – should the point be the center of the view
classmethod setViewSlabThickness(view, thickness)
interfacemethod setViewSlabThicknessFromLayoutGenealogicalName(aName, thickness)

Sets the view plane position from genealogical name

Parameters:
  • aName (str) – a genealogical name
  • thickness (float) – a thickness in meter
classmethod setViewSliceIndexOfBox(view, box, sliceIndex)
interfacemethod setViewSliceIndexOfBoxFromLayoutGenealogicalName(aName, box, sliceIndex)

Sets the view plane position at box index from genealogical name

Parameters:
  • aName (str) – a genealogical name
  • box (ORSModel.ors.Box) – a box
  • sliceIndex (float) – a slice index

visualChannelLogger

class OrsHelpers.visualChannelLogger.VisualChannelLogger

Helper related to the visual state of Channels.

visualColorBarLogger

class OrsHelpers.visualColorBarLogger.VisualColorBarLogger

Helper related to the visual state of ColorBars.

classmethod setCanBeVisibleForView(visualColorBar, view, value)
interfacemethod setCanBeVisibleForViewFromLayoutGenealogicalName(aName, parentNode, value)

Sets the visibility of a Visual color bar

Parameters:
classmethod setLookupTableForView(visualColorBar, view, lut)
interfacemethod setLookupTableForViewFromLayoutGenealogicalName(aName, parentNode, lutUUID)

Sets the lookup table of a visual color bar

Parameters:

visualLogger

class OrsHelpers.visualLogger.VisualLogger

Helper related to generic visuals.

volumehelper

class OrsHelpers.volumehelper.VolumeHelper

Helper related to the class ORSModel.ors.VisualChannel.

classmethod addWindowLevelingCallbacksOnVisualColorBar(legend=None)
interfacemethod applyDefaultLeveling(dataset)

Applies the default window leveling on a visual associated to a dataset

Parameters:dataset (ORSModel.ors.Channel) – a channel from which the leveling will be obtained
classmethod attachVolumesToTopFrame(IVol, ITopFrame)
classmethod createVolumeForChannel(aChannel0, aChannel1=None, aChannel2=None, aChannel3=None, layout=None)

Creates a volume from a set of channels

Parameters:
Returns:
classmethod detachVisualsFromTopFrame(topFrameGuid)
classmethod detachVolumesFromTopFrame(volGuid, topFrameGuid)
leveling3D_callbacks = {}
leveling_callbacks = {}
classmethod removeWindowLevelingCallbacksOnVisualColorBar(legend=None)
interfacemethod set2DWindowLevel2Range(dataset, rangeMinInPhysicalUnits, rangeMaxInPhysicalUnits)

Sets the range of the second leveling of a visual associated to a dataset

Parameters:
  • dataset (ORSModel.ors.Channel) – associated channel to the visual to set the range on
  • rangeMinInPhysicalUnits (float) – minimal value of the range
  • rangeMaxInPhysicalUnits (float) – maximal value of the range
interfacemethod setSecondLevelingStatus(dataset, isEnabled)

Enables or disabled the second leveling of a visual associated to a dataset.

Parameters:
  • dataset (ORSModel.ors.Channel) – associated channel to the visual
  • isEnabled (bool) – specify if the range should be enabled
static updateLegendRange(aLegend, leveling3D)
static updateVolumeVisibilityOrder(guidList, topToBottom=True)

watershedhelper

class OrsHelpers.watershedhelper.WatershedHelper

Helper for performing a watershed (segmentation algorithm).

classmethod watershedFromAChannelLabeled(edgeMap, tStepEdgeMap, labelChannelIn, labelChannelOut, neighboorCount=6, ROIMask=None, IProgress=None, progressBarId=79)
classmethod watershedFromALabeledMultiROI(edgeMap, tStepEdgeMap, LMRInput, LMROutput, neighboorCount=6, ROIMask=None, IProgress=None, progressBarId=79)
classmethod watershedFromAListOfROI(edgeMap, tStepEdgeMap, aListOfROI, tStepROI, neighboorCount=6, ROIMask=None, IProgress=None, progressBarId=79)