MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkUSAbstractNavigationStep Class Referenceabstract

Abstract base class for navigation step widgets. More...

#include <QmitkUSAbstractNavigationStep.h>

Inheritance diagram for QmitkUSAbstractNavigationStep:
QmitkUSNavigationStepCombinedModality QmitkUSNavigationStepCtUsRegistration QmitkUSNavigationStepMarkerIntervention QmitkUSNavigationStepPlacementPlanning QmitkUSNavigationStepPunctuationIntervention QmitkUSNavigationStepTumourSelection QmitkUSNavigationStepZoneMarking

Public Types

enum  NavigationStepState { State_Stopped , State_Started , State_Active }
 
typedef std::vector< itk::SmartPointer< mitk::NavigationDataToNavigationDataFilter > > FilterVector
 

Signals

void SignalReadyForNextStep ()
 Signals that all necessary actions where done. The user can proceed with the next stept after this was signaled.
 
void SignalNoLongerReadyForNextStep ()
 Signals that it is no longer possible to proceed with following steps. This signal is emitted when the result data of the step was removed or changed, so that the old results are invalid for following steps.
 
void SignalCombinedModalityChanged (itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice >)
 Signals that the combined modality was changed by this step. This signal is mainly for steps which creates the combined modality. The new combined modality is given as a parameter.
 
void SignalIntermediateResult (const itk::SmartPointer< mitk::DataNode >)
 Signals that an intermediate result was produced. The properties of the given data node must contain the results. This signal can be used to log the intermediate results of an experiment, for example by using the mitk::USNavigationExperimentLogging.
 
void SignalSettingsNodeChanged (itk::SmartPointer< mitk::DataNode >)
 Signals that the settings node was changed. This signal must not be emitted in an OnSettingsChanged() method.
 

Public Member Functions

 QmitkUSAbstractNavigationStep (QWidget *parent=nullptr)
 
 ~QmitkUSAbstractNavigationStep () override
 
virtual QString GetTitle ()=0
 Getter for the title of the navigation step. This title should be human readable and can be used to display the available steps and the currently active step to the user. The method has to be implemented by a concrete subclass.
 
virtual bool GetIsRestartable ()
 Indicates if it makes sense to be able to restart the step. This method must be implemented by concrete subclasses if it should not be possible to restart them.
 
virtual void OnSettingsChanged (const itk::SmartPointer< mitk::DataNode >)
 Called every time the settings for the navigation process where changed. This method may be implemented by a concrete subclass. The default implementation does nothing.
 
virtual FilterVector GetFilter ()
 Getter for navigation data filters of the navigation step. This method may be implemented by a concrete subclass. The default implementation returns an empty vector.
 
void SetDataStorage (itk::SmartPointer< mitk::DataStorage > dataStorage)
 Sets the data storage for the exchange of results between navigation steps.
 
void SetCombinedModality (itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > combinedModality)
 Sets the combined modality for the navigation step. OnSetCombinedModality() is called internal.
 
bool StartStep ()
 Should be called to start the navigation step.
 
bool StopStep ()
 Should be called to stop the navigation step.
 
bool RestartStep ()
 Should be called to restart the navigation step.
 
bool FinishStep ()
 Should be called to finish the navigation step. The state has to be 'active' before and is 'started' afterwards.
 
bool ActivateStep ()
 Should be called to activate the navigation step. The step gets started before if it was stopped.
 
bool DeactivateStep ()
 Should be called to deactivate the navigation step.
 
void Update ()
 Should be called periodically while the navigation step is active. Internal, the method OnUpdate() is called.
 
NavigationStepState GetNavigationStepState ()
 Get the current state of the navigation step.
 

Static Public Attributes

static const char * DATANAME_SETTINGS = "Settings"
 
static const char * DATANAME_IMAGESTREAM = "US Image Stream"
 
static const char * DATANAME_BASENODE = QmitkUSAbstractNavigationStep::DATANAME_IMAGESTREAM
 

