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 | Protected Member Functions | List of all members
Core::Action Class Referenceabstract

#include <Action.h>

Inheritance diagram for Core::Action:
Core::ActionAdd Core::ActionClear Core::ActionGet Core::ActionOffset Core::ActionRemove Core::ActionRotateView Core::ActionScaleView Core::ActionSet Core::ActionSetAt Core::ActionSetRange Core::ActionToggle Core::ActionTranslateView Seg3D::ActionActivateLayer Seg3D::ActionActivateTool Seg3D::ActionAddNote Seg3D::ActionAutoSave Seg3D::ActionAutoView Seg3D::ActionBeginScriptStatusReport Seg3D::ActionCalculateMaskVolume Seg3D::ActionCloseTool Seg3D::ActionComputeIsosurface Seg3D::ActionCreateSandbox Seg3D::ActionDeleteFeature Seg3D::ActionDeleteIsosurface Seg3D::ActionDeleteSandbox Seg3D::ActionDeleteSession Seg3D::ActionDuplicateLayer Seg3D::ActionEndScriptStatusReport Seg3D::ActionExportIsosurface Seg3D::ActionExportLayer Seg3D::ActionExportPoints Seg3D::ActionExportProject Seg3D::ActionExportSegmentation Seg3D::ActionGetLayerGroup Seg3D::ActionLoadProject Seg3D::ActionLoadSession Seg3D::ActionMigrateSandboxLayer Seg3D::ActionMoveGroup Seg3D::ActionMoveLayer Seg3D::ActionNewFeature Seg3D::ActionNewProject Seg3D::ActionOffsetSlice Seg3D::ActionOpenTool Seg3D::ActionPickPoint Seg3D::ActionRecreateLayer Seg3D::ActionRedo Seg3D::ActionReportScriptStatus Seg3D::ActionResetChangesMade Seg3D::ActionSavePreferences Seg3D::ActionSaveProjectAs Seg3D::ActionSaveSession Seg3D::ActionSaveToolPreferences Seg3D::ActionShiftActiveLayer Seg3D::ActionSnap Seg3D::ActionSynchronize Seg3D::ActionUndo Seg3D::LayerAction

Public Member Functions

virtual ActionInfoHandle get_action_info () const =0
 
std::string get_definition () const
 Get the definition of the action (in XML format)
 
std::string get_type () const
 Get the type of the action.
 
std::string get_usage () const
 Get a usage description.
 
std::string get_key (size_t index) const
 Get the name of the key with a certain index.
 
std::string get_default_key_value (size_t index) const
 Get the name of the key with a certain index.
 
int get_key_index (const std::string &name) const
 Get the index of a certain key.
 
bool is_undoable () const
 Check whether the action is undoable.
 
virtual bool changes_project_data ()
 
virtual bool translate (ActionContextHandle &context)
 
virtual bool validate (ActionContextHandle &context)=0
 
virtual bool run (ActionContextHandle &context, ActionResultHandle &result)=0
 
virtual void clear_cache ()
 
std::string export_to_string () const
 
bool import_from_string (const std::string &action, std::string &error)
 
bool import_from_string (const std::string &action)
 Same as function above, but without the error report.
 

Protected Member Functions

template<class T >
void add_parameter (T &parameter)
 
void add_param (ActionParameterBase *parameter)
 Add a parameter to the internal structure of the action.
 
ActionParameterBaseget_param (size_t index) const
 Retrieve the parameter from the internal structure of the action.
 
const size_t num_params () const
 Number of parameter in this action.
 

Detailed Description

CLASS ACTION: Main class that defines an action in the program An action is not copyable as that would invalidate the ActionParameter pointers used internally.

Member Function Documentation

template<class T >
void Core::Action::add_parameter ( T &  parameter)
inlineprotected

Adding a parameter to the action's internal structure Each parameter should be added using this function in the action's constructor

bool Core::Action::changes_project_data ( )
virtual

Query whether the action changes the data NOTE: This function is overloadable from the default subclass definition. As certain functions like Set, Add, etc, have this property depend on the actual object they operate on. For example setting a layer state variable should change this, whereas a interface variable should not. For these functions the default implementation that picks up this property from the macro can thence be overwritten.

Reimplemented in Core::ActionRotateView.

void Core::Action::clear_cache ( )
virtual

Clear any objects that were given as a short cut to improve performance. NOTE: An action should not contain any persistent handles, as actions may be kept for a provenance record.

Reimplemented in Seg3D::ActionImportLayer, Seg3D::ActionImportSeries, Seg3D::ActionPolyline, Seg3D::ActionExportSegmentation, Seg3D::ActionExportIsosurface, Seg3D::ActionExportLayer, Seg3D::ActionMoveLayer, Seg3D::ActionMigrateSandboxLayer, Seg3D::ActionMoveGroup, Seg3D::ActionCopy, Seg3D::ActionNewMaskLayer, and Seg3D::ActionRecreateLayer.

