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 | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Seg3D::Layer Class Referenceabstract

#include <Layer.h>

Inheritance diagram for Seg3D::Layer:
Core::StateHandler Core::ConnectionHandler Seg3D::DataLayer Seg3D::LargeVolumeLayer Seg3D::MaskLayer

Public Types

typedef boost::signals2::signal< void(double) > update_progress_signal_type
 
typedef boost::signals2::signal< void() > layer_updated_signal_type
 
typedef boost::signals2::signal< void() > abort_signal_type
 
typedef boost::signals2::signal< void() > stop_signal_type
 
typedef long long filter_key_type
 
typedef Core::StateEngine::mutex_type mutex_type
 This code just aligns the layer locking with the StateEngine locking.
 
typedef Core::StateEngine::lock_type lock_type
 

Public Member Functions

virtual Core::VolumeType get_type () const =0
 
virtual size_t get_byte_size () const =0
 
virtual Core::GridTransform get_grid_transform () const =0
 
virtual void set_grid_transform (const Core::GridTransform &grid_transform, bool preserve_centering)=0
 
virtual Core::DataType get_data_type () const =0
 
virtual Core::VolumeHandle get_volume () const =0
 
virtual bool has_valid_data () const =0
 
virtual LayerHandle duplicate () const =0
 
void update_progress (double amount, double progress_start=0.0f, double progress_amount=1.0f)
 
bool is_visible (size_t viewer_id) const
 
LayerGroupHandle get_layer_group ()
 
void set_layer_group (LayerGroupWeakHandle layer_group)
 
std::string get_layer_id () const
 
std::string get_layer_name () const
 
Core::DataBlock::generation_type get_generation () const
 
LayerMetaData get_meta_data () const
 
void set_meta_data (const LayerMetaData &meta_data)
 
bool check_abort ()
 
void reset_abort ()
 
bool check_stop ()
 
void reset_stop ()
 
bool check_filter_key (filter_key_type key) const
 
void add_filter_key (filter_key_type key)
 
void remove_filter_key (filter_key_type key)
 
void clear_filter_keys ()
 
size_t num_filter_keys () const
 
void set_filter_handle (LayerAbstractFilterHandle layer)
 
void reset_filter_handle ()
 
LayerAbstractFilterHandle get_filter_handle ()
 
void set_allow_stop ()
 
void reset_allow_stop ()
 
- 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 mutex_typeGetMutex ()
 
static filter_key_type GenerateFilterKey ()
 

Public Attributes

update_progress_signal_type update_progress_signal_
 
layer_updated_signal_type layer_updated_signal_
 
abort_signal_type abort_signal_
 
stop_signal_type stop_signal_
 
Core::StateNameHandle name_state_
 The name of the layer.
 
std::vector< Core::StateBoolHandle > visible_state_
 Per viewer state of whether this layer is visible.
 
Core::StateBoolHandle master_visible_state_
 Master state of the layer visibility.
 
Core::StateBoolHandle locked_state_
 State indicating whether the layer is locked.
 
Core::StateRangedDoubleHandle opacity_state_
 State that describes the opacity with which the layer is displayed.
 
Core::StateOptionHandle data_state_
 State that stores the current layer state.
 
Core::StateBoolHandle show_information_state_
 Whether to show the layer information.
 
Core::StateBoolHandle show_appearance_state_
 Whether to show the layer information.
 
Core::StateBoolHandle show_advanced_visibility_state_
 Whether to show the layer information.
 
Core::StateBoolHandle show_opacity_state_
 Whether to show the opacity control.
 
Core::StateBoolHandle show_progress_bar_state_
 Whether to show the progress bar.
 
Core::StateBoolHandle show_abort_message_state_
 Whether to show the abort message.
 
Core::StateBoolHandle show_stop_button_state_
 Whether to show the stop button.
 
Core::BooleanStateGroupHandle gui_state_group_
 An exclusive group of boolean states that control the visibility of different parts.
 
Core::StateLongLongHandle provenance_id_state_
 State that keeps track of the provenance number. More...
 