Protected Member Functions

virtual bool OnStartStep ()=0
 Called when the navigation step gets started. This method has to be implemented by a concrete subclass to handle actions necessary for starting the step (e.g. initializing that has only to be done once).
 
virtual bool OnStopStep ()
 Callen when the navigation step gets stopped. This method may be implemented by a concrete subclass to handle actions necessary for stopping the step (e.g. cleanup). The default implementation does nothing.
 
virtual bool OnRestartStep ()
 Called when restarting a navigation step. This method may be implemented by a concrete subclass to handle actions necessary for restarting the navigation step. The default implementations calls OnStopStep() followed by OnStartStep().
 
virtual bool OnFinishStep ()=0
 Called when all necessary actions for the step where done. This method has to be implemented by a concrete subclass to handle actions necessary for finishing the navigation step.
 
virtual bool OnActivateStep ()=0
 Called when the navigation step gets activated. This method has to be implemented by a concrete subclass to handle actions necessary on activating the navigation step.
 
virtual bool OnDeactivateStep ()
 Called when the navigation step gets deactivated (-> state started). This method may be implemented by a concrete subclass to handle actions necessary on deactivating the navigation step, which means switching to another step.
 
virtual void OnUpdate ()=0
 Called periodically while a navigation step is active. This method has to be implemented by a concrete subclass to handle all periodic actions during the navigation step.
 
virtual void OnSetCombinedModality ()
 Called every time SetCombinedModality() was called. This method may be implemented by a concrete subclass to handle this event. The default implementation does nothing.
 
itk::SmartPointer< mitk::DataStorage > GetDataStorage (bool throwNull=true)
 Returns the data storage set for the navigation step.
 
itk::SmartPointer< mitk::AbstractUltrasoundTrackerDeviceGetCombinedModality (bool throwNull=true)
 Returns the combined modality set for the navigation step.
 
itk::SmartPointer< mitk::DataNode > GetNamedDerivedNode (const char *name, const char *sourceName)
 Returns node with the given name and the given source node (parent) from the data storage.
 
itk::SmartPointer< mitk::DataNode > GetNamedDerivedNodeAndCreate (const char *name, const char *sourceName)
 Returns node with the given name and the given source node (parent) from the data storage. The node is created if no matching node was found.
 

Detailed Description

Abstract base class for navigation step widgets.

This class defines a life cycle for navigation steps. Steps can be activated and deactivated. The first time a step is activated, it is started before the activation. Steps can be stopped, finished and restarted, too.

On every state change, the corresponding virtual On... method is called (OnStartStep(), OnActivateStep(), OnFinishStep(), ...). These methods are to implement by concrete navigation step widgets. While a step is in the "active" state, its OnUpdate() method is called periodically.

Definition at line 41 of file QmitkUSAbstractNavigationStep.h.

Member Typedef Documentation

◆ FilterVector

Member Enumeration Documentation

◆ NavigationStepState

Enumerator
State_Stopped 
State_Started 
State_Active 

Definition at line 83 of file QmitkUSAbstractNavigationStep.h.

Constructor & Destructor Documentation

◆ QmitkUSAbstractNavigationStep()

QmitkUSAbstractNavigationStep::QmitkUSAbstractNavigationStep ( QWidget * parent = nullptr)
explicit

Definition at line 22 of file QmitkUSAbstractNavigationStep.cpp.

◆ ~QmitkUSAbstractNavigationStep()

QmitkUSAbstractNavigationStep::~QmitkUSAbstractNavigationStep ( )
override

Definition at line 27 of file QmitkUSAbstractNavigationStep.cpp.

Member Function Documentation

◆ ActivateStep()

bool QmitkUSAbstractNavigationStep::ActivateStep ( )

Should be called to activate the navigation step. The step gets started before if it was stopped.

Returns
true if the state wasn't 'activated' and OnActivateStep() returns true

