Seg3D  2.4
Seg3D is a free volume segmentation and processing tool developed by the NIH Center for Integrative Biomedical Computing at the University of Utah Scientific Computing and Imaging (SCI) Institute.
Public Member Functions | Static Public Attributes | Friends | List of all members
Seg3D::Tool Class Referenceabstract

#include <Tool.h>

Inheritance diagram for Seg3D::Tool:
Core::StateHandler Core::ConnectionHandler Seg3D::GroupTargetTool Seg3D::MeasurementTool Seg3D::SingleTargetTool Seg3D::CropTool Seg3D::FlipTool Seg3D::PadTool Seg3D::ResampleTool Seg3D::TransformTool Seg3D::AndFilter Seg3D::ArithmeticFilter Seg3D::AssembleFilter Seg3D::BinaryIterativeDilateErodeFilter Seg3D::BlobFeatureEnhancementFilter Seg3D::CannyEdgeDetectionFilter Seg3D::CLAHEFilter Seg3D::ConnectedComponentSizeFilter Seg3D::CurvatureAnisotropicDiffusionFilter Seg3D::DiscreteGaussianFilter Seg3D::DistanceFilter Seg3D::ExtractDataLayer Seg3D::FFTFilter Seg3D::GradientAnisotropicDiffusionFilter Seg3D::GradientMagnitudeFilter Seg3D::HistogramEqualizationFilter Seg3D::IntensityCorrectionFilter Seg3D::InvertTool Seg3D::MaskDataFilter Seg3D::MeanFilter Seg3D::MedianFilter Seg3D::OrFilter Seg3D::OtsuThresholdFilter Seg3D::PointSetFilter Seg3D::PolylineTool Seg3D::RefineGridFilter Seg3D::RefineTranslateFilter Seg3D::RemoveFilter Seg3D::SeedPointsTool Seg3D::SliceTargetTool Seg3D::SliceToSliceBruteFilter Seg3D::SliceToSliceFilter Seg3D::SliceToSliceGridFilter Seg3D::SliceToVolumeFilter Seg3D::SpeedlineTool Seg3D::ThresholdSegmentationLSFilter Seg3D::XorFilter

Public Member Functions

 Tool (const std::string &tool_type)
 
virtual ToolInfoHandle get_tool_info () const =0
 
std::string get_name () const
 
std::string get_menu () const
 
std::string get_menu_label () const
 
std::string get_shortcut_key () const
 
std::string get_hotkeys_and_descriptions () const
 
std::string get_url () const
 
std::string get_definition () const
 
const std::string & toolid () const
 
virtual std::string tool_name () const
 
virtual bool handle_mouse_enter (ViewerHandle viewer, int x, int y)
 
virtual bool handle_mouse_leave (ViewerHandle viewer)
 
virtual bool handle_mouse_move (ViewerHandle viewer, const Core::MouseHistory &mouse_history, int button, int buttons, int modifiers)
 
virtual bool handle_mouse_press (ViewerHandle viewer, const Core::MouseHistory &mouse_history, int button, int buttons, int modifiers)
 
virtual bool handle_mouse_release (ViewerHandle viewer, const Core::MouseHistory &mouse_history, int button, int buttons, int modifiers)
 
virtual bool handle_wheel (ViewerHandle viewer, int delta, int x, int y, int buttons, int modifiers)
 
virtual bool handle_key_press (ViewerHandle viewer, int key, int modifiers)
 
virtual bool handle_key_release (ViewerHandle viewer, int key, int modifiers)
 
virtual bool handle_update_cursor (ViewerHandle viewer)
 
virtual void redraw (size_t viewer_id, const Core::Matrix &proj_mat, int viewer_width, int viewer_height)
 
virtual bool has_2d_visual ()
 
virtual bool has_3d_visual ()
 
virtual void close ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual void execute (Core::ActionContextHandle context)
 
- Public Member Functions inherited from Core::StateHandler
 StateHandler (const std::string &type_str, bool auto_id)
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const T &default_value)
 Add a local state variable with default value.
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const T &default_value, const T &min_value, const T &max_value, const T &step)
 Add a local state variable with default value and min and max.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state)
 Add a local state variable without default value.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::string &option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::vector< std::string > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::string &default_option, const std::vector< OptionLabelPair > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::vector< std::string > &default_options, const std::vector< OptionLabelPair > option_list)
 Add a local state variable with option list.
 
template<class HANDLE >
bool add_state (const std::string &key, HANDLE &state, const std::vector< std::string > &default_options, const std::string &option_list)
 Add a local state variable with option list.
 
