Skip to the content.
  1. Summary
    • Image analysis and image guided therapy procedures often have fairly complicated workflows
    • CTK’s workflow manager and workflow widgets provide a mechanism to construct workflows, display the appropriate user interface for each step, validatee user input and transition appropriately between steps of the workflow
    • They use Qt’s state machine implementation, with an additional CTK workflow manager layer
  2. Workflow classes
  3. To define a new workflow step with a user interface
    • Method 1: derive ctkWorkflowWidgetStep: ** Implement validate(): evaluates user input and returns true if valid, false if not. Emits validateComplete(int) when finished. ** Implement entryProcessing(): processing that is done when entering the step. Emits entryProcessingComplete() when finished. ** Implement exitProcessing(): processing that is done when exiting the step. Emits exitProcessingComplete() when finished. ** Either: ** Implement populateStepWidgetsList(QListQWidget stepWidgetsList): add the step’s widgets to the given list; by default they will be displayed vertically in the order in which they were added. Emits populateStepWidgetsListComplete() when finished. *** Implement showUserInterface() and hideUserInterface(): for more control over the step’s UI. Emits showUserInterfaceComplete() and hideUserInterfaceComplete(), respectively, when finished.

w.addTransition(s1, s2); w.addTransition(s2, s3);

/pre

  1. Workflow layout workflowWidgetLayout

  2. Branching workflows pre s3—-s4 “simple” / s0—-s1—-s2
    s5—-s6 “advanced” /pre Associated code: pre ctkWorkflow w;

ctkWorkflowStep s0; … ctkWorkflowStep s6;

w.setInitialStep(s0); [Ideally - should be optional]

w.addTransition(s0, s1); w.addTransition(s1, s2); w.addTransition(s2, s3, ctkWorkflow::BiDirectionnal, “simple”); w.addTransition(s3, s4); w.addTransition(s2, s5, ctkWorkflow::BiDirectionnal, “advanced”); w.addTransition(s5, s6); /pre

Conditional branching:

pre [signal] void validationComplete(bool isValid, const QString branchId) /pre

** Multiple transitions: ** *(incorrect usage) transitions created with branchIds: use first transition that was added