List¶
Inheritance diagram¶
Classes¶
List¶
-
class
ORSModel.ors.List¶ Bases:
ORSModel.ors.ORSBaseClassbrief_description: A list of author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005 see: Managed, Node A list of Managed instances. Several methods in the SDK return lists of objects. Some typecasts are necessary to convert Object instances to their correct type because all services of List take or return only Managed instances.
-
add(self, pObject: ORSModel.ors.Managed) → None¶ Adds an object to the list.
Parameters: pObject (ORSModel.ors.Managed) – an object (an Object)
-
appendAllObjects(self, pList: ORSModel.ors.List) → None¶ Appends a list to the list.
Note
All objects are taken from the appended list, whether or not they are already in the receiver list.
Parameters: pList (ORSModel.ors.List) – a list (a List)
-
appendNonPresentObjects(self, pList: ORSModel.ors.List) → None¶ Appends a list to the list, taking only the objects not present in the receiver.
Note
Only the objects not already in the receiver are taken from the appended list.
Parameters: pList (ORSModel.ors.List) – a list (a List)
-
extend(iterable)¶
-
getAllElementsOfClass(self, sClassname: str) → List¶ Gets all the elements that belong to a given class.
Parameters: sClassname (str) – the class name of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list (a List)
-
getClassNameStatic() → str¶ Returns: output (str) –
-
getCount(self) → int¶ Returns the count of objects in the list.
Returns: output (int) – object count (an uint32_t)
-
getIncludes(self, pObject: ORSModel.ors.Managed) → bool¶ Verifies if an object is present in the list.
Parameters: pObject (ORSModel.ors.Managed) – an object (an Object) Returns: output (bool) – true if object is in the list, false otherwise
-
getIndexOf(self, pObject: ORSModel.ors.Managed) → int¶ Returns the index of an object in the list or -1 if not found.
Parameters: pObject (ORSModel.ors.Managed) – Returns: output (int) –
-
getIntersectionWith(self, pList: ORSModel.ors.List) → List¶ Returns the intersection of the list with another list.
Note
Objects duplicated in both lists only appear once in the intersected list.
Parameters: pList (ORSModel.ors.List) – a list (a List) Returns: output (ORSModel.ors.List) – a new list (a List)
-
getObjectAt(self, pos: int) → Managed¶ Gets an object from the list at the specified index.
Note
Index starts at zero (zero-based).
Note
When the type of the object is known, you can pre-type it as it will automatically typecast to the correct type, for example: Channel IChan = someList->getObjectAt(0). If the object at index 0 is not a channel, IChan will be none.
Parameters: pos (int) – an index (an uint32_t) Returns: output (ORSModel.ors.Managed) – an object (a Managed)
-
getPythonRepresentation(self) → str¶ Returns the python representation of the list.
Returns: output (str) – str
-
getSubtractionFrom(self, pList: ORSModel.ors.List) → List¶ Returns the subtraction of another list from the list.
Note
The subtraction results in a list of objects only in the receiver (union of both lists is removed from the list, or A - (A U B)).
Parameters: pList (ORSModel.ors.List) – a list (a List) Returns: output (ORSModel.ors.List) – a new list (a List)
-
getUnionWith(self, pList: ORSModel.ors.List) → List¶ Returns the union of the list with another list.
Note
Objects duplicated in both lists only appear once in the unionized list.
Parameters: pList (ORSModel.ors.List) – a list (a List) Returns: output (ORSModel.ors.List) – a new list (a List)
-
index(item)¶
-
isNone(self) → bool¶ Checks if the object is none.
Returns: output (bool) –
-
isNotNone(self) → bool¶ Checks if the object is not none.
Returns: output (bool) –
-
loadEmptyObjectsFromFile(self, sFilename: str) → None¶ Create empty objects from all the objects found within the file and adds them to the list.
Note
This is meant to quickly analyze an object or session file to know what types of objects are within. An empty object of the correct class will be created for every object defined in the file.
Parameters: sFilename (str) – an input filename (a string)
-
loadFromFile(self, sFilename: str, preserveIdentity: bool, progress: ORSModel.ors.Progress) → None¶ Loads all the objects found within the file and adds them to the list.
Note
This illustrates the meaning of the “preserve identity” argument, if you load a file that has the same object twice in a row, if you preserve identity you’ll obtain 1 object, if you don’t preserve identity you’ll obtain 2 objects (both having the same internal state).
Parameters: - sFilename (str) – an input filename (a string)
- preserveIdentity (bool) – true to preserve identity, false otherwise (see note)
- progress (ORSModel.ors.Progress) – a progress object
-
loadFromFileFiltered(self, sFilename: str, preserveIdentity: bool, classNames: ORSModel.ors.typing.List[str], progress: ORSModel.ors.Progress) → None¶ Loads all the objects found within the file and adds them to the list, keeping only specified classes.
Note
This illustrates the meaning of the “preserve identity” argument, if you load a file that has the same object twice in a row, if you preserve identity you’ll obtain 1 object, if you don’t preserve identity you’ll obtain 2 objects (both having the same internal state).
Note
The filter list should be a list of class names to filter on, for example, to load only ROI and MultiROI objects, one would specify ROI.getClassNameStatic() and MultiROI.getClassNameStatic().
Parameters: - sFilename (str) – an input filename (a string)
- preserveIdentity (bool) – true to preserve identity, false otherwise (see note)
- classNames (typing.List[str]) – list of class names (see note)
- progress (ORSModel.ors.Progress) – a progress object
-
loadSpecificObjectsFromFile(self, sFilename: str, preserveIdentity: bool, guids: ORSModel.ors.typing.List[str], progress: ORSModel.ors.Progress) → None¶ Loads a specific set of objects found within the file and adds them to the list, based on GUIDs.
Note
This illustrates the meaning of the “preserve identity” argument, if you load a file that has the same object twice in a row, if you preserve identity you’ll obtain 1 object, if you don’t preserve identity you’ll obtain 2 objects (both having the same internal state).
Parameters: - sFilename (str) – an input filename (a string)
- preserveIdentity (bool) – true to preserve identity, false otherwise (see note)
- guids (typing.List[str]) – list of GUIDs to load
- progress (ORSModel.ors.Progress) – a progress object
-
remove(self, pObject: ORSModel.ors.Managed) → bool¶ Removes an object from the list.
Parameters: pObject (ORSModel.ors.Managed) – an object (an Object) Returns: output (bool) – true if object was removed, false otherwise (it wasn’t in the list)
-
removeDuplicates(self) → None¶
-
saveToFile(self, sFilename: str) → int¶ Saves all the objects in the list to a file.
Parameters: sFilename (str) – an output filename (a string) Returns: output (int) – a result (an int, 0 for no error, otherwise an error code)
-
ORSBaseClass¶
-
class
ORSModel.ors.ORSBaseClass brief_description: An abstract class from which all objects issued from the author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
getPythonTraceBack() → typing.List[str] Set the python traceback for a call from python.
Returns: output (typing.List[str]) –
-
isManaged(self) → bool Returns: output (bool) –
-
isNone(self) → bool Returns: output (bool) –
-
setPythonTraceBack(tb: ORSModel.ors.typing.List[str]) → None Set the python traceback for a call from python.
Parameters: tb (typing.List[str]) –
-