14#include "ui_QmitkUSAbstractNavigationStep.h"
23 QWidget(parent), m_NavigationStepState(State_Stopped)
48 m_DataStorage = dataStorage;
53 m_CombinedModality = combinedModality;
54 MITK_INFO <<
"Combined modality set to NULL: " << m_CombinedModality.IsNull();
140 return m_NavigationStepState;
145 if ( throwNull && m_DataStorage.IsNull() )
147 MITK_ERROR <<
"Data storage must be set to step widget before.";
148 mitkThrow() <<
"Data storage must be set to step widget before.";
151 return m_DataStorage;
156 if ( throwNull && m_CombinedModality.IsNull() )
158 MITK_INFO <<
"Combined modality is not set yet for this widget.";
159 mitkThrow() <<
"Combined modality is not set yet for this widget.";
162 return m_CombinedModality;
167 if ( m_DataStorage.IsNull() )
169 MITK_ERROR <<
"Data storage must be set to step widget before.";
170 mitkThrow() <<
"Data storage must be set to step widget before.";
173 mitk::DataNode::Pointer sourceNode = m_DataStorage->GetNamedNode(sourceName);
174 if ( sourceNode.IsNull() )
176 MITK_WARN <<
"Source node cannot be found in data storage. Returning null.";
180 return m_DataStorage->GetNamedDerivedNode(name, m_DataStorage->GetNamedNode(sourceName));
185 if ( m_DataStorage.IsNull() )
187 MITK_ERROR <<
"Data storage must be set to step widget before.";
188 mitkThrow() <<
"Data storage must be set to step widget before.";
191 mitk::DataNode::Pointer sourceNode = m_DataStorage->GetNamedNode(sourceName);
192 mitk::DataNode::Pointer dataNode = m_DataStorage->GetNamedDerivedNode(name, sourceNode);
194 if ( dataNode.IsNull() )
196 dataNode = mitk::DataNode::New();
197 dataNode->SetName(name);
198 if ( sourceNode.IsNotNull() )
itk::SmartPointer< mitk::DataStorage > GetDataStorage(bool throwNull=true)
Returns the data storage set for the navigation step.
NavigationStepState GetNavigationStepState()
Get the current state of the navigation step.
bool DeactivateStep()
Should be called to deactivate the navigation step.
virtual FilterVector GetFilter()
Getter for navigation data filters of the navigation step. This method may be implemented by a concre...
QmitkUSAbstractNavigationStep(QWidget *parent=nullptr)
void Update()
Should be called periodically while the navigation step is active. Internal, the method OnUpdate() is...
virtual bool OnDeactivateStep()
Called when the navigation step gets deactivated (-> state started). This method may be implemented b...
static const char * DATANAME_BASENODE
~QmitkUSAbstractNavigationStep() override
bool StopStep()
Should be called to stop the navigation step.
void SetCombinedModality(itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > combinedModality)
Sets the combined modality for the navigation step. OnSetCombinedModality() is called internal.
virtual bool OnStartStep()=0
Called when the navigation step gets started. This method has to be implemented by a concrete subclas...
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....
bool RestartStep()
Should be called to restart the navigation step.
itk::SmartPointer< mitk::AbstractUltrasoundTrackerDevice > GetCombinedModality(bool throwNull=true)
Returns the combined modality set for the navigation step.
virtual void OnUpdate()=0
Called periodically while a navigation step is active. This method has to be implemented by a concret...
bool StartStep()
Should be called to start the navigation step.
virtual bool OnActivateStep()=0
Called when the navigation step gets activated. This method has to be implemented by a concrete subcl...
virtual bool GetIsRestartable()
Indicates if it makes sense to be able to restart the step. This method must be implemented by concre...
static const char * DATANAME_SETTINGS
std::vector< itk::SmartPointer< mitk::NavigationDataToNavigationDataFilter > > FilterVector
virtual bool OnFinishStep()=0
Called when all necessary actions for the step where done. This method has to be implemented by a con...
bool ActivateStep()
Should be called to activate the navigation step. The step gets started before if it was stopped.
virtual bool OnRestartStep()
Called when restarting a navigation step. This method may be implemented by a concrete subclass to ha...
bool FinishStep()
Should be called to finish the navigation step. The state has to be 'active' before and is 'started' ...
void SetDataStorage(itk::SmartPointer< mitk::DataStorage > dataStorage)
Sets the data storage for the exchange of results between navigation steps.
static const char * DATANAME_IMAGESTREAM
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.
virtual bool OnStopStep()
Callen when the navigation step gets stopped. This method may be implemented by a concrete subclass t...
virtual void OnSetCombinedModality()
Called every time SetCombinedModality() was called. This method may be implemented by a concrete subc...