std::string Core::Action::export_to_string ( ) const

Export the action command into a string, so it can stored The action factory can recreate the action from this string

virtual ActionInfoHandle Core::Action::get_action_info ( ) const
pure virtual

GET_ACTION_INFO: Get the action information class that contains all the information about the action. NOTE: this function is generated using the macro for each function. Hence it does not need to be implemented

bool Core::Action::import_from_string ( const std::string &  action,
std::string &  error 
)

Import an action command from a string. This function is used by the ActionFactory.

virtual bool Core::Action::run ( ActionContextHandle &  context,
ActionResultHandle &  result 
)
pure virtual

Each action needs to have this piece implemented. It spells out how the action is run. It returns whether the action was successful or not. NOTE: In case of an asynchronous action, the return value is ignored and the program relies on report_done() from the context to be triggered when the asynchronous part has finished. In any other case the ActionDispatcher will issue the report_done() when run returns.

Implemented in Seg3D::ActionDilateErodeFilter, Seg3D::ActionIterativeDilateErodeFilter, Seg3D::ActionSmoothDilateErodeFilter, Seg3D::ActionErodeFilter, Seg3D::ActionIterativeErodeFilter, Seg3D::ActionSmoothErodeFilter, Seg3D::ActionIterativeDilateFilter, Seg3D::ActionSmoothDilateFilter, Seg3D::ActionDilateFilter, Seg3D::ActionThresholdSegmentationLSFilter, Seg3D::ActionImportLayer, Seg3D::ActionImportSeries, Seg3D::ActionGradientAnisotropicDiffusionFilter, Seg3D::ActionIntensityCorrectionFilter, Seg3D::ActionExportPoints, Seg3D::ActionCurvatureAnisotropicDiffusionFilter, Seg3D::ActionPolyline, Seg3D::ActionConnectedComponentFilter, Seg3D::ActionHistogramEqualizationFilter, Seg3D::ActionMeanFilter, Seg3D::ActionMedianFilter, Seg3D::ActionResample, Seg3D::ActionExportSegmentation, Seg3D::ActionConfidenceConnectedFilter, Seg3D::ActionMaskDataFilter, Seg3D::ActionGradientMagnitudeFilter, Seg3D::ActionExportIsosurface, Seg3D::ActionExportLayer, Seg3D::ActionImportLargeVolumeLayer, Seg3D::ActionCannyEdgeDetectionFilter, Seg3D::ActionDistanceFilter, Seg3D::ActionFillHolesFilter, Seg3D::ActionOrFilter, Seg3D::ActionPointSetRegisterFilter, Seg3D::ActionRemoveFilter, Seg3D::ActionDiscreteGaussianFilter, Seg3D::ActionXorFilter, Seg3D::ActionNeighborhoodConnectedFilter, Seg3D::ActionOtsuThresholdFilter, Seg3D::ActionDeleteLayers, Seg3D::ActionAndFilter, Seg3D::ActionMigrateSandboxLayer, Seg3D::ActionCopy, Seg3D::ActionExtractDataLayer, Seg3D::ActionArithmeticFilter, Seg3D::ActionConnectedComponentSizeFilter, Seg3D::ActionInvert, Seg3D::ActionGetLayerGroup, Seg3D::ActionMoveLayer, Seg3D::ActionPadFilter, Seg3D::ActionComputeIsosurface, Seg3D::ActionMoveGroup, Seg3D::ActionCrop, Seg3D::ActionTransform, Seg3D::ActionPermute, Seg3D::ActionNewMaskLayer, Seg3D::ActionPointSetTransformFilter, Seg3D::ActionThreshold, Seg3D::ActionSynchronize, Seg3D::ActionAutoSave, Seg3D::ActionSingleThreshold, Seg3D::ActionSaveSession, Seg3D::ActionDeleteIsosurface, Seg3D::ActionDuplicateLayer, Seg3D::ActionRecreateLayer, Seg3D::ActionReportScriptStatus, Seg3D::ActionExportProject, Core::ActionRotateView, Seg3D::ActionCalculateMaskVolume, Seg3D::ActionDeleteSandbox, Seg3D::ActionLoadSession, Seg3D::ActionSaveProjectAs, Seg3D::ActionActivateLayer, Seg3D::ActionBeginScriptStatusReport, Seg3D::ActionNewProject, Seg3D::ActionResetChangesMade, Seg3D::ActionEndScriptStatusReport, Seg3D::ActionShiftActiveLayer, Seg3D::ActionSavePreferences, Seg3D::ActionLoadProject, Seg3D::ActionOpenTool, Seg3D::ActionAddNote, Seg3D::ActionSaveToolPreferences, Seg3D::ActionActivateTool, Seg3D::ActionCloseTool, Seg3D::ActionDeleteSession, Seg3D::ActionCreateSandbox, Seg3D::ActionRedo, Seg3D::ActionUndo, and Core::ActionGet.