Definition at line 104 of file QmitkUSAbstractNavigationStep.cpp.

◆ DeactivateStep()

bool QmitkUSAbstractNavigationStep::DeactivateStep ( )

Should be called to deactivate the navigation step.

Returns
true if the state was 'activated' and OnDeactivateStep() returns true

Definition at line 119 of file QmitkUSAbstractNavigationStep.cpp.

◆ FinishStep()

bool QmitkUSAbstractNavigationStep::FinishStep ( )

Should be called to finish the navigation step. The state has to be 'active' before and is 'started' afterwards.

Returns
true if the state was 'active' and DeactivateStep() and OnFinishStep() return true

Definition at line 90 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetCombinedModality()

itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > QmitkUSAbstractNavigationStep::GetCombinedModality ( bool throwNull = true)
protected

Returns the combined modality set for the navigation step.

Parameters
throwNullif this method should throw an exception when the combined modality is null (default: true)
Returns
the combined modality set by SetCombinedModality(); can only be null if the parameter throwNull is set to false
Exceptions
mitk::Exceptionif the combined modality is null and the parameter throwNull is set to true

Definition at line 154 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetDataStorage()

itk::SmartPointer< mitk::DataStorage > QmitkUSAbstractNavigationStep::GetDataStorage ( bool throwNull = true)
protected

Returns the data storage set for the navigation step.

Parameters
throwNullif this method should throw an exception when the data storage is null (default: true)
Returns
the data storage set by SetDataStorage(); can only be null if the parameter throwNull is set to false
Exceptions
mitk::Exceptionif the data storage is null and the parameter throwNull is set to true

Definition at line 143 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetFilter()

QmitkUSAbstractNavigationStep::FilterVector QmitkUSAbstractNavigationStep::GetFilter ( )
virtual

Getter for navigation data filters of the navigation step. This method may be implemented by a concrete subclass. The default implementation returns an empty vector.

Returns
all navigation data filters that should be updated during the navigation process

Reimplemented in QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

Definition at line 41 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetIsRestartable()

bool QmitkUSAbstractNavigationStep::GetIsRestartable ( )
virtual

Indicates if it makes sense to be able to restart the step. This method must be implemented by concrete subclasses if it should not be possible to restart them.

Returns
true for the default implementation

Reimplemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepMarkerIntervention, and QmitkUSNavigationStepPunctuationIntervention.

Definition at line 36 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetNamedDerivedNode()

itk::SmartPointer< mitk::DataNode > QmitkUSAbstractNavigationStep::GetNamedDerivedNode ( const char * name,
const char * sourceName )
protected

Returns node with the given name and the given source node (parent) from the data storage.

Parameters
namethe name of the node which should be got from the data storage
sourceNamename of the source node under which the node should be searched
Returns
node with the given name or null if no node with the given name and source node could be found
Exceptions
mitk::Exceptionif the data storage (can be set by SetDataStorage()) is null

Definition at line 165 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetNamedDerivedNodeAndCreate()

itk::SmartPointer< mitk::DataNode > QmitkUSAbstractNavigationStep::GetNamedDerivedNodeAndCreate ( const char * name,
const char * sourceName )
protected

Returns node with the given name and the given source node (parent) from the data storage. The node is created if no matching node was found.

Parameters
namethe name of the node which should be got from the data storage
sourceNamename of the source node under which the node should be searched
Returns
node with the given name
Exceptions
mitk::Exceptionif the data storage (can be set by SetDataStorage()) is null

Definition at line 183 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetNavigationStepState()

QmitkUSAbstractNavigationStep::NavigationStepState QmitkUSAbstractNavigationStep::GetNavigationStepState ( )

Get the current state of the navigation step.

Returns
State_Stopped, State_Started or State_Active

Definition at line 138 of file QmitkUSAbstractNavigationStep.cpp.

◆ GetTitle()

virtual QString QmitkUSAbstractNavigationStep::GetTitle ( )
pure virtual

