Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkFreeSurferParcellationHandler Class Reference

This handler returns either the pixelvalue or anatomical label of the current position of the crosshair inside a visible parcellation. If no parcellation is visible no data is thrown. More...

#include <QmitkFreeSurferParcellationHandler.h>

Inheritance diagram for QmitkFreeSurferParcellationHandler:
Collaboration diagram for QmitkFreeSurferParcellationHandler:

Signals

void changed (int)
 Emitted when pixelValue has changed. More...
 
void changed (const QString &)
 Emitted when pixelValue has changed. More...
 
void clicked (int)
 Thrown if and only if the left mousebutton is pressed and pixelValue has changed. More...
 
void clicked (const QString &)
 Thrown if and only if the left mousebutton is pressed and pixelValue has changed. More...
 
void scrolled (int)
 Thrown if mouse scrolled and pixelvalue changed. More...
 
void scrolled (const QString &)
 Thrown if mouse scrolled and anatomcial labl changed. More...
 

Public Member Functions

 mitkClassMacro (QmitkFreeSurferParcellationHandler, DataInteractor) static Pointer New()
 
 QmitkFreeSurferParcellationHandler ()
 
 ~QmitkFreeSurferParcellationHandler ()
 
- Public Member Functions inherited from mitk::EventStateMachine
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
bool LoadStateMachine (const std::string &filename, const us::Module *module=nullptr)
 Loads XML resource. More...
 
bool HandleEvent (InteractionEvent *event, DataNode *dataNode)
 
void EnableUndo (bool enable)
 Enables or disabled Undo. More...
 
void EnableInteraction (bool enable)
 Enables/disables the state machine. In un-enabled state it won't react to any events. More...
 
- Public Member Functions inherited from mitk::InteractionEventHandler
bool SetEventConfig (const std::string &filename, const us::Module *module=nullptr)
 Loads a configuration from an XML resource. More...
 
bool SetEventConfig (const EventConfig &config)
 Loads a configuration from an EventConfig object. More...
 
EventConfig GetEventConfig () const
 Returns the current configuration. More...
 
bool AddEventConfig (const std::string &filename, const us::Module *module=nullptr)
 This method extends the configuration. More...
 
bool AddEventConfig (const EventConfig &config)
 This method extends the configuration. The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new one. This way several configurations can be combined. More...
 
- Public Member Functions inherited from mitk::InteractionEventObserver
 InteractionEventObserver ()
 
virtual ~InteractionEventObserver ()
 
void Disable ()
 
void Enable ()
 
bool IsEnabled () const
 

Protected Member Functions

virtual void Notify (InteractionEvent *interactionEvent, bool isHandled)
 
- Protected Member Functions inherited from mitk::EventStateMachine
 EventStateMachine ()
 
virtual ~EventStateMachine ()
 
void AddActionFunction (const std::string &action, TActionFunctor *functor)
 
void AddActionFunction (const std::string &action, const ActionFunctionDelegate &delegate)
 
void AddConditionFunction (const std::string &condition, const ConditionFunctionDelegate &delegate)
 
StateMachineStateGetCurrentState () const
 
void ResetToStartState ()
 ResetToStartState Reset state machine to it initial starting state. More...
 
virtual void ConnectActionsAndFunctions ()
 
virtual bool CheckCondition (const StateMachineCondition &condition, const InteractionEvent *interactionEvent)
 
virtual void ExecuteAction (StateMachineAction *action, InteractionEvent *interactionEvent)
 
virtual bool FilterEvents (InteractionEvent *interactionEvent, DataNode *dataNode)
 
void SetMouseCursor (const char *xpm[], int hotspotX, int hotspotY)
 Sets the specified mouse cursor. More...
 
void ResetMouseCursor ()
 Resets the mouse cursor (if modified by the SlicesCoordinator) to its original state. More...
 
StateMachineTransitionGetExecutableTransition (InteractionEvent *event)
 Returns the executable transition for the given event. More...
 
- Protected Member Functions inherited from mitk::InteractionEventHandler
 InteractionEventHandler ()
 
virtual ~InteractionEventHandler ()
 
PropertyList::Pointer GetAttributes () const
 
std::string MapToEventVariant (InteractionEvent *interactionEvent)
 
virtual void ConfigurationChanged ()
 

Protected Attributes

int m_LastPixelvalue
 The current pixelvalue. More...
 
mitk::FreeSurferParcellationTranslator::Pointer m_Translator
 Translator for coverting pixelvalue into anatomical label. More...
 
us::ServiceRegistration< InteractionEventObserverm_ServiceRegistration
 
- Protected Attributes inherited from mitk::EventStateMachine
bool m_IsActive
 
UndoControllerm_UndoController
 
bool m_UndoEnabled
 