template<class HANDLE , class T >
bool add_state (const std::string &key, HANDLE &state, const std::vector< T > &default_value)
 Add a local state variable without default value.
 
void invalidate ()
 this function is called when you need to delete something from the state engine, but may have More...
 
bool is_valid ()
 returns true if the function hasn't been invalidated
 
void mark_as_project_data ()
 Mask the states that are added to this state handler as project data.
 
void do_not_save_id_number ()
 The id number of the statehandler will not be saved.
 
void set_initializing (bool initializing)
 
bool load_states (const StateIO &state_io)
 Load the states into the StateIO variable.
 
bool save_states (StateIO &state_io)
 Save the states into the StateIO variable.
 
const std::string & get_statehandler_id () const
 The id of the handler that will be the prefix of the state variables.
 
const std::string & get_statehandler_id_base () const
 The id of the handler that will be the prefix of the state variables.
 
size_t get_statehandler_id_number () const
 The id number of the handler that will be at the end of the prefix.
 

Static Public Attributes

static const std::string NONE_OPTION_C
 

Friends

class ToolFactory
 

Additional Inherited Members

- Protected Member Functions inherited from Core::StateHandler
virtual void clean_up ()
 This function is called by invalidate to clean up stuff in the statehandler subclasses.
 
void enable_signals (bool enabled)
 This function enables/disables signals in the state variables.
 
virtual bool pre_load_states (const StateIO &state_io)
 
virtual bool post_load_states (const StateIO &state_io)
 
virtual bool pre_save_states (StateIO &state_io)
 
virtual bool post_save_states (StateIO &state_io)
 
virtual void state_changed ()
 
virtual int get_session_priority ()
 
virtual int get_version ()
 Get the version number of this class, this one is used for versioning of session files.
 
int get_loaded_version ()
 Get the version number of the data that was loaded.
 
void set_loaded_version (int loaded_version)
 Set the version number of the data that was loaded.
 
- Protected Member Functions inherited from Core::ConnectionHandler
void add_connection (const boost::signals2::connection &connection)
 
void add_connection (const ConnectionHandlerConnectionHandle &connection)
 
void disconnect_all ()
 

Detailed Description

CLASS TOOL: The Tool class forms the basis of the tool classes

Member Function Documentation

void Seg3D::Tool::activate ( )
virtual

ACTIVATE: Activate a tool: this tool is set as the active tool and hence it should setup the right mouse tools in the viewers.

Reimplemented in Seg3D::PaintTool, and Seg3D::SpeedlineTool.

void Seg3D::Tool::close ( )
virtual

CLOSE: This function is called when the application closes the tool. It is meant to disconnect all connections. Since close tool is called synchronously on the application thread, it can clean out most of the underlying connections safely. NOTE: since the tool handle is given to the user interface, the user interface thread may issue the final destruction of the class. Hence all thread critical pieces should be done by this function.

void Seg3D::Tool::deactivate ( )
virtual

DEACTIVATE: Deactivate a tool. A tool is always deactivate before the next one is activated.

Reimplemented in Seg3D::PaintTool, and Seg3D::SpeedlineTool.

void Seg3D::Tool::execute ( Core::ActionContextHandle  context)
virtual
std::string Seg3D::Tool::get_definition ( ) const

GET_DEFINITION: Get the definition of the tool in XML format

std::string Seg3D::Tool::get_hotkeys_and_descriptions ( ) const

GET_HOTKEYS_AND_DESCRIPTIONS: Get the hotkeys for this tool

std::string Seg3D::Tool::get_menu ( ) const

GET_MENU: Get the menu in which the tool is located

std::string Seg3D::Tool::get_menu_label ( ) const

GET_MENU_LABEL: Get the label with which the tool is displayed in the menu

std::string Seg3D::Tool::get_name ( ) const

GET_NAME: Name of the tool

std::string Seg3D::Tool::get_shortcut_key ( ) const

GET_SHORTCUT_KEY: Get the short cut key for this tool

virtual ToolInfoHandle Seg3D::Tool::get_tool_info ( ) const
pure virtual

GET_TOOL_INFO: Get the tool information class that contains all the information about the tool. NOTE: this function is generated using the macro for each function

std::string Seg3D::Tool::get_url ( ) const

GET_URL: Get the URL where more information on the tool can be found

bool Seg3D::Tool::handle_key_press ( ViewerHandle  viewer,
int  key,
int  modifiers 
)
virtual