Getter for the title of the navigation step. This title should be human readable and can be used to display the available steps and the currently active step to the user. The method has to be implemented by a concrete subclass.

Implemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

◆ OnActivateStep()

virtual bool QmitkUSAbstractNavigationStep::OnActivateStep ( )
protectedpure virtual

Called when the navigation step gets activated. This method has to be implemented by a concrete subclass to handle actions necessary on activating the navigation step.

Returns
if the actions were done successfully

Implemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

◆ OnDeactivateStep()

virtual bool QmitkUSAbstractNavigationStep::OnDeactivateStep ( )
inlineprotectedvirtual

Called when the navigation step gets deactivated (-> state started). This method may be implemented by a concrete subclass to handle actions necessary on deactivating the navigation step, which means switching to another step.

Returns
if the actions were done successfully; true on every call for the default implementation

Reimplemented in QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

Definition at line 245 of file QmitkUSAbstractNavigationStep.h.

◆ OnFinishStep()

virtual bool QmitkUSAbstractNavigationStep::OnFinishStep ( )
protectedpure virtual

Called when all necessary actions for the step where done. This method has to be implemented by a concrete subclass to handle actions necessary for finishing the navigation step.

Returns
if the actions were done successfully

Implemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

◆ OnRestartStep()

bool QmitkUSAbstractNavigationStep::OnRestartStep ( )
protectedvirtual

Called when restarting a navigation step. This method may be implemented by a concrete subclass to handle actions necessary for restarting the navigation step. The default implementations calls OnStopStep() followed by OnStartStep().

Returns
if the actions were done successfully

Reimplemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, and QmitkUSNavigationStepTumourSelection.

Definition at line 31 of file QmitkUSAbstractNavigationStep.cpp.

◆ OnSetCombinedModality()

virtual void QmitkUSAbstractNavigationStep::OnSetCombinedModality ( )
inlineprotectedvirtual

Called every time SetCombinedModality() was called. This method may be implemented by a concrete subclass to handle this event. The default implementation does nothing.

Reimplemented in QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

Definition at line 259 of file QmitkUSAbstractNavigationStep.h.

◆ OnSettingsChanged()

virtual void QmitkUSAbstractNavigationStep::OnSettingsChanged ( const itk::SmartPointer< mitk::DataNode > )
inlinevirtual

Called every time the settings for the navigation process where changed. This method may be implemented by a concrete subclass. The default implementation does nothing.

Reimplemented in QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

Definition at line 114 of file QmitkUSAbstractNavigationStep.h.

◆ OnStartStep()

virtual bool QmitkUSAbstractNavigationStep::OnStartStep ( )
protectedpure virtual

Called when the navigation step gets started. This method has to be implemented by a concrete subclass to handle actions necessary for starting the step (e.g. initializing that has only to be done once).

Returns
if the actions were done successfully

Implemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

◆ OnStopStep()

virtual bool QmitkUSAbstractNavigationStep::OnStopStep ( )
inlineprotectedvirtual

Callen when the navigation step gets stopped. This method may be implemented by a concrete subclass to handle actions necessary for stopping the step (e.g. cleanup). The default implementation does nothing.

Returns
if the actions were done successfully; true on every call for the default implementation

Reimplemented in QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

Definition at line 207 of file QmitkUSAbstractNavigationStep.h.

◆ OnUpdate()

virtual void QmitkUSAbstractNavigationStep::OnUpdate ( )
protectedpure virtual

Called periodically while a navigation step is active. This method has to be implemented by a concrete subclass to handle all periodic actions during the navigation step.

Implemented in QmitkUSNavigationStepCombinedModality, QmitkUSNavigationStepCtUsRegistration, QmitkUSNavigationStepMarkerIntervention, QmitkUSNavigationStepPlacementPlanning, QmitkUSNavigationStepPunctuationIntervention, QmitkUSNavigationStepTumourSelection, and QmitkUSNavigationStepZoneMarking.