Additional Inherited Members

- Public Types inherited from mitk::EventStateMachine
typedef EventStateMachine Self
 
typedef InteractionEventHandler Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, TActionFunctor * > ActionFunctionsMapType
 
typedef itk::SmartPointer< StateMachineStateStateMachineStateType
 
- Public Types inherited from mitk::InteractionEventHandler
typedef InteractionEventHandler Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Static Public Member Functions inherited from mitk::EventStateMachine
static const char * GetStaticNameOfClass ()
 
- Static Public Member Functions inherited from mitk::InteractionEventHandler
static const char * GetStaticNameOfClass ()
 
- Protected Types inherited from mitk::EventStateMachine
typedef MessageAbstractDelegate2< StateMachineAction *, InteractionEvent *, void > ActionFunctionDelegate
 
typedef MessageAbstractDelegate1< const InteractionEvent *, bool > ConditionFunctionDelegate
 

Detailed Description

This handler returns either the pixelvalue or anatomical label of the current position of the crosshair inside a visible parcellation. If no parcellation is visible no data is thrown.

Definition at line 33 of file QmitkFreeSurferParcellationHandler.h.

Constructor & Destructor Documentation

US_USE_NAMESPACE QmitkFreeSurferParcellationHandler::QmitkFreeSurferParcellationHandler ( )
QmitkFreeSurferParcellationHandler::~QmitkFreeSurferParcellationHandler ( )

Member Function Documentation

void QmitkFreeSurferParcellationHandler::changed ( int  )
signal

Emitted when pixelValue has changed.

Parameters
valueof the current selected pixel

Referenced by Notify().

void QmitkFreeSurferParcellationHandler::changed ( const QString &  )
signal

Emitted when pixelValue has changed.

Parameters
anatomicallabel
void QmitkFreeSurferParcellationHandler::clicked ( int  )
signal

Thrown if and only if the left mousebutton is pressed and pixelValue has changed.

Parameters
valueof the selected pixel

Referenced by Notify().

void QmitkFreeSurferParcellationHandler::clicked ( const QString &  )
signal

Thrown if and only if the left mousebutton is pressed and pixelValue has changed.

Parameters
anatomicallabel
QmitkFreeSurferParcellationHandler::mitkClassMacro ( QmitkFreeSurferParcellationHandler  ,
DataInteractor   
)
void QmitkFreeSurferParcellationHandler::Notify ( InteractionEvent interactionEvent,
bool  isHandled 
)
protectedvirtual

By this method all registered EventObersers are notified about every InteractionEvent, the isHandled flag indicates if a DataInteractor has already handled that event. InteractionEventObserver that trigger an action when observing an event may consider this in order to not confuse the user by, triggering several independent action with one single user event (such as a mouse click)

If you want to use the InteractionEventObserver as a state machine give the event to the state machine by implementing, e.g.

{
if (!isHandled) {
this->HandleEvent(interactionEvent, NULL);
}
}

This overwrites the FilterEvents function of the EventStateMachine to ignore the DataNode, since InteractionEventObservers are not associated with one. virtual bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode);

Implements mitk::InteractionEventObserver.

Definition at line 50 of file QmitkFreeSurferParcellationHandler.cpp.

References changed(), clicked(), mitk::BaseRenderer::GetDataStorage(), mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByWorldCoordinates(), mitk::InteractionPositionEvent::GetPositionInWorld(), mitk::InteractionEvent::GetSender(), m_Translator, MITK_WARN, mitk::New(), and scrolled().

void QmitkFreeSurferParcellationHandler::scrolled ( int  )
signal

Thrown if mouse scrolled and pixelvalue changed.

Parameters
valueof the selected pixel

Referenced by Notify().

void QmitkFreeSurferParcellationHandler::scrolled ( const QString &  )
signal

Thrown if mouse scrolled and anatomcial labl changed.

Parameters
anatomicallabel

Member Data Documentation

int QmitkFreeSurferParcellationHandler::m_LastPixelvalue
protected

The current pixelvalue.

Definition at line 87 of file QmitkFreeSurferParcellationHandler.h.

us::ServiceRegistration<InteractionEventObserver> QmitkFreeSurferParcellationHandler::m_ServiceRegistration
protected

Reference to the service registration of the observer, it is needed to unregister the observer on unload.

Definition at line 96 of file QmitkFreeSurferParcellationHandler.h.

Referenced by QmitkFreeSurferParcellationHandler(), and ~QmitkFreeSurferParcellationHandler().

mitk::FreeSurferParcellationTranslator::Pointer QmitkFreeSurferParcellationHandler::m_Translator
protected

Translator for coverting pixelvalue into anatomical label.

Definition at line 91 of file QmitkFreeSurferParcellationHandler.h.

Referenced by Notify().


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