Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
vtkSlicerCLIModuleLogic Class Reference

Logic for running CLI. More...

#include <Base/QTCLI/vtkSlicerCLIModuleLogic.h>

Inheritance diagram for vtkSlicerCLIModuleLogic:
Inheritance graph
[legend]
Collaboration diagram for vtkSlicerCLIModuleLogic:
Collaboration graph
[legend]

List of all members.

Public Types

typedef vtkSlicerModuleLogic Superclass

Public Member Functions

void Apply (vtkMRMLCommandLineModuleNode *node, bool updateDisplay=true)
void ApplyAndWait (vtkMRMLCommandLineModuleNode *node, bool updateDisplay=true)
vtkMRMLCommandLineModuleNodeCreateNode ()
vtkMRMLCommandLineModuleNodeCreateNodeInScene ()
virtual void DeleteTemporaryFilesOff ()
virtual void DeleteTemporaryFilesOn ()
 For debugging, control deletion of temp files.
virtual const char * GetClassName ()
const ModuleDescription & GetDefaultModuleDescription () const
int GetDeleteTemporaryFiles () const
int GetRedirectModuleStreams () const
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
virtual void ProcessMrmlEvents (vtkObject *vtkNotUsed(caller), unsigned long vtkNotUsed(event), void *vtkNotUsed(callData))
virtual void RedirectModuleStreamsOff ()
virtual void RedirectModuleStreamsOn ()
 For debugging, control redirection of cout and cerr.
void SetDefaultModuleDescription (const ModuleDescription &moduleDescription)
void SetDeleteTemporaryFiles (int value)
void SetRedirectModuleStreams (int value)
void SetTemporaryDirectory (const char *tempdir)
 Set/Get the directory to use for temporary files.

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkSlicerCLIModuleLogicNew ()
 The Usual vtk class functions.
static vtkSlicerCLIModuleLogicSafeDownCast (vtkObject *o)

Protected Member Functions

void ApplyTask (void *clientdata)
void AutoRun (vtkMRMLCommandLineModuleNode *cliNode)
 Call apply because the node requests it.
std::string ConstructTemporaryFileName (const std::string &tag, const std::string &type, const std::string &name, const std::vector< std::string > &extensions, CommandLineModuleType commandType)
std::string ConstructTemporarySceneFileName (vtkMRMLScene *scene)
std::string FindHiddenNodeID (const ModuleDescription &d, const ModuleParameter &p)
bool IsCommandLineModuleNodeUpdatingDisplay (vtkMRMLCommandLineModuleNode *commandLineModuleNode) const
virtual void OnMRMLSceneNodeAdded (vtkMRMLNode *node)
 Reimplemented for AutoRun mode.
void ProcessMRMLLogicsEvents (vtkObject *, long unsigned int, void *)
 Reimplemented to observe vtkSlicerApplicationLogic.
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData)
 Reimplemented to observe CLI node.
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene)
 Reimplemented to observe NodeAddedEvent.

Static Protected Member Functions

static void ProgressCallback (void *)

Detailed Description

Logic for running CLI.

vtkSlicerCLIModuleLogic logic allows to run a either synchronously or asynchronously CLI using parameters of a vtkMRMLCommandLineModuleNode. While a CLI module logic can run any CLI node, the logic can uniquely be assigned a specific CLI by setting a DefaultModuleDescription.

Definition at line 40 of file vtkSlicerCLIModuleLogic.h.


Member Typedef Documentation

Definition at line 45 of file vtkSlicerCLIModuleLogic.h.


Member Function Documentation

void vtkSlicerCLIModuleLogic::Apply ( vtkMRMLCommandLineModuleNode node,
bool  updateDisplay = true 
)

Schedules the command line module to run. The CLI is scheduled to be run in a separate thread. This methods is non blocking and returns immediately. If updateDisplay is 'true' the selection node will be updated with the the created nodes, which would automatically select the created nodes in the node selectors.

void vtkSlicerCLIModuleLogic::ApplyAndWait ( vtkMRMLCommandLineModuleNode node,
bool  updateDisplay = true 
)

Don't start the CLI in a separate thread, but run it in the main thread. This methods is blocking until the CLI finishes to execute, the UI being frozen until that time. If updateDisplay is 'true' the selection node will be updated with the the created nodes, which would automatically select the created nodes in the node selectors.

void vtkSlicerCLIModuleLogic::ApplyTask ( void *  clientdata) [protected]
void vtkSlicerCLIModuleLogic::AutoRun ( vtkMRMLCommandLineModuleNode cliNode) [protected]

Call apply because the node requests it.