◆ RestartStep()

bool QmitkUSAbstractNavigationStep::RestartStep ( )

Should be called to restart the navigation step.

Returns
true if OnRestartStep() returns true

Definition at line 85 of file QmitkUSAbstractNavigationStep.cpp.

◆ SetCombinedModality()

void QmitkUSAbstractNavigationStep::SetCombinedModality ( itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > combinedModality)

Sets the combined modality for the navigation step. OnSetCombinedModality() is called internal.

Definition at line 51 of file QmitkUSAbstractNavigationStep.cpp.

◆ SetDataStorage()

void QmitkUSAbstractNavigationStep::SetDataStorage ( itk::SmartPointer< mitk::DataStorage > dataStorage)

Sets the data storage for the exchange of results between navigation steps.

Definition at line 46 of file QmitkUSAbstractNavigationStep.cpp.

◆ SignalCombinedModalityChanged

void QmitkUSAbstractNavigationStep::SignalCombinedModalityChanged ( itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > )
signal

Signals that the combined modality was changed by this step. This signal is mainly for steps which creates the combined modality. The new combined modality is given as a parameter.

◆ SignalIntermediateResult

void QmitkUSAbstractNavigationStep::SignalIntermediateResult ( const itk::SmartPointer< mitk::DataNode > )
signal

Signals that an intermediate result was produced. The properties of the given data node must contain the results. This signal can be used to log the intermediate results of an experiment, for example by using the mitk::USNavigationExperimentLogging.

◆ SignalNoLongerReadyForNextStep

void QmitkUSAbstractNavigationStep::SignalNoLongerReadyForNextStep ( )
signal

Signals that it is no longer possible to proceed with following steps. This signal is emitted when the result data of the step was removed or changed, so that the old results are invalid for following steps.

◆ SignalReadyForNextStep

void QmitkUSAbstractNavigationStep::SignalReadyForNextStep ( )
signal

Signals that all necessary actions where done. The user can proceed with the next stept after this was signaled.

◆ SignalSettingsNodeChanged

void QmitkUSAbstractNavigationStep::SignalSettingsNodeChanged ( itk::SmartPointer< mitk::DataNode > )
signal

Signals that the settings node was changed. This signal must not be emitted in an OnSettingsChanged() method.

◆ StartStep()

bool QmitkUSAbstractNavigationStep::StartStep ( )

Should be called to start the navigation step.

Returns
true if the state was 'stopped' before and OnStartStep() returns true

Definition at line 59 of file QmitkUSAbstractNavigationStep.cpp.

◆ StopStep()

bool QmitkUSAbstractNavigationStep::StopStep ( )

Should be called to stop the navigation step.

Returns
true if the state was 'started' (or 'active') and OnStopStep() (and OnDeactivateStep()) return true

Definition at line 70 of file QmitkUSAbstractNavigationStep.cpp.

◆ Update()

void QmitkUSAbstractNavigationStep::Update ( )

Should be called periodically while the navigation step is active. Internal, the method OnUpdate() is called.

Definition at line 133 of file QmitkUSAbstractNavigationStep.cpp.

Member Data Documentation

◆ DATANAME_BASENODE

const char * QmitkUSAbstractNavigationStep::DATANAME_BASENODE = QmitkUSAbstractNavigationStep::DATANAME_IMAGESTREAM
static

Definition at line 87 of file QmitkUSAbstractNavigationStep.h.

◆ DATANAME_IMAGESTREAM

const char * QmitkUSAbstractNavigationStep::DATANAME_IMAGESTREAM = "US Image Stream"
static

Definition at line 86 of file QmitkUSAbstractNavigationStep.h.

◆ DATANAME_SETTINGS

const char * QmitkUSAbstractNavigationStep::DATANAME_SETTINGS = "Settings"
static

Definition at line 85 of file QmitkUSAbstractNavigationStep.h.


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