Core::StateStringHandle meta_data_state_
 State of the MetaData associated with this layer.
 
Core::StateStringHandle meta_data_info_state_
 State variable that keeps track of what type of meta data was provided by the importer.
 
Core::StateStringHandle centering_state_
 Centering (node vs. cell) is stored per layer for all layers (mask and data)
 

Static Public Attributes

static const std::string CREATING_C
 
static const std::string PROCESSING_C
 
static const std::string AVAILABLE_C
 
static const std::string IN_USE_C
 

Protected Member Functions

 Layer (const std::string &name, bool creating=false)
 
 Layer (const std::string &name, const std::string &state_id, bool creating=false)
 
virtual bool post_save_states (Core::StateIO &state_io)
 
virtual int get_version ()
 
- 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 void state_changed ()
 
virtual int get_session_priority ()
 
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 ()
 

Protected Attributes

Core::StateLongLongHandle generation_state_
 State that stores the generation of its datablock.
 

Friends

class LayerPrivate
 

Detailed Description

CLASS Layer This is the main class for collecting state information on a layer

Member Typedef Documentation

typedef boost::signals2::signal< void() > Seg3D::Layer::abort_signal_type

ABORT_SIGNAL: Trigger an abort signal for the current filter

typedef long long Seg3D::Layer::filter_key_type

FILTER_KEY: This is a unique key that is inserted when an asynchronous filter is running. The asynchronous calls back to the layer are compared with the key, if they don't match the layer is not modified, and it is assumed that the filtering was aborted.

typedef boost::signals2::signal< void () > Seg3D::Layer::layer_updated_signal_type

LAYER_UPDATED_SIGNAL: Triggered when the layer data has been modified.

typedef boost::signals2::signal< void() > Seg3D::Layer::stop_signal_type

STOP_SIGNAL: Trigger a stop filtering signal for the current filter

typedef boost::signals2::signal< void (double) > Seg3D::Layer::update_progress_signal_type

UPDATE_PROGRESS_SIGNAL: When new information on progress is available this signal is triggered. If this signal is triggered it should end with a value 1.0 indicating that progress reporting has finished. Progress is measured between 0.0 and 1.0.

Member Function Documentation

void Seg3D::Layer::add_filter_key ( filter_key_type  key)

ADD_FILTER_KEY: Add a filter key to the layer

bool Seg3D::Layer::check_abort ( )

CHECK_ABORT: Check whether the abort flag was set. NOTE: By default the default flag is set to false. However when the abort signal of the layer is triggered the abort flag is set. It can only be unset by calling reset_abort().

bool Seg3D::Layer::check_filter_key ( filter_key_type  key) const

CHECK_FILTER_KEY: Check whether the current key is attached to the layer

bool Seg3D::Layer::check_stop ( )

CHECK_STOP: Check whether the stop flag was set. NOTE: By default the default flag is set to false. However when the stop signal of the layer is triggered the stop flag is set. It can only be unset by calling reset_stop().

void Seg3D::Layer::clear_filter_keys ( )

CLEAR_FILTER_KEYS: Remove all filter keys

virtual LayerHandle Seg3D::Layer::duplicate ( ) const
pure virtual

DUPLICATE_LAYER: Duplicate layer

Implemented in Seg3D::LargeVolumeLayer, Seg3D::MaskLayer, and Seg3D::DataLayer.

virtual size_t Seg3D::Layer::get_byte_size ( ) const
pure virtual

GET_BYTE_SIZE: Get the size of the data contained in the layer in bytes

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

virtual Core::DataType Seg3D::Layer::get_data_type ( ) const
pure virtual

GET_DATA_TYPE: Get the data type of the underlying data

Implemented in Seg3D::LargeVolumeLayer, Seg3D::MaskLayer, and Seg3D::DataLayer.

LayerAbstractFilterHandle Seg3D::Layer::get_filter_handle ( )

GET_FITLER_HANDLE: Get the current filter associated with the layer

Core::DataBlock::generation_type Seg3D::Layer::get_generation ( ) const

GET_GENERATION: Get the generation of the current data block

virtual Core::GridTransform Seg3D::Layer::get_grid_transform ( ) const
pure virtual

GET_GRID_TRANSFORM: Get the transform of the layer Locks: StateEngine

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

LayerGroupHandle Seg3D::Layer::get_layer_group ( )

GET_LAYER_GROUP: Get a handle to the group this layer belongs to

std::string Seg3D::Layer::get_layer_id ( ) const

GET_LAYER_ID: Get the id of this layer

std::string Seg3D::Layer::get_layer_name ( ) const

GET_LAYER_NAME: Get the name of the layer

LayerMetaData Seg3D::Layer::get_meta_data ( ) const

GET_METADATA: Retrieve all the meta data that was part of this layer in one convenient structure

virtual Core::VolumeType Seg3D::Layer::get_type ( ) const
pure virtual

GET_TYPE Get the type of the layer

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

int Seg3D::Layer::get_version ( )
protectedvirtual

GET_VERSION: Get the version number of the project file.

Reimplemented from Core::StateHandler.

virtual Core::VolumeHandle Seg3D::Layer::get_volume ( ) const
pure virtual

GET_VOLUME: Get the underlying volume.

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

Layer::mutex_type & Seg3D::Layer::GetMutex ( )
static

GETMUTEX: Get the mutex of the state engine

virtual bool Seg3D::Layer::has_valid_data ( ) const
pure virtual

HAS_VALID_DATA: Check whether the layer has valid data

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

bool Seg3D::Layer::is_visible ( size_t  viewer_id) const

IS_VISIBLE: Returns true if the layer is visible in the specified viewer, otherwise false;

size_t Seg3D::Layer::num_filter_keys ( ) const

NUM_FILTER_KEYS: Get the number of filter keys

bool Seg3D::Layer::post_save_states ( Core::StateIO state_io)
protectedvirtual

POST_SAVE_STATES: This virtual function can be implemented in the StateHandlers and will be called after its states are saved. If it doesn't succeed it needs to return false.

Reimplemented from Core::StateHandler.

void Seg3D::Layer::remove_filter_key ( filter_key_type  key)

REMOVE_FILTER_KEY: Reset the current key for what is being processed

void Seg3D::Layer::reset_abort ( )

RESET_ABORT: Reset the abort flag to false. NOTE: Call this function before running the filter that will trigger the abort_signal

void Seg3D::Layer::reset_allow_stop ( )

RESET_ALLOW_STOP: Reset the flag that allows stopping the filter

void Seg3D::Layer::reset_filter_handle ( )

RESET_FILTER_HANDLE: Reset the filter handle, indicating no filter it working on the data

void Seg3D::Layer::reset_stop ( )

RESET_STOP: Reset the stop flag to false. NOTE: Call this function before running the filter that will trigger the stop_signal

void Seg3D::Layer::set_allow_stop ( )

SET_ALLOW_STOP: Allow stopping the filter on the next iteration

void Seg3D::Layer::set_filter_handle ( LayerAbstractFilterHandle  layer)

SET_FILTER_HANDLE: Set the filter that is currently processing the data

virtual void Seg3D::Layer::set_grid_transform ( const Core::GridTransform grid_transform,
bool  preserve_centering 
)
pure virtual

SET_GRID_TRANSFORM: Set the transform of the layer

Implemented in Seg3D::MaskLayer, Seg3D::LargeVolumeLayer, and Seg3D::DataLayer.

void Seg3D::Layer::set_layer_group ( LayerGroupWeakHandle  layer_group)

SET_LAYER_GROUP: Set the group this layer is contained within

void Seg3D::Layer::set_meta_data ( const LayerMetaData meta_data)

SET_METADATA: Set all the metadata state variables

void Seg3D::Layer::update_progress ( double  amount,
double  progress_start = 0.0f,
double  progress_amount = 1.0f 
)

UPDATE_PROGRESS: Update the progress bar associated with this layer

Member Data Documentation

Core::StateLongLongHandle Seg3D::Layer::provenance_id_state_

State that keeps track of the provenance number.

Information needed to keep track of where the data came from and how to handle provenance


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