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 Types | |
typedef Core::StateEngine::mutex_type | mutex_type |
typedef Core::StateEngine::lock_type | lock_type |
typedef Layer::filter_key_type | filter_key_type |
typedef std::vector< int > | id_count_type |
Public Member Functions | |
virtual int | get_session_priority () |
void | get_groups (std::vector< LayerGroupHandle > &groups) |
void | get_layers (std::vector< LayerHandle > &layers) |
LayerGroupHandle | find_group (const std::string &group_id) |
LayerGroupHandle | find_group (ProvenanceID provenance_id) |
LayerHandle | find_layer_by_id (const std::string &layer_id, SandboxID sandbox=-1) |
LayerHandle | find_layer_by_name (const std::string &layer_name, SandboxID sandbox=-1) |
LayerHandle | find_layer_by_provenance_id (ProvenanceID provenance_id, SandboxID sandbox=-1) |
DataLayerHandle | find_data_layer_by_id (const std::string &layer_id, SandboxID sandbox=-1) |
MaskLayerHandle | find_mask_layer_by_id (const std::string &layer_id, SandboxID sandbox=-1) |
LayerHandle | get_active_layer () |
void | get_layer_names (std::vector< LayerIDNamePair > &layer_names, int type=Core::VolumeType::ALL_E) |
size_t | get_group_position (LayerGroupHandle group) |
bool | is_sandbox (SandboxID sandbox_id) |
LayerSceneHandle | compose_layer_scene (size_t viewer_id) |
Take an atomic snapshot of visual properties of layers for rendering in the specified viewer. | |
Core::BBox | get_layers_bbox () |
Get the bounding box of all layers. | |
mutex_type & | get_mutex () |
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 Member Functions | |
static LayerHandle | FindLayer (const std::string &layer_id, SandboxID sandbox=-1) |
static LayerHandle | FindLayer (ProvenanceID prov_id, SandboxID sandbox=-1) |
static LayerGroupHandle | FindGroup (const std::string &group_id) |
static LayerGroupHandle | FindGroup (ProvenanceID prov_id) |
static MaskLayerHandle | FindMaskLayer (const std::string &layer_id, SandboxID sandbox=-1) |
static DataLayerHandle | FindDataLayer (const std::string &layer_id, SandboxID sandbox=-1) |
static bool | CheckGroupExistence (const std::string &layer_id, std::string &error) |
static bool | CheckSandboxExistence (SandboxID sandbox, Core::ActionContextHandle context) |
static bool | CheckLayerExistence (const std::string &layer_id, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | CheckLayerExistence (const std::string &layer_id, SandboxID sandbox=-1) |
static bool | CheckLayerExistenceAndType (const std::string &layer_id, Core::VolumeType type, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | CheckLayerSize (const std::string &layer_id1, const std::string &layer_id2, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | CheckLayerAvailabilityForProcessing (const std::string &layer_id, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | CheckLayerAvailabilityForUse (const std::string &layer_id, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | CheckLayerAvailability (const std::string &layer_id, bool replace, Core::ActionContextHandle context, SandboxID sandbox=-1) |
static bool | LockForUse (LayerHandle layer, filter_key_type key=filter_key_type(0)) |
static bool | LockForProcessing (LayerHandle layer, filter_key_type key=filter_key_type(0)) |
static bool | CreateAndLockMaskLayer (Core::GridTransform transform, const std::string &name, LayerHandle &layer, const LayerMetaData &meta_data, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static bool | CreateAndLockDataLayer (Core::GridTransform, const std::string &name, LayerHandle &layer, const LayerMetaData &meta_data, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static bool | CreateCroppedLargeVolumeLayer (Core::LargeVolumeSchemaHandle schema, const Core::GridTransform &crop_trans, const std::string &name, LayerHandle &layer, const LayerMetaData &meta_data, SandboxID sandbox=-1) |
static void | DispatchUnlockLayer (LayerHandle layer, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchDeleteLayer (LayerHandle layer, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchUnlockOrDeleteLayer (LayerHandle layer, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertDataVolumeIntoLayer (DataLayerHandle layer, Core::DataVolumeHandle data, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertMaskVolumeIntoLayer (MaskLayerHandle layer, Core::MaskVolumeHandle mask, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertVolumeIntoLayer (LayerHandle layer, Core::VolumeHandle mask, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertDataSliceIntoLayer (DataLayerHandle layer, Core::DataSliceHandle data, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertDataSlicesIntoLayer (DataLayerHandle layer, std::vector< Core::DataSliceHandle > data, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertMaskSliceIntoLayer (MaskLayerHandle layer, Core::MaskDataSliceHandle mask, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static void | DispatchInsertMaskSlicesIntoLayer (MaskLayerHandle layer, std::vector< Core::MaskDataSliceHandle > mask, ProvenanceID provid, filter_key_type key=filter_key_type(0), SandboxID sandbox=-1) |
static id_count_type | GetLayerIdCount () |
static id_count_type | GetLayerInvalidIdCount () |
static void | SetLayerIdCount (id_count_type id_count) |
Public Attributes | |
Core::StateLabeledOptionHandle | active_layer_state_ |
boost::signals2::signal< void(LayerHandle, bool) > | layer_inserted_signal_ |
boost::signals2::signal< void(std::vector< std::string >, std::vector< std::string >, bool) > | layers_deleted_signal_ |
boost::signals2::signal< void(std::string) > | layers_reordered_signal_ |
boost::signals2::signal< void() > | groups_reordered_signal_ |
boost::signals2::signal< void() > | layers_changed_signal_ |
boost::signals2::signal< void() > | mask_layer_isosurface_created_signal_ |
boost::signals2::signal< void() > | mask_layer_isosurface_deleted_signal_ |
boost::signals2::signal< void(LayerHandle) > | active_layer_changed_signal_ |
boost::signals2::signal< void(std::string, std::string) > | layer_name_changed_signal_ |
boost::signals2::signal< void(LayerHandle) > | layer_volume_changed_signal_ |
boost::signals2::signal< void(LayerHandle) > | layer_data_changed_signal_ |
boost::signals2::signal< void(SandboxID) > | sandbox_created_signal_ |
boost::signals2::signal< void(SandboxID) > | sandbox_deleted_signal_ |
boost::signals2::signal< void(SandboxID, std::string) > | script_begin_signal_ |
boost::signals2::signal< void(SandboxID) > | script_end_signal_ |
boost::signals2::signal< void(SandboxID, std::string, size_t, size_t) > | script_progress_signal_ |
Protected Member Functions | |
virtual bool | pre_save_states (Core::StateIO &state_io) |
virtual bool | post_save_states (Core::StateIO &state_io) |
virtual bool | post_load_states (const Core::StateIO &state_io) |
virtual bool | pre_load_states (const Core::StateIO &state_io) |
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 void | state_changed () |
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 () |
KEY_TYPE: When locking a layer a key is returned. This key keeps track of the asynchronous process and is needed to reinsert a volume into layer. The purpose of the key is to ensure that a volume is only inserted by the asynchronous process if the key matches the one generated when the layer was locked.
|
static |
CHECKGROUPEXISTENCE: Check whether a group exists. If it does not exist, the function returns false and an error is string is returned. TODO: Need to make this one obsolete for provenance reasons everything will have to be done with layerid lists –JGS
|
static |
CHECKLAYERAVAILABILITY: Check whether a layer is available for use. This case processes both of the above cases: if replace is true, it will check for processing (write) access, if it is not replaced, it will look for use (read) access If a layer is not available a notifier is returned that tells can be used to assess when to check for availability again. Even though the notifier may return another process may have grabbed it in the mean time. In that case a new notifier will need to be issued by rechecking availability. NOTE: Availability needs to be tested to ensure that another process is not working on this this layer.
|
static |
CHECKLAYERAVAILABILITYFORPROCESSING: Check whether a layer is available for processing, at the end of the filter the data will be replaced with new data. Hence this is write access. If a layer is not available a notifier is returned that tells can be used to assess when to check for availability again. Even though the notifier may return another process may have grabbed it in the mean time. In that case a new notifier will need to be issued by rechecking availability. NOTE: Availability needs to be tested to ensure that another process is not working on this this layer.
|
static |
CHECKLAYERAVAILABILITYFORUSE: Check whether a layer is available for use, i.e. data is not changed but needs to remain unchanged during the process. Hence this is read access If a layer is not available a notifier is returned that tells can be used to assess when to check for availability again. Even though the notifier may return another process may have grabbed it in the mean time. In that case a new notifier will need to be issued by rechecking availability. NOTE: Availability needs to be tested to ensure that another process is not working on this this layer.
|
static |
CHECKLAYEREXISTENCE: Check whether a layer exists. If it does not exist, the function returns and reports the error in the context
|
static |
Check whether a layer exists. If it does not exist, the function returns false.
|
static |
CHECKLAYEREXISTENCEANDTYPE: Check whether a layer exists and whether it is of the right type. If it does not exist or is not of the right type, the function returns the error in the context.
|
static |
CHECKLAYERSIZE: Check whether a layer has the right size. If it does not have the right size, the function returns false and returns the error in the context.
|
static |
CHECKSANDBOXEXISTENCE: Check whether a sandbox exists. If it does not exist, the function returns false and reports the error in the context .
|
static |
CREATEANDLOCKDATALAYER: Create a new data layer and lock it into the CREATING_C mode. NOTE: This function can only be called from the Application thread.
|
static |
CREATEANDLOCKMASKLAYER: Create a new mask layer and lock it into the CREATING_C mode. NOTE: This function can only be called from the Application thread.
|
static |
Create a cropped version of a large volume. NOTE: This function can only be called from the Application thread.
|
static |
DISPATCHDELETELAYER: Delete the layer. This function will relay a call to the Application thread if needed.
|
static |
DISPATCHINSERTDATASLICEINTOLAYER: Insert a data slice into a data layer.
|
static |
DISPATCHINSERTDATASLICEINTOLAYER: Insert a data slice into a data layer.
|
static |
DISPATCHINSERTDATAVOLUMEINTOLAYER: Insert a data volume into a data layer. This function will relay a call to the Application thread if needed.
|
static |
DISPATCHINSERTMASKSLICEINTOLAYER: Insert a data slice into a data layer.
|
static |
DISPATCHINSERTMASKSLICESINTOLAYER: Insert a data slice into a data layer.
|
static |
DISPATCHINSERTMASKVOLUMEINTOLAYER: Insert a mask volume into a mask layer. This function will relay a call to the Application thread if needed.
|
static |
DISPATCHINSERTVOLUMEINTOLAYER: Insert a mask or data volume into a layer. This function will relay a call to the Application thread if needed.
|
static |
DISPATCHUNLOCKLAYER: Change the layer data_state back to available. This function will relay a call to the Application thread if needed.
|
static |
DISPATCHUNLOCKORDELETELAYER: Unlock layer if valid, delete otherwise. This function will relay a call to the Application thread if needed.
DataLayerHandle Seg3D::LayerManager::find_data_layer_by_id | ( | const std::string & | layer_id, |
SandboxID | sandbox = -1 |
||
) |
GET_DATA_LAYER_BY_ID: this function returns a handle to the layer with the id that is passed. If a sandbox number is given, it searches in that sandbox instead.
LayerGroupHandle Seg3D::LayerManager::find_group | ( | const std::string & | group_id | ) |
FIND_GROUP: this function returns the group with the id that is passed.
LayerGroupHandle Seg3D::LayerManager::find_group | ( | ProvenanceID | provenance_id | ) |
FIND_GROUP: this function returns the group with the provenance id that is passed.
LayerHandle Seg3D::LayerManager::find_layer_by_id | ( | const std::string & | layer_id, |
SandboxID | sandbox = -1 |
||
) |
FIND_LAYER_BY_ID: Find the layer with the given ID. If a sandbox number is given, it searches in that sandbox instead.
LayerHandle Seg3D::LayerManager::find_layer_by_name | ( | const std::string & | layer_name, |
SandboxID | sandbox = -1 |
||
) |
FIND_LAYER_BY_NAME: This function returns a handle to a layer with the name that is passed. If a sandbox number is given, it searches in that sandbox instead.
LayerHandle Seg3D::LayerManager::find_layer_by_provenance_id | ( | ProvenanceID | provenance_id, |
SandboxID | sandbox = -1 |
||
) |
GET_LAYER_BY_PROVENANCE_ID: This function returns a handle to a layer with the provenance id that was given. If a sandbox number is given, it searches in that sandbox instead.
MaskLayerHandle Seg3D::LayerManager::find_mask_layer_by_id | ( | const std::string & | layer_id, |
SandboxID | sandbox = -1 |
||
) |
GET_MASK_LAYER_BY_ID: this function returns a handle to the layer with the id that is passed. If a sandbox number is given, it searches in that sandbox instead.
|
static |
FINDDATALAYER: Find a data layer inside the layer manager
|
static |
FINDGROUP: Find a layer inside the layer manager
|
static |
FINDGROUP: Find a layer inside the layer manager
|
static |
FINDLAYER: Find a layer inside the layer manager
|
static |
FINDLAYER: Find a layer inside the layer manager
|
static |
FINDMASKLAYER: Find a mask layer inside the layer manager
LayerHandle Seg3D::LayerManager::get_active_layer | ( | ) |
GET_ACTIVE_LAYER: This function returns a handle to the active layer Locks: StateEngine
size_t Seg3D::LayerManager::get_group_position | ( | LayerGroupHandle | group | ) |
GET_GROUP_POSITION: Returns the position of the given group.
void Seg3D::LayerManager::get_groups | ( | std::vector< LayerGroupHandle > & | groups | ) |
GET_GROUPS: this function copies the groups into the vector that is passed
void Seg3D::LayerManager::get_layer_names | ( | std::vector< LayerIDNamePair > & | layer_names, |
int | type = Core::VolumeType::ALL_E |
||
) |
GET_LAYER_NAMES: This function returns a vector of layer ID and name pairs of the specified layer type.
void Seg3D::LayerManager::get_layers | ( | std::vector< LayerHandle > & | layers | ) |
GET_LAYERS: Get all layers in top to bottom order.
LayerManager::mutex_type & Seg3D::LayerManager::get_mutex | ( | ) |
GET_MUTEX: Get the mutex, so it can be locked by the interface that is built on top of this
|
inlinevirtual |
Returns the session priority of the state handler. State handlers with higher priorities gets loaded earlier than those with lower priorities. By default this functions returns -1, which means that the state handler won't be saved/loaded by the state engine.
Reimplemented from Core::StateHandler.
|
static |
GETLAYERIDCOUNT: Get the current count of the group and layer ids
|
static |
GETLAYERINVALIDIDCOUNT: Get a default id count that has no valid ids.
bool Seg3D::LayerManager::is_sandbox | ( | SandboxID | sandbox_id | ) |
IS_SANDBOX: Check whether the given sandbox ID is valid. NOTE: -1 is considered valid because it represents the normal context.
|
static |
LOCKFORPROCESSING: Change the layer data_state to PROCESSING_C. NOTE: This function can only be called from the Application thread.
|
static |
LOCKFORUSE: Change the layer data_state to IN_USE_C. NOTE: This function can only be called from the Application thread.
|
protectedvirtual |
POST_LOAD_STATES: this function creates the layers who's information was saved to file, and then tells them to populate their state variables from file
Reimplemented from Core::StateHandler.
|
protectedvirtual |
POST_SAVE_STATES: This function is called after the LayerManager's states have been saved and then tells the groups to save their states as well.
Reimplemented from Core::StateHandler.
|
protectedvirtual |
PRE_LOAD_STATES: this function clears out all existing layers before we load a project from file
Reimplemented from Core::StateHandler.
|
protectedvirtual |
PRE_SAVE_STATES: This function is called before the LayerManager's states are being saved
Reimplemented from Core::StateHandler.
|
static |
SETLAYERIDCOUNT: Set the current count of group and layer NOTE: This function should only be called by the undo buffer
boost::signals2::signal< void ( LayerHandle ) > Seg3D::LayerManager::active_layer_changed_signal_ |
ACTIVE_LAYER_CHANGED_SIGNAL: This signal is triggered after the active layer is changed
boost::signals2::signal< void () > Seg3D::LayerManager::groups_reordered_signal_ |
GROUPS_REORDERED_SIGNAL: Triggered when layer groups have been reordered.
boost::signals2::signal< void ( LayerHandle ) > Seg3D::LayerManager::layer_data_changed_signal_ |
LAYER_DATA_CHANGED_SIGNAL: Triggered when the layer data state is changed. This tracks whether layers are being locked for processing and when new data will be available
boost::signals2::signal< void ( LayerHandle, bool ) > Seg3D::LayerManager::layer_inserted_signal_ |
LAYER_INSERTED_SIGNAL: Triggered after a layer has been inserted. The first parameter is the new layer. The second parameter indicates whether a new group has been created.
boost::signals2::signal< void ( std::string, std::string ) > Seg3D::LayerManager::layer_name_changed_signal_ |
LAYER_NAME_CHANGED_SIGNAL: Triggered when the name of a layer has changed. The first parameter is the layer ID, the second is the new name for that layer.
boost::signals2::signal< void ( LayerHandle ) > Seg3D::LayerManager::layer_volume_changed_signal_ |
LAYER_VOLUME_CHANGED_SIGNAL: Triggered when the volume of a layer has changed. The first parameter is the layer handle.
boost::signals2::signal< void() > Seg3D::LayerManager::layers_changed_signal_ |
LAYERS_CHANGED_SIGNAL: Triggered when layers are inserted, deleted, or reordered. It is a combination of layer_inserted_signal_, layers_deleted_signal_, layers_reordered_signal_, and groups_reordered_signal_. NOTE: It is always triggered after the individual ones.
boost::signals2::signal< void ( std::vector< std::string >, std::vector< std::string >, bool ) > Seg3D::LayerManager::layers_deleted_signal_ |
LAYERS_DELETED_SIGNAL: Triggered after layers have been deleted. The first parameter is a vector of deleted layer IDs. The second parameter is a vector of group IDs from which the layers have been deleted. The third parameter indicates whether any group has been deleted.
boost::signals2::signal< void ( std::string ) > Seg3D::LayerManager::layers_reordered_signal_ |
LAYERS_REORDERED_SIGNAL: Triggered when the order of the layers has been changed. The parameter is the ID of the group whose layers have been reordered.
boost::signals2::signal< void() > Seg3D::LayerManager::mask_layer_isosurface_created_signal_ |
MASK_LAYER_ISOSURFACE_CREATED_SIGNAL: Triggered when isosurface is created.
boost::signals2::signal< void() > Seg3D::LayerManager::mask_layer_isosurface_deleted_signal_ |
MASK_LAYER_ISOSURFACE_DELETED_SIGNAL: Triggered when isosurface is deleted.
boost::signals2::signal< void ( SandboxID ) > Seg3D::LayerManager::sandbox_created_signal_ |
SANDBOX_CREATED_SIGNAL_: Triggered when a sandbox has been created.
boost::signals2::signal< void ( SandboxID ) > Seg3D::LayerManager::sandbox_deleted_signal_ |
SANDBOX_DELETED_SIGNAL_: Triggered when a sandbox has been deleted.
boost::signals2::signal< void ( SandboxID, std::string ) > Seg3D::LayerManager::script_begin_signal_ |
SCRIPT_BEGIN_SIGNAL: Indicate the beginning of a script. The first parameter is sandbox in which the script is running, the second parameter is the the script name. NOTE: The sandbox can be used to uniquely identify a running script.
boost::signals2::signal< void ( SandboxID ) > Seg3D::LayerManager::script_end_signal_ |
SCRIPT_END_SIGNAL: Indicate the end of a script. The parameter is the sandbox in which the script is running.
boost::signals2::signal< void ( SandboxID, std::string, size_t, size_t ) > Seg3D::LayerManager::script_progress_signal_ |
SCRIPT_PROGRESS_SIGNAL: Report the progress of a script. The first parameter is the sandbox in which the script is running. The second parameter is the name of the current running step. The third parameter is the number of steps that have finished. The fourth parameter is the total number of steps.