5.2.1. Module lgxPy¶
This module defines how to interact with LithoGraphX itself: various classes, other processes, …
5.2.1.1. Accessing Processes¶
The module defines three objects of class ProcessMaker
:
-
lgxPy.
Stack
¶ Object of type
ProcessMaker
for the stack processes
-
lgxPy.
Mesh
¶ Object of type
ProcessMaker
for the mesh processes
-
lgxPy.
Global
¶ Object of type
ProcessMaker
for the global processes
-
class
lgxPy.
ProcessMaker
¶ This class represent a list of processes of a given type.
-
__getattr__
(name)¶ Retrieve a process. If it doesn’t exist, this throws a
NoSuchProcess
exception.Parameters: name – Name of the process. Returns: An object of type ProcessRunner
.
-
__str__
()¶ Returns: the type of process this object will make.
-
__dir__
()¶ Returns: The list of all processes of this type.
-
-
class
lgxPy.
ProcessRunner
¶ This class represent a process.
-
__call__
(...)¶ Call the process with the given arguments.
Returns: Always true.
Raises: - UserCancelException – Thrown if the user pressed the
Cancel
button on a progress bar. - ProcessError – If the process (or a sub-process) returns false, this exception is raised instead.
- StdException – If the process raises a standard exception, this will be translated into this exception.
- UserCancelException – Thrown if the user pressed the
-
lastParms
¶ List of parameters last used for this process, or the default parameters if the process has never been used.
-
defaultParms
¶ List of default parameters, as defined by the implementation of the process.
-
nbParms
¶ Number of parameters for this process.
-
folder
¶ Folder this process is stored in.
-
__str__
()¶ Returns: The name of this process as Type.Name
.
-
5.2.1.2. Exceptions¶
-
exception
lgxPy.
UserCancelException
¶ Exception launched when the user press the
Cancel
button
-
exception
lgxPy.
ProcessError
¶ If a process fails (i.e. returns false), this is translated into this exception.
-
exception
lgxPy.
BadProcessType
¶ If the user is trying to access a process of the wrong type.
-
exception
lgxPy.
NoSuchProcess
¶ If trying to access a process that doesn’t exist.
-
exception
lgxPy.
StdException
¶ If an exception deriving
std::exception
is caught, it is translated into this exception (except for the ones defined above).
5.2.1.3. Utilities¶
-
class
lgxPy.
Point3u
¶ A 3D point with unsigned integers.
-
x
¶ Get/set the first dimension.
-
y
¶ Get/set the second dimension.
-
z
¶ Get/set the third dimension.
-
-
class
lgxPy.
Point3f
¶ A 3D point with floating point values.
-
x
¶ Get/set the first dimension.
-
y
¶ Get/set the second dimension.
-
z
¶ Get/set the third dimension.
-
-
class
lgxPy.
ImageInfo
¶ Class used to parse an image and get information such as number of slices, channels, timepoints, …
-
filename
¶ Name of the file containing the image.
-
origin
¶ Position of the origin of the stack (e.g. the front, lower, left corner), given as a
Point3f
.
-
nb_channels
¶ Number of channels in the file.
-
nb_timepoints
¶ Number of time points in the image.
-
labels
¶ Whether the image is a labeled image or not.
Note: This is only valid for files saved by LithoGraphX, otherwise this is always false.
-