Luis Ibáñez, Julien Jomier, David Gobbi, Rick Avila, Brian Blake, Hee-Su Kim, Kevin Gary, Stephen Aylward, Kevin Cleary Kitware, Inc.; ISIS-Center, Georgetown University; CADDLab UNC; Atamai Inc; Arizona State University IGSTK: Image Guided Surgery Toolkit A State Machine Architecture
Open Source BSD License Reinforced Software Development Process
Why the State Machine ? Deterministic Behaviour Preclude wrong use Robustness to misuse Traceability Documentation Image Guided Surgery is a critical task Software must protect patient from harm by enforcing:
State Machine State 1 State 2 State 3 …. State N Input 1 Input 2 Input 3 …. Input M Action 1 Action 2 Action 3 …. Action K (State 1,Input 1)->(State 7, Action 4) (State 1,Input 2)->(State 3, Action 2) (State 1,Input 3)->(State 5, Action 6) (State 2,Input 1)->(State 4, Action 9) (State 3,Input 4)->(State 9, Action 2) State K
State Machine Set of States Set of Inputs Set of Actions Set of Transitions
State Machine Diagram State 0 State 1 State 2 State 3 Input 2 Action 5 Input 4 Action 3 Input 7 Action 9 Action 7 Input 4 Input 3 Action 1 Input 2 Action 2 Input 3 Action 1
State Machine Integration State Machine<> IGSTK Component RequestAction1() PerformAction1() public: private: RequestAction2() PerformAction2()
State Machine Integration State Machine<> RequestAction3() PerformAction3() ProcessInput() State AState B Input 3 PushInput(“Input3”) Input Queue
State Machine Integration IGSTK Component RequestAction1()PerformAction1() public:private: RequestAction2()PerformAction2() RequestAction3() RequestAction4() PerformAction3() PerformAction4()
Request Action Methods Request Action( argument list ) ArgumentValidation() ProcessInput() PerformAction4() Input 4( Input categories ) A B D C State Machine
Request Action Methods RequestSelectSlice( int N ) ArgumentValidation()ProcessInput() RejectSliceNumber() ( slice < 0 ) : Input0 : (out of range) B State Machine ( slice > N-1) : Input2 : (out of range) Otherwise : Input1 : (valid value) B RequestSetSlice(int) AcceptSliceNumber() B
Examples of IGSTK State Machine Diagrams
Tracker Base Class
Pulse Generator
Spatial Object
Using the State Machine
Interaction of Multiple Components Images Geometrical Objects Graphical Representation Visualization Tracking
GUI General Interactions View1 View2 View3 View4 Object Representation Spatial Object Tracker TrackerTool 1 TrackerTool 2 TrackerTool 3 Object Representation
Event Class ITK Event TransformEvent TimeStampEvent RefreshSceneEvent IGSTK Event
GUI Timing Controls Scene (view1,repr7) (view3,repr9) View1 View2 View3 View4 Object Representation Spatial Object Tracker TrackerTool 1 TrackerTool 2 TrackerTool 3 Object Representation Tick
IGSTK