std::string vtkSlicerCLIModuleLogic::ConstructTemporaryFileName ( const std::string &  tag,
const std::string &  type,
const std::string &  name,
const std::vector< std::string > &  extensions,
CommandLineModuleType  commandType 
) [protected]
std::string vtkSlicerCLIModuleLogic::ConstructTemporarySceneFileName ( vtkMRMLScene scene) [protected]
vtkMRMLCommandLineModuleNode* vtkSlicerCLIModuleLogic::CreateNode ( )

Instantiate a default command line module node. If a default module description has been given, the node is initialized with the description. Warning: The caller is responsible for deleting it.

See also:
CreateNodeInScene(), SetDefaultModuleDescription()
vtkMRMLCommandLineModuleNode* vtkSlicerCLIModuleLogic::CreateNodeInScene ( )

Instantiate a default command line module node and add it into the scene. The caller is responsible for remove the node from the scene.

See also:
CreateNode(), SetDefaultModuleDescription()
virtual void vtkSlicerCLIModuleLogic::DeleteTemporaryFilesOff ( ) [virtual]
virtual void vtkSlicerCLIModuleLogic::DeleteTemporaryFilesOn ( ) [virtual]

For debugging, control deletion of temp files.

std::string vtkSlicerCLIModuleLogic::FindHiddenNodeID ( const ModuleDescription &  d,
const ModuleParameter &  p 
) [protected]
virtual const char* vtkSlicerCLIModuleLogic::GetClassName ( ) [virtual]
const ModuleDescription& vtkSlicerCLIModuleLogic::GetDefaultModuleDescription ( ) const
int vtkSlicerCLIModuleLogic::GetDeleteTemporaryFiles ( ) const
int vtkSlicerCLIModuleLogic::GetRedirectModuleStreams ( ) const
virtual int vtkSlicerCLIModuleLogic::IsA ( const char *  type) [virtual]
bool vtkSlicerCLIModuleLogic::IsCommandLineModuleNodeUpdatingDisplay ( vtkMRMLCommandLineModuleNode commandLineModuleNode) const [protected]

Return true if the commandlinemodule node can update the selection node with the outputs of the CLI

static int vtkSlicerCLIModuleLogic::IsTypeOf ( const char *  type) [static]
static vtkSlicerCLIModuleLogic* vtkSlicerCLIModuleLogic::New ( ) [static]

The Usual vtk class functions.

Reimplemented from vtkSlicerModuleLogic.

virtual void vtkSlicerCLIModuleLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode node) [protected, virtual]

Reimplemented for AutoRun mode.

Reimplemented from vtkMRMLAbstractLogic.

void vtkSlicerCLIModuleLogic::PrintSelf ( ostream &  os,
vtkIndent  indent 
)

Reimplemented from vtkSlicerModuleLogic.

virtual void vtkSlicerCLIModuleLogic::ProcessMrmlEvents ( vtkObject *  vtkNotUsedcaller,
unsigned long   vtkNotUsedevent,
void *  vtkNotUsedcallData 
) [inline, virtual]

Definition at line 67 of file vtkSlicerCLIModuleLogic.h.

void vtkSlicerCLIModuleLogic::ProcessMRMLLogicsEvents ( vtkObject *  ,
long unsigned  int,
void *   
) [protected]

Reimplemented to observe vtkSlicerApplicationLogic.

virtual void vtkSlicerCLIModuleLogic::ProcessMRMLNodesEvents ( vtkObject *  caller,
unsigned long  event,
void *  callData 
) [protected, virtual]

Reimplemented to observe CLI node.

Reimplemented from vtkMRMLAbstractLogic.

static void vtkSlicerCLIModuleLogic::ProgressCallback ( void *  ) [static, protected]
virtual void vtkSlicerCLIModuleLogic::RedirectModuleStreamsOff ( ) [virtual]
virtual void vtkSlicerCLIModuleLogic::RedirectModuleStreamsOn ( ) [virtual]

For debugging, control redirection of cout and cerr.

static vtkSlicerCLIModuleLogic* vtkSlicerCLIModuleLogic::SafeDownCast ( vtkObject *  o) [static]
void vtkSlicerCLIModuleLogic::SetDefaultModuleDescription ( const ModuleDescription &  moduleDescription)

The default module description is used when creating new nodes.

See also:
CreateNode()
void vtkSlicerCLIModuleLogic::SetDeleteTemporaryFiles ( int  value)
virtual void vtkSlicerCLIModuleLogic::SetMRMLSceneInternal ( vtkMRMLScene newScene) [protected, virtual]

Reimplemented to observe NodeAddedEvent.

Reimplemented from vtkMRMLAbstractLogic.

void vtkSlicerCLIModuleLogic::SetRedirectModuleStreams ( int  value)
void vtkSlicerCLIModuleLogic::SetTemporaryDirectory ( const char *  tempdir)

Set/Get the directory to use for temporary files.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines