Slicer  4.10
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | 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]

Public Types

typedef vtkSlicerModuleLogic Superclass
 
- Public Types inherited from vtkSlicerModuleLogic
typedef vtkMRMLAbstractLogic Superclass
 
- Public Types inherited from vtkMRMLAbstractLogic
typedef vtkObject Superclass
 
typedef void(vtkMRMLAbstractLogic::* TaskFunctionPointer) (void *clientdata)
 

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. More...
 
int GetAllowInMemoryTransfer () const
 
virtual const char * GetClassName ()
 
const ModuleDescription & GetDefaultModuleDescription () const
 
int GetDeleteTemporaryFiles () const
 
int GetRedirectModuleStreams () const
 
virtual int IsA (const char *type)
 
void KillProcesses ()
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
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. More...
 
void SetAllowInMemoryTransfer (int value)
 
void SetDefaultModuleDescription (const ModuleDescription &moduleDescription)
 
void SetDeleteTemporaryFiles (int value)
 
virtual void SetMRMLApplicationLogic (vtkMRMLApplicationLogic *logic) VTK_OVERRIDE
 Set the application logic. More...
 
void SetRedirectModuleStreams (int value)
 
- Public Member Functions inherited from vtkSlicerModuleLogic
virtual vtkSlicerApplicationLogicGetApplicationLogic ()
 Get access to overall application state. More...
 
std::string GetModuleShareDirectory () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
void SetModuleShareDirectory (const std::string &shareDirectory)
 
- Public Member Functions inherited from vtkMRMLAbstractLogic
virtual vtkMRMLApplicationLogicGetMRMLApplicationLogic () const
 Get access to overall application state. More...
 
vtkMRMLSceneGetMRMLScene () const
 Return a reference to the current MRML scene. More...
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
void SetMRMLScene (vtkMRMLScene *newScene)
 Set and observe the MRMLScene. More...
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSlicerCLIModuleLogicNew ()
 
static vtkSlicerCLIModuleLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSlicerModuleLogic
static int IsTypeOf (const char *type)
 
static vtkSlicerModuleLogicNew ()
 The Usual vtk class functions. More...
 
static vtkSlicerModuleLogicSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractLogic
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractLogicNew ()
 
static vtkMRMLAbstractLogicSafeDownCast (vtkObject *o)
 

Protected Types

enum  Events { RequestHierarchyEditEvent = vtkCommand::UserEvent + 1 }
 List of custom events fired by the class. More...
 

Protected Member Functions

void AddCompleteModelHierarchyToMiniScene (vtkMRMLScene *, vtkMRMLModelHierarchyNode *, MRMLIDMap *sceneToMiniSceneMap, std::set< std::string > &filesToDelete)
 
void ApplyTask (void *clientdata)
 
void AutoRun (vtkMRMLCommandLineModuleNode *cliNode)
 Call apply because the node requests it. More...
 
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) VTK_OVERRIDE
 Reimplemented for AutoRun mode. More...
 
void ProcessMRMLLogicsEvents (vtkObject *, long unsigned int, void *) VTK_OVERRIDE
 Reimplemented to observe vtkSlicerApplicationLogic. More...
 
virtual void ProcessMRMLNodesEvents (vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE
 Reimplemented to observe CLI node. More...
 
virtual void SetMRMLSceneInternal (vtkMRMLScene *newScene) VTK_OVERRIDE
 Reimplemented to observe NodeAddedEvent. More...
 
- Protected Member Functions inherited from vtkSlicerModuleLogic
 vtkSlicerModuleLogic ()
 
virtual ~vtkSlicerModuleLogic ()
 
- Protected Member Functions inherited from vtkMRMLAbstractLogic
int EndModify (bool wasModifying)
 
virtual bool EnterMRMLLogicsCallback () const
 
virtual bool EnterMRMLNodesCallback () const
 
virtual bool EnterMRMLSceneCallback () const
 
bool GetDisableModifiedEvent () const
 
int GetInMRMLLogicsCallbackFlag () const
 
int GetInMRMLNodesCallbackFlag () const
 
int GetInMRMLSceneCallbackFlag () const
 
vtkCallbackCommand * GetMRMLLogicsCallbackCommand ()
 
vtkObserverManagerGetMRMLLogicsObserverManager () const
 
vtkCallbackCommand * GetMRMLNodesCallbackCommand ()
 
vtkObserverManagerGetMRMLNodesObserverManager () const
 
vtkCallbackCommand * GetMRMLSceneCallbackCommand ()
 
vtkObserverManagerGetMRMLSceneObserverManager () const
 
int GetPendingModifiedEventCount () const
 
int GetProcessingMRMLSceneEvent () const
 Return the event id currently processed or 0 if any. More...
 
int InvokePendingModifiedEvent ()
 
virtual void Modified () VTK_OVERRIDE
 
virtual void ObserveMRMLScene ()
 
virtual void OnMRMLNodeModified (vtkMRMLNode *)
 
virtual void OnMRMLSceneEndBatchProcess ()
 
virtual void OnMRMLSceneEndClose ()
 
virtual void OnMRMLSceneEndImport ()
 
virtual void OnMRMLSceneEndRestore ()
 
virtual void OnMRMLSceneNew ()
 
virtual void OnMRMLSceneNodeRemoved (vtkMRMLNode *)
 
virtual void OnMRMLSceneStartBatchProcess ()
 
virtual void OnMRMLSceneStartClose ()
 
virtual void OnMRMLSceneStartImport ()
 
virtual void OnMRMLSceneStartRestore ()
 
virtual void ProcessMRMLLogicsEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void ProcessMRMLSceneEvents (vtkObject *caller, unsigned long event, void *callData)
 
virtual void RegisterNodes ()
 
void SetAndObserveMRMLSceneEventsInternal (vtkMRMLScene *newScene, vtkIntArray *events, vtkFloatArray *priorities=0)
 
void SetDisableModifiedEvent (bool onOff)
 
void SetInMRMLLogicsCallbackFlag (int flag)
 
void SetInMRMLNodesCallbackFlag (int flag)
 
void SetInMRMLSceneCallbackFlag (int flag)
 
void SetProcessingMRMLSceneEvent (int event)
 
bool StartModify ()
 
virtual void UnobserveMRMLScene ()
 
virtual void UpdateFromMRMLScene ()
 
 vtkMRMLAbstractLogic ()
 
virtual ~vtkMRMLAbstractLogic ()
 

Static Protected Member Functions

static void ProgressCallback (void *)
 
- 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)
 

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 42 of file vtkSlicerCLIModuleLogic.h.

Member Typedef Documentation

◆ Superclass

Definition at line 47 of file vtkSlicerCLIModuleLogic.h.

Member Enumeration Documentation

◆ Events

List of custom events fired by the class.

Enumerator
RequestHierarchyEditEvent 

Definition at line 150 of file vtkSlicerCLIModuleLogic.h.

Member Function Documentation

◆ AddCompleteModelHierarchyToMiniScene()

void vtkSlicerCLIModuleLogic::AddCompleteModelHierarchyToMiniScene ( vtkMRMLScene ,
vtkMRMLModelHierarchyNode ,
MRMLIDMap *  sceneToMiniSceneMap,
std::set< std::string > &  filesToDelete 
)
protected

◆ Apply()

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.

◆ ApplyAndWait()

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.

◆ ApplyTask()

void vtkSlicerCLIModuleLogic::ApplyTask ( void *  clientdata)
protected

◆ AutoRun()

void vtkSlicerCLIModuleLogic::AutoRun ( vtkMRMLCommandLineModuleNode cliNode)
protected

Call apply because the node requests it.

◆ ConstructTemporaryFileName()

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

◆ ConstructTemporarySceneFileName()

std::string vtkSlicerCLIModuleLogic::ConstructTemporarySceneFileName ( vtkMRMLScene scene)
protected

◆ CreateNode()

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()

◆ CreateNodeInScene()

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()

◆ DeleteTemporaryFilesOff()

virtual void vtkSlicerCLIModuleLogic::DeleteTemporaryFilesOff ( )
virtual

◆ DeleteTemporaryFilesOn()

virtual void vtkSlicerCLIModuleLogic::DeleteTemporaryFilesOn ( )
virtual

For debugging, control deletion of temp files.

◆ FindHiddenNodeID()

std::string vtkSlicerCLIModuleLogic::FindHiddenNodeID ( const ModuleDescription &  d,
const ModuleParameter &  p 
)
protected

◆ GetAllowInMemoryTransfer()

int vtkSlicerCLIModuleLogic::GetAllowInMemoryTransfer ( ) const

◆ GetClassName()

virtual const char* vtkSlicerCLIModuleLogic::GetClassName ( )
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ GetDefaultModuleDescription()

const ModuleDescription& vtkSlicerCLIModuleLogic::GetDefaultModuleDescription ( ) const

◆ GetDeleteTemporaryFiles()

int vtkSlicerCLIModuleLogic::GetDeleteTemporaryFiles ( ) const

◆ GetRedirectModuleStreams()

int vtkSlicerCLIModuleLogic::GetRedirectModuleStreams ( ) const

◆ IsA()

virtual int vtkSlicerCLIModuleLogic::IsA ( const char *  type)
virtual

Reimplemented from vtkSlicerModuleLogic.

◆ IsCommandLineModuleNodeUpdatingDisplay()

bool vtkSlicerCLIModuleLogic::IsCommandLineModuleNodeUpdatingDisplay ( vtkMRMLCommandLineModuleNode commandLineModuleNode) const
protected

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

◆ IsTypeOf()

static int vtkSlicerCLIModuleLogic::IsTypeOf ( const char *  type)
static

◆ KillProcesses()

void vtkSlicerCLIModuleLogic::KillProcesses ( )

◆ New()

static vtkSlicerCLIModuleLogic* vtkSlicerCLIModuleLogic::New ( )
static

◆ OnMRMLSceneNodeAdded()

virtual void vtkSlicerCLIModuleLogic::OnMRMLSceneNodeAdded ( vtkMRMLNode node)
protectedvirtual

Reimplemented for AutoRun mode.

Reimplemented from vtkMRMLAbstractLogic.

◆ PrintSelf()

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

◆ ProcessMrmlEvents()

virtual void vtkSlicerCLIModuleLogic::ProcessMrmlEvents ( vtkObject *  vtkNotUsedcaller,
unsigned long   vtkNotUsedevent,
void *  vtkNotUsedcallData 
)
inlinevirtual

Definition at line 69 of file vtkSlicerCLIModuleLogic.h.

◆ ProcessMRMLLogicsEvents()

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

Reimplemented to observe vtkSlicerApplicationLogic.

◆ ProcessMRMLNodesEvents()

virtual void vtkSlicerCLIModuleLogic::ProcessMRMLNodesEvents ( vtkObject *  caller,
unsigned long  event,
void *  callData 
)
protectedvirtual

Reimplemented to observe CLI node.

Reimplemented from vtkMRMLAbstractLogic.

◆ ProgressCallback()

static void vtkSlicerCLIModuleLogic::ProgressCallback ( void *  )
staticprotected

◆ RedirectModuleStreamsOff()

virtual void vtkSlicerCLIModuleLogic::RedirectModuleStreamsOff ( )
virtual

◆ RedirectModuleStreamsOn()

virtual void vtkSlicerCLIModuleLogic::RedirectModuleStreamsOn ( )
virtual

For debugging, control redirection of cout and cerr.

◆ SafeDownCast()

static vtkSlicerCLIModuleLogic* vtkSlicerCLIModuleLogic::SafeDownCast ( vtkObject *  o)
static

◆ SetAllowInMemoryTransfer()

void vtkSlicerCLIModuleLogic::SetAllowInMemoryTransfer ( int  value)

◆ SetDefaultModuleDescription()

void vtkSlicerCLIModuleLogic::SetDefaultModuleDescription ( const ModuleDescription &  moduleDescription)

The default module description is used when creating new nodes.

See also
CreateNode()

◆ SetDeleteTemporaryFiles()

void vtkSlicerCLIModuleLogic::SetDeleteTemporaryFiles ( int  value)

◆ SetMRMLApplicationLogic()

virtual void vtkSlicerCLIModuleLogic::SetMRMLApplicationLogic ( vtkMRMLApplicationLogic logic)
virtual

Set the application logic.

Reimplemented from vtkMRMLAbstractLogic.

◆ SetMRMLSceneInternal()

virtual void vtkSlicerCLIModuleLogic::SetMRMLSceneInternal ( vtkMRMLScene newScene)
protectedvirtual

Reimplemented to observe NodeAddedEvent.

Reimplemented from vtkMRMLAbstractLogic.

◆ SetRedirectModuleStreams()

void vtkSlicerCLIModuleLogic::SetRedirectModuleStreams ( int  value)

The documentation for this class was generated from the following file: