Slicer
4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
#include <Base/Logic/vtkSlicerApplicationLogic.h>
Public Types | |
enum | RequestEvents { RequestModifiedEvent = vtkMRMLApplicationLogic::RequestInvokeEvent + 1, RequestReadDataEvent, RequestWriteDataEvent, RequestProcessedEvent } |
List of events potentially fired by the application logic. More... | |
typedef vtkMRMLApplicationLogic | Superclass |
Public Types inherited from vtkMRMLApplicationLogic | |
enum | Events { RequestInvokeEvent = vtkCommand::UserEvent + 1, PauseRenderEvent = vtkCommand::UserEvent + 101, ResumeRenderEvent, EditNodeEvent } |
List of custom events fired by the class. More... | |
enum | Layers { LabelLayer = 0x1, ForegroundLayer = 0x2, BackgroundLayer = 0x4, AllLayers = LabelLayer | ForegroundLayer | BackgroundLayer } |
typedef vtkMRMLAbstractLogic | Superclass |
Public Types inherited from vtkMRMLAbstractLogic | |
typedef vtkObject | Superclass |
typedef void(vtkMRMLAbstractLogic::* | TaskFunctionPointer) (void *clientdata) |
Public Member Functions | |
void | CreateProcessingThread () |
Create a thread for processing. More... | |
virtual const char * | GetClassName () |
unsigned int | GetReadDataQueueSize () |
vtkPersonInformation * | GetUserInformation () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
void | ProcessModified () |
void | ProcessReadData () |
void | ProcessWriteData () |
Process a request to write data from a referenced node. More... | |
void | PropagateFiducialListSelection () |
vtkMTimeType | RequestAddNodeReference (const std::string &referencingNode, const std::string &referencedNode, const std::string &role) |
vtkMTimeType | RequestModified (vtkObject *) |
vtkMTimeType | RequestReadFile (const char *refNode, const char *filename, int displayData=false, int deleteFile=false) |
vtkMTimeType | RequestReadScene (const std::string &filename, std::vector< std::string > &targetIDs, std::vector< std::string > &sourceIDs, int displayData=false, int deleteFile=false) |
vtkMTimeType | RequestUpdateParentTransform (const std::string &updatedNode, const std::string &parentTransformNode) |
vtkMTimeType | RequestUpdateSubjectHierarchyLocation (const std::string &updatedNode, const std::string &siblingNode) |
vtkMTimeType | RequestWriteData (const char *refNode, const char *filename) |
int | ScheduleTask (vtkSlicerTask *) |
void | SetMRMLSceneDataIO (vtkMRMLScene *scene, vtkMRMLRemoteIOLogic *remoteIOLogic, vtkDataIOManagerLogic *dataIOManagerLogic) |
void | SetTracingOff () |
void | SetTracingOn () |
void | TerminateProcessingThread () |
Shutdown the processing thread. More... | |
Public Member Functions inherited from vtkMRMLApplicationLogic | |
virtual void | EditNode (vtkMRMLNode *node) |
Requests the application to show user interface for editing a node. More... | |
void | FitSliceToAll (bool onlyIfPropagateVolumeSelectionAllowed=false) |
vtkMRMLColorLogic * | GetColorLogic () const |
vtkMRMLInteractionNode * | GetInteractionNode () const |
Get default Interaction node. More... | |
vtkMRMLAbstractLogic * | GetModuleLogic (const char *moduleName) const |
vtkMRMLSelectionNode * | GetSelectionNode () const |
Get default Selection node. More... | |
vtkMRMLSliceLogic * | GetSliceLogic (vtkMRMLSliceNode *sliceNode) const |
vtkMRMLSliceLogic * | GetSliceLogicByLayoutName (const char *layoutName) const |
vtkMRMLSliceLogic * | GetSliceLogicByModelDisplayNode (vtkMRMLModelDisplayNode *displayNode) const |
Get slice logic from slice model display node. More... | |
vtkCollection * | GetSliceLogics () const |
const char * | GetTemporaryPath () |
Return the temporary path that was set by the application. More... | |
vtkMRMLViewLogic * | GetViewLogic (vtkMRMLViewNode *viewNode) const |
vtkMRMLViewLogic * | GetViewLogicByLayoutName (const char *layoutName) const |
vtkCollection * | GetViewLogics () const |
void | InvokeEventWithDelay (unsigned int delayInMs, vtkObject *caller, unsigned long eventID=vtkCommand::ModifiedEvent, void *callData=nullptr) |
Conveniently calls an InvokeEvent on an object with a delay. More... | |
bool | OpenSlicerDataBundle (const char *sdbFilePath, const char *temporaryDirectory) |
virtual void | PauseRender () |
void | PrintSelf (ostream &os, vtkIndent indent) override |
void | PropagateBackgroundVolumeSelection (int fit=1) |
void | PropagateForegroundVolumeSelection (int fit=1) |
void | PropagateLabelVolumeSelection (int fit=1) |
void | PropagatePlotChartSelection () |
Propagate selected PlotChart in the SelectionNode to Plot view nodes. More... | |
void | PropagateTableSelection () |
Propagate selected table in the SelectionNode to table view nodes. More... | |
void | PropagateVolumeSelection (int fit=1) |
void | PropagateVolumeSelection (int layer, int fit) |
virtual void | ResumeRender () |
void | SaveSceneScreenshot (vtkImageData *screenshot) |
bool | SaveSceneToSlicerDataBundleDirectory (const char *sdbDir, vtkImageData *screenShot=nullptr) |
void | SetColorLogic (vtkMRMLColorLogic *newColorLogic) |
void | SetModuleLogic (const char *moduleName, vtkMRMLAbstractLogic *moduleLogic) |
void | SetSliceLogics (vtkCollection *sliceLogics) |
All the slice logics in the application. More... | |
void | SetTemporaryPath (const char *path) |
Set the temporary path the logics can use. The path should be set by the application. More... | |
void | SetViewLogics (vtkCollection *viewLogics) |
All the view logics in the application. More... | |
std::string | UnpackSlicerDataBundle (const char *sdbFilePath, const char *temporaryDirectory) |
bool | Unzip (const char *zipFileName, const char *destinationDirectory) |
bool | Zip (const char *zipFileName, const char *directoryToZip) |
Public Member Functions inherited from vtkMRMLAbstractLogic | |
virtual vtkMRMLApplicationLogic * | GetMRMLApplicationLogic () const |
Get access to overall application state. More... | |
vtkMRMLScene * | GetMRMLScene () const |
Return a reference to the current MRML scene. More... | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
virtual void | SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic) |
void | SetMRMLScene (vtkMRMLScene *newScene) |
Set and observe the MRMLScene. More... | |
Static Public Member Functions | |
static std::string | GetModuleShareDirectory (const std::string &moduleName, const std::string &filePath) |
Get share directory associated with moduleName located in filePath. More... | |
static std::string | GetModuleSlicerXYLibDirectory (const std::string &filePath) |
Get Slicer-X.Y lib directory associated with module located in filePath. More... | |
static std::string | GetModuleSlicerXYShareDirectory (const std::string &filePath) |
Get Slicer-X.Y share directory associated with module located in filePath. More... | |
static bool | IsEmbeddedModule (const std::string &filePath, const std::string &applicationHomeDir, const std::string &slicerRevision) |
static bool | IsPluginBuiltIn (const std::string &filePath, const std::string &applicationHomeDir) |
Return true if the plugin identified with its filePath is a built-in Slicer module. More... | |
static bool | IsPluginInstalled (const std::string &filePath, const std::string &applicationHomeDir) |
static int | IsTypeOf (const char *type) |
static vtkSlicerApplicationLogic * | New () |
The Usual vtk class functions. More... | |
static void | RequestModifiedCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
static vtkSlicerApplicationLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLApplicationLogic | |
static std::string | CreateUniqueFileName (const std::string &filename, const std::string &knownExtension="") |
static int | IsTypeOf (const char *type) |
static int | LoadDefaultParameterSets (vtkMRMLScene *scene, const std::vector< std::string > &directories) |
static vtkMRMLApplicationLogic * | New () |
static std::string | PercentEncode (std::string s) |
static vtkMRMLApplicationLogic * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkMRMLAbstractLogic | |
static int | IsTypeOf (const char *type) |
static vtkMRMLAbstractLogic * | New () |
static vtkMRMLAbstractLogic * | SafeDownCast (vtkObject *o) |
Static Protected Member Functions | |
static itk::ITK_THREAD_RETURN_TYPE | NetworkingThreaderCallback (void *) |
Callback used by a MultiThreader to start a networking thread. More... | |
static itk::ITK_THREAD_RETURN_TYPE | ProcessingThreaderCallback (void *) |
Callback used by a MultiThreader to start a processing thread. More... | |
Static Protected Member Functions inherited from vtkMRMLAbstractLogic | |
static void | MRMLLogicsCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLLogicCallback is a static function to relay modified events from the logics. More... | |
static void | MRMLNodesCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
MRMLNodesCallback is a static function to relay modified events from the nodes. More... | |
static void | MRMLSceneCallback (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
Definition at line 49 of file vtkSlicerApplicationLogic.h.
Definition at line 56 of file vtkSlicerApplicationLogic.h.
List of events potentially fired by the application logic.
Enumerator | |
---|---|
RequestModifiedEvent | |
RequestReadDataEvent | |
RequestWriteDataEvent | |
RequestProcessedEvent | Event fired when a readData, writeData or readScene request has been processed. The uid of the request is passed as callData.
|
Definition at line 81 of file vtkSlicerApplicationLogic.h.
|
protected |
|
overrideprotected |
void vtkSlicerApplicationLogic::CreateProcessingThread | ( | ) |
Create a thread for processing.
|
virtual |
Reimplemented from vtkMRMLApplicationLogic.
|
static |
Get share directory associated with moduleName located in filePath.
|
static |
Get Slicer-X.Y lib directory associated with module located in filePath.
|
static |
Get Slicer-X.Y share directory associated with module located in filePath.
unsigned int vtkSlicerApplicationLogic::GetReadDataQueueSize | ( | ) |
Return the number of items that need to be read from the queue (this allows code that invokes command line modules to know when multiple items are being returned and have all been returned).
vtkPersonInformation* vtkSlicerApplicationLogic::GetUserInformation | ( | ) |
Get information about the current user (name, login, email, organization, etc.) Values are allowed to be modified.
|
virtual |
Reimplemented from vtkMRMLApplicationLogic.
|
static |
Return True if filePath is a descendant of applicationHomeDir.
|
static |
Return true if the plugin identified with its filePath is a built-in Slicer module.
|
static |
Return true if the plugin identified with its filePath is loaded from an install tree.
|
static |
|
staticprotected |
Callback used by a MultiThreader to start a networking thread.
|
static |
The Usual vtk class functions.
|
override |
|
staticprotected |
Callback used by a MultiThreader to start a processing thread.
void vtkSlicerApplicationLogic::ProcessModified | ( | ) |
Process a request on the Modified queue. This method is called in the main thread of the application because calls to Modified() can cause an update to the GUI. (Method needs to be public to fit in the event callback chain.)
|
protected |
Networking Task processing loop that is run in a networking thread.
|
protected |
Task processing loop that is run in the processing thread.
void vtkSlicerApplicationLogic::ProcessReadData | ( | ) |
Process a request to read data and set it on a referenced node. This method is called in the main thread of the application because calls to load data will cause a Modified() on a node which can force a render.
|
protected |
Process a request to read data into a scene. This method is called by ProcessReadData() in the application main thread because calls to load data will cause a Modified() on a node which can force a render.
void vtkSlicerApplicationLogic::ProcessWriteData | ( | ) |
Process a request to write data from a referenced node.
|
protected |
void vtkSlicerApplicationLogic::PropagateFiducialListSelection | ( | ) |
Perform the default behaviour related to selecting a fiducial list (display it in the Fiducials GUI)
vtkMTimeType vtkSlicerApplicationLogic::RequestAddNodeReference | ( | const std::string & | referencingNode, |
const std::string & | referencedNode, | ||
const std::string & | role | ||
) |
Request adding a node reference The request will executed on the main thread. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
vtkMTimeType vtkSlicerApplicationLogic::RequestModified | ( | vtkObject * | ) |
Request a Modified call on an object. This method allows a processing thread to request a Modified call on an object to be performed in the main thread. This allows the call to Modified to trigger GUI changes. RequestModified() is called from the processing thread to modify an object in the main thread. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered.
|
static |
Callback function to request invoking a modified event on the main thread. This function may be called from any thread.
vtkMTimeType vtkSlicerApplicationLogic::RequestReadFile | ( | const char * | refNode, |
const char * | filename, | ||
int | displayData = false , |
||
int | deleteFile = false |
||
) |
Request that data be read from a file and set it on the referenced node. The request will be sent to the main thread which will be responsible for reading the data, setting it on the referenced node, and updating the display. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
vtkMTimeType vtkSlicerApplicationLogic::RequestReadScene | ( | const std::string & | filename, |
std::vector< std::string > & | targetIDs, | ||
std::vector< std::string > & | sourceIDs, | ||
int | displayData = false , |
||
int | deleteFile = false |
||
) |
Request that a scene be read from a file. Mappings of node IDs in the file (sourceIDs) to node IDs in the main scene (targetIDs) can be specified. Only nodes listed in sourceIDs are loaded back into the main scene. Hierarchical nodes will be handled specially, in that only the top node needs to be listed in the sourceIds. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
vtkMTimeType vtkSlicerApplicationLogic::RequestUpdateParentTransform | ( | const std::string & | updatedNode, |
const std::string & | parentTransformNode | ||
) |
Request setting of parent transform. The request will executed on the main thread. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
vtkMTimeType vtkSlicerApplicationLogic::RequestUpdateSubjectHierarchyLocation | ( | const std::string & | updatedNode, |
const std::string & | siblingNode | ||
) |
Request setting of subject hierarchy location (will have the same parent and same level as sibling node). The request will executed on the main thread. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
vtkMTimeType vtkSlicerApplicationLogic::RequestWriteData | ( | const char * | refNode, |
const char * | filename | ||
) |
Request that data be written from a file to a remote destination. Return the request UID (monotonically increasing) of the request or 0 if the request failed to be registered. When the request is processed, RequestProcessedEvent is invoked with the request UID as calldata.
|
static |
int vtkSlicerApplicationLogic::ScheduleTask | ( | vtkSlicerTask * | ) |
Schedule a task to run in the processing thread. Returns true if task was successfully scheduled. ScheduleTask() is called from the main thread to run something in the processing thread.
|
protectedvirtual |
Set background thread (background processing, networking) priority, which can be set via an environment variable SLICER_BACKGROUND_THREAD_PRIORITY. Value of the variable must be an integer specifying background threads priority (default: 20).
void vtkSlicerApplicationLogic::SetMRMLSceneDataIO | ( | vtkMRMLScene * | scene, |
vtkMRMLRemoteIOLogic * | remoteIOLogic, | ||
vtkDataIOManagerLogic * | dataIOManagerLogic | ||
) |
Update the data IO, local and remote, with the new scene For stand alone applications, follow the set up steps in qSlicerCoreApplicationPrivate::initDataIO() to set up the remote IO logic and data manager logic and then call this method to hook them into the scene.
|
inline |
Definition at line 192 of file vtkSlicerApplicationLogic.h.
|
inline |
These routings act as place holders so that test scripts can turn on and off tracing. These are just hooks for use with external tracing tool (such as AQTime)
Definition at line 191 of file vtkSlicerApplicationLogic.h.
void vtkSlicerApplicationLogic::TerminateProcessingThread | ( | ) |
Shutdown the processing thread.