HANDLE_KEY_PRESS: Called when a key is pressed

Reimplemented in Seg3D::PaintTool, Seg3D::SpeedlineTool, Seg3D::PolylineTool, Seg3D::ThresholdTool, and Seg3D::SeedPointsTool.

bool Seg3D::Tool::handle_key_release ( ViewerHandle  viewer,
int  key,
int  modifiers 
)
virtual

HANDLE_KEY_RELEASE: Called when a key is released

bool Seg3D::Tool::handle_mouse_enter ( ViewerHandle  viewer,
int  x,
int  y 
)
virtual

HANDLE_MOUSE_ENTER: Called when the mouse has entered a viewer.

Reimplemented in Seg3D::PaintTool.

bool Seg3D::Tool::handle_mouse_leave ( ViewerHandle  viewer)
virtual

HANDLE_MOUSE_LEAVE: Called when the mouse has left a viewer.

Reimplemented in Seg3D::PaintTool, Seg3D::CropTool, and Seg3D::TransformTool.

bool Seg3D::Tool::handle_mouse_move ( ViewerHandle  viewer,
const Core::MouseHistory mouse_history,
int  button,
int  buttons,
int  modifiers 
)
virtual

HANDLE_MOUSE_MOVE: Called when the mouse moves in a viewer.

Reimplemented in Seg3D::PaintTool, Seg3D::SpeedlineTool, Seg3D::PolylineTool, Seg3D::CropTool, Seg3D::TransformTool, and Seg3D::SeedPointsTool.

bool Seg3D::Tool::handle_mouse_press ( ViewerHandle  viewer,
const Core::MouseHistory mouse_history,
int  button,
int  buttons,
int  modifiers 
)
virtual
bool Seg3D::Tool::handle_mouse_release ( ViewerHandle  viewer,
const Core::MouseHistory mouse_history,
int  button,
int  buttons,
int  modifiers 
)
virtual

HANDLE_MOUSE_RELEASE: Called when a mouse button has been released.

Reimplemented in Seg3D::PaintTool, Seg3D::CropTool, Seg3D::TransformTool, Seg3D::SpeedlineTool, and Seg3D::PolylineTool.

bool Seg3D::Tool::handle_update_cursor ( ViewerHandle  viewer)
virtual

HANDLE_UPDATE_CURSOR: Called when a viewer requires an update to its cursor.

Reimplemented in Seg3D::PaintTool.

bool Seg3D::Tool::handle_wheel ( ViewerHandle  viewer,
int  delta,
int  x,
int  y,
int  buttons,
int  modifiers 
)
virtual

HANDLE_WHEEL: Called when the mouse wheel has been rotated.

Reimplemented in Seg3D::PaintTool.

bool Seg3D::Tool::has_2d_visual ( )
virtual

HAS_2D_VISUAL: Returns true if the tool draws itself in the 2D view, otherwise false. The default implementation returns false.

Reimplemented in Seg3D::PaintTool, Seg3D::SpeedlineTool, Seg3D::PolylineTool, Seg3D::CropTool, Seg3D::TransformTool, and Seg3D::SeedPointsTool.

bool Seg3D::Tool::has_3d_visual ( )
virtual

HAS_3D_VISUAL: Returns true if the tool draws itself in the volume view, otherwise false. The default implementation returns false.

Reimplemented in Seg3D::SeedPointsTool.

void Seg3D::Tool::redraw ( size_t  viewer_id,
const Core::Matrix proj_mat,
int  viewer_width,
int  viewer_height 
)
virtual

REDRAW: Draw the tool in the specified viewer. Default implementation does nothing. The function should only be called by the renderer, which has a valid GL context. NOTE: If the viewer layout changes, viewer attributes could be changed by the interface thread underneath us. Since there is no way to force Qt to lock the viewer before making these changes, we grab the width and height up front and check for validity so that we at least don't crash later due to a width or height of 0. The width and height are passed to the tools and should be used instead of querying the viewer directly.

Reimplemented in Seg3D::PaintTool, Seg3D::SpeedlineTool, Seg3D::PolylineTool, Seg3D::CropTool, Seg3D::TransformTool, Seg3D::PointsSelectTool, Seg3D::SeedPointsTool, and Seg3D::ThresholdTool.

std::string Seg3D::Tool::tool_name ( ) const
virtual

TOOL_NAME: THe name that appears in the tool header

const std::string & Seg3D::Tool::toolid ( ) const

TOOLID: Get the statehandler id of this tool


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