bool Core::Action::translate ( ActionContextHandle &  context)
virtual

Some actions need to be translated before they can be validated. Translate takes care of most provenance related issue, by for example translating the provenance information into real action information. This function is called before validate NOTE: This function is not const and may alter the values of the parameters and correct faulty input.

Reimplemented in Seg3D::LayerAction.

virtual bool Core::Action::validate ( ActionContextHandle &  context)
pure virtual

Each action needs to be validated just before it is posted. This way we enforce that every action that hits the main post_action signal will be a valid action to execute. NOTE: This function is not const and may alter the values of the parameters and correct faulty input. Run on the other hand is not allowed to change anything in the action, as it is posted to any observers after the action is validated.

Implemented in Seg3D::ActionDilateErodeFilter, Seg3D::ActionIterativeDilateErodeFilter, Seg3D::ActionSmoothDilateErodeFilter, Seg3D::ActionErodeFilter, Seg3D::ActionIterativeErodeFilter, Seg3D::ActionSmoothErodeFilter, Seg3D::ActionIterativeDilateFilter, Seg3D::ActionSmoothDilateFilter, Seg3D::ActionDilateFilter, Seg3D::ActionThresholdSegmentationLSFilter, Seg3D::ActionGradientAnisotropicDiffusionFilter, Seg3D::ActionIntensityCorrectionFilter, Seg3D::ActionCurvatureAnisotropicDiffusionFilter, Seg3D::ActionImportLayer, Seg3D::ActionImportSeries, Seg3D::ActionConnectedComponentFilter, Seg3D::ActionHistogramEqualizationFilter, Seg3D::ActionMeanFilter, Seg3D::ActionMedianFilter, Seg3D::ActionResample, Seg3D::ActionConfidenceConnectedFilter, Seg3D::ActionMaskDataFilter, Seg3D::ActionGradientMagnitudeFilter, Seg3D::ActionExportPoints, Seg3D::ActionCannyEdgeDetectionFilter, Seg3D::ActionDistanceFilter, Seg3D::ActionPolyline, Seg3D::ActionFillHolesFilter, Seg3D::ActionOrFilter, Seg3D::ActionPointSetRegisterFilter, Seg3D::ActionRemoveFilter, Seg3D::ActionExportSegmentation, Seg3D::ActionDiscreteGaussianFilter, Seg3D::ActionXorFilter, Seg3D::ActionNeighborhoodConnectedFilter, Seg3D::ActionOtsuThresholdFilter, Seg3D::ActionExportIsosurface, Seg3D::ActionExportLayer, Seg3D::ActionImportLargeVolumeLayer, Seg3D::ActionAndFilter, Seg3D::ActionExtractDataLayer, Seg3D::ActionArithmeticFilter, Seg3D::ActionConnectedComponentSizeFilter, Seg3D::ActionInvert, Seg3D::ActionPadFilter, Seg3D::ActionComputeIsosurface, Seg3D::ActionCrop, Seg3D::ActionTransform, Seg3D::ActionDeleteLayers, Seg3D::ActionPermute, Seg3D::ActionMigrateSandboxLayer, Seg3D::ActionNewMaskLayer, Seg3D::ActionCopy, Seg3D::ActionPointSetTransformFilter, Seg3D::ActionGetLayerGroup, Seg3D::ActionMoveLayer, Seg3D::ActionThreshold, Seg3D::ActionMoveGroup, Seg3D::ActionSynchronize, Seg3D::ActionAutoSave, Seg3D::ActionSingleThreshold, Seg3D::ActionSaveSession, Seg3D::ActionDeleteIsosurface, Seg3D::ActionDuplicateLayer, Seg3D::ActionRecreateLayer, Seg3D::ActionReportScriptStatus, Seg3D::ActionExportProject, Core::ActionRotateView, Seg3D::ActionCalculateMaskVolume, Seg3D::ActionDeleteSandbox, Seg3D::ActionLoadSession, Seg3D::ActionSaveProjectAs, Seg3D::ActionActivateLayer, Seg3D::ActionBeginScriptStatusReport, Seg3D::ActionNewProject, Seg3D::ActionResetChangesMade, Seg3D::ActionEndScriptStatusReport, Seg3D::ActionShiftActiveLayer, Seg3D::ActionSavePreferences, Seg3D::ActionLoadProject, Seg3D::ActionOpenTool, Seg3D::ActionAddNote, Seg3D::ActionSaveToolPreferences, Seg3D::ActionActivateTool, Seg3D::ActionCloseTool, Seg3D::ActionDeleteSession, Seg3D::ActionCreateSandbox, Seg3D::ActionRedo, Seg3D::ActionUndo, and Core::ActionGet.


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