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 boost::signals2::signal< void(SessionInfoListHandle) > | session_list_signal_type |
typedef boost::signals2::signal< void(ProjectNoteListHandle) > | note_list_signal_type |
typedef boost::signals2::signal< void(ProvenanceTrailHandle) > | provenance_trail_signal_type |
Public Types inherited from Core::RecursiveLockable | |
typedef boost::recursive_mutex | mutex_type |
typedef boost::unique_lock< mutex_type > | lock_type |
Public Member Functions | |
Project (const std::string &project_name="New Project") | |
Project (const boost::filesystem::path &project_file) | |
bool | save_project (const boost::filesystem::path &project_path, const std::string &project_name, bool anonymize) |
bool | save_state () |
bool | load_session (SessionID session_id) |
bool | load_last_session () |
bool | save_session (const std::string &name) |
bool | delete_session (SessionID session_id) |
bool | is_session (SessionID session_id) |
bool | get_session_info (SessionID session_id, SessionInfo &session_info) |
void | request_session_list () |
bool | export_project (const boost::filesystem::path &project_path, const std::string &project_name, long long session_id) |
bool | check_project_files () |
boost::filesystem::path | get_project_data_path () const |
boost::filesystem::path | get_project_sessions_path () const |
boost::filesystem::path | get_project_inputfiles_path () const |
bool | find_cached_file (const boost::filesystem::path &filename, InputFilesID inputfiles_id, boost::filesystem::path &cached_filename) const |
bool | add_note (const std::string ¬e) |
void | request_note_list () |
bool | get_need_anonymize () |
void | set_need_anonymize (bool enable) |
void | reset_project_changed () |
bool | check_project_changed () |
boost::posix_time::ptime | get_last_saved_session_time_stamp () const |
ProvenanceStepID | add_provenance_record (const ProvenanceStepHandle &step) |
bool | delete_provenance_record (ProvenanceStepID record_id) |
void | update_provenance_record (ProvenanceStepID record_id, const ProvenanceStepHandle &prov_step) |
void | request_provenance_trail (ProvenanceID prov_id) |
ProvenanceTrailHandle | get_provenance_trail (const std::vector< ProvenanceID > &prov_ids) |
void | add_generation_number (const long long generation_number) |
bool | execute_or_add_inputfiles_importer (const InputFilesImporterHandle &importer) |
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. | |
Public Member Functions inherited from Core::RecursiveLockable | |
mutex_type & | get_mutex () const |
Static Public Member Functions | |
static std::string | GetDefaultProjectPathExtension () |
static std::string | GetDefaultProjectFileExtension () |
static std::vector< std::string > | GetProjectPathExtensions () |
static std::vector< std::string > | GetProjectFileExtensions () |
Public Attributes | |
Core::StateStringHandle | project_name_state_ |
The name of the project. | |
Core::StateStringHandle | project_file_state_ |
The filename that contains the project information. | |
Core::StateStringHandle | project_path_state_ |
Path of the current project. | |
Core::StateBoolHandle | project_files_generated_state_ |
Whether the project has been generated on disk. | |
Core::StateBoolHandle | project_files_accessible_state_ |
Core::StateLongLongHandle | project_size_state_ |
The size of the directory that is used for this project. | |
Core::StateStringHandle | current_session_name_state_ |
Core::StateBoolHandle | save_custom_colors_state_ |
This state variable is used to save the colors of a session. | |
std::vector< Core::StateColorHandle > | color_states_ |
The colors for the project. | |
Core::StateStringVectorHandle | project_notes_state_ |
Core::StateLongLongHandle | inputfiles_count_state_ |
Core::StateLongLongHandle | generation_count_state_ |
Core::StateLongLongHandle | provenance_count_state_ |
Core::StateStringVectorHandle | sessions_state_ |
session_list_signal_type | session_list_changed_signal_ |
note_list_signal_type | note_list_changed_signal_ |
provenance_trail_signal_type | provenance_trail_signal_ |
boost::signals2::signal< void() > | project_data_changed_signal_ |
Protected Member Functions | |
virtual bool | pre_save_states (Core::StateIO &state_io) |
virtual bool | post_load_states (const 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_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 () |
typedef boost::signals2::signal< void ( ProjectNoteListHandle ) > Seg3D::Project::note_list_signal_type |
NOTE_LIST_CHANGED_SIGNAL: Signals the current list of notes.
typedef boost::signals2::signal< void( ProvenanceTrailHandle ) > Seg3D::Project::provenance_trail_signal_type |
PROVENANCE_TRAIL_SIGNAL: This signal is triggered when a new provenance record is added, or when the 'request_provenance_trail' function is called.
typedef boost::signals2::signal< void( SessionInfoListHandle ) > Seg3D::Project::session_list_signal_type |
SESSION_LIST_CHANGED_SIGNAL When a session is saved or deleted this signal is triggered NOTE: This one is used by the User Interface
void Seg3D::Project::add_generation_number | ( | const long long | generation_number | ) |
ADD_GENERATION_NUMBER: Tell the project which generation numbers are part of the project
bool Seg3D::Project::add_note | ( | const std::string & | note | ) |
ADD_NOTE: Add a new note to project.
ProvenanceStepID Seg3D::Project::add_provenance_record | ( | const ProvenanceStepHandle & | step | ) |
ADD_PROVENANCE_RECORD: Add the provenance step to the database and return the ID of the new record.
bool Seg3D::Project::check_project_changed | ( | ) |
CHECK_PROJECT_CHANGED: Check whether the project was changed NOTE: This function can be called from any thread
bool Seg3D::Project::check_project_files | ( | ) |
CHECK_PROJECT_FILES: Check whether the project files still exist NOTE: This function can only be called from the application thread. It is intended for the validate state of the project actions.
bool Seg3D::Project::delete_provenance_record | ( | ProvenanceStepID | record_id | ) |
DELETE_PROVENANCE_RECORD: Delete the specified provenance record.
bool Seg3D::Project::delete_session | ( | SessionID | session_id | ) |
DELETE_SESSION: This function will be called by the project manager to delete a session NOTE: This function can only can called from the application thread.
bool Seg3D::Project::execute_or_add_inputfiles_importer | ( | const InputFilesImporterHandle & | importer | ) |
Add a file list of files to import to the project and execute if it already resides on disk. If the project is not saved yet, copying will be delayed until the project will be saved to disk.
bool Seg3D::Project::export_project | ( | const boost::filesystem::path & | project_path, |
const std::string & | project_name, | ||
long long | session_id | ||
) |
EXPORT_PROJECT: This function will export the current project and the passed vector of session names to file NOTE: This function can only can called from the application thread.
bool Seg3D::Project::find_cached_file | ( | const boost::filesystem::path & | filename, |
InputFilesID | inputfiles_id, | ||
boost::filesystem::path & | cached_filename | ||
) | const |
FIND_CACHED_FILE Find a cached file in the project
boost::posix_time::ptime Seg3D::Project::get_last_saved_session_time_stamp | ( | ) | const |
GET_LAST_SAVED_SESSION_TIME_STAMP: When was the last session saved
bool Seg3D::Project::get_need_anonymize | ( | ) |
GET_NEED_ANONYMIZE: Whether data needs to be anonymized on the next save
boost::filesystem::path Seg3D::Project::get_project_data_path | ( | ) | const |
GET_PROJECT_DATA_PATH: Get the data path of this project
boost::filesystem::path Seg3D::Project::get_project_inputfiles_path | ( | ) | const |
GET_PROJECT_INPUTFILES_PATH: Get the input files path of this project
boost::filesystem::path Seg3D::Project::get_project_sessions_path | ( | ) | const |
GET_PROJECT_SESSION_PATH: Get the session path of this project
ProvenanceTrailHandle Seg3D::Project::get_provenance_trail | ( | const std::vector< ProvenanceID > & | prov_ids | ) |
GET_PROVENANCE_TRAIL: Get the provenance trail of the given provenance ID. NOTE: This function can only be called on the application thread.
bool Seg3D::Project::get_session_info | ( | SessionID | session_id, |
SessionInfo & | session_info | ||
) |
GET_SESSION_INFO: Query the information of a given session. Returns true on success, otherwise false.
|
protectedvirtual |
GET_VERSION: Get the version number of the project file.
Reimplemented from Core::StateHandler.
|
static |
GETDEFAUTLPROEJCTFILEEXTENSION Get the extension of the project file itself
|
static |
GETDEFAULTPROJECTPATHEXTENSION Get the extension that the project directories get
|
static |
GETPROJECTFILEEXTENSION Get all the possible project file extensions that we read
|
static |
GETPROJECTPATHEXTENSION Get all the possible project extensions that we read
bool Seg3D::Project::is_session | ( | SessionID | session_id | ) |
IS_SESSION: Function for validating that a session name exists NOTE: This function can only can called from the application thread.
bool Seg3D::Project::load_last_session | ( | ) |
LOAD_LAST_SESSION: Load the last saved session.
bool Seg3D::Project::load_session | ( | SessionID | session_id | ) |
LOAD_SESSION: This function will be called to load a specific session NOTE: This function can only can called from the application thread.
|
protectedvirtual |
POST_LOAD_STATES: this function sets Seg3d's mask colors if they are set to be saved with the project
Reimplemented from Core::StateHandler.
|
protectedvirtual |
PRE_SAVE_STATES: this function synchronizes the colors if they are set to be saved with the project
Reimplemented from Core::StateHandler.
void Seg3D::Project::request_note_list | ( | ) |
REQUEST_NOTE_LIST: Request a list of all the notes. This would trigger the note_list_changed_signal_ in the application thread.
void Seg3D::Project::request_provenance_trail | ( | ProvenanceID | prov_id | ) |
REQUEST_PROVENANCE_RECORD: Request the provenance_trail_signal_ to be triggered with the provenance trail of the given provenance ID.
void Seg3D::Project::request_session_list | ( | ) |
REQUEST_SESSION_LIST: Request a list of all the sessions. This would trigger the session_list_changed_signal_ in the application thread.
void Seg3D::Project::reset_project_changed | ( | ) |
RESET_PROJECT_CHANGED: Reset the flag that remembers that a session has changed NOTE: This is called by saving a session.
bool Seg3D::Project::save_project | ( | const boost::filesystem::path & | project_path, |
const std::string & | project_name, | ||
bool | anonymize | ||
) |
SAVE_PROJECT: This function will save the current project in the designated path If anonymize is true then patient-specific data will be removed when saving the project. NOTE: path already points to the project directory NOTE: This function can only be called from the application thread.
bool Seg3D::Project::save_session | ( | const std::string & | name | ) |
SAVE_SESSION: This function will be called from the project manager to save a session NOTE: This function can only can called from the application thread.
bool Seg3D::Project::save_state | ( | ) |
SAVE_STATE: Save the current state into the xml file
void Seg3D::Project::set_need_anonymize | ( | bool | enable | ) |
SET_NEED_ANONYMIZE: Whether data needs to be anonymized on the next save
void Seg3D::Project::update_provenance_record | ( | ProvenanceStepID | record_id, |
const ProvenanceStepHandle & | prov_step | ||
) |
UPDATE_PROVENANCE_RECORD: Update the provenance record with new information.
Core::StateStringHandle Seg3D::Project::current_session_name_state_ |
The name that is shown in the widget for saving a session NOTE: The next session will have this name.
Core::StateLongLongHandle Seg3D::Project::generation_count_state_ |
Generation counter state, this one is filled out when the project is saved NOTE: We need to save this one, to ensure that new additions to the project will have unique generation number.
Core::StateLongLongHandle Seg3D::Project::inputfiles_count_state_ |
This state variable keeps track of the unique ids for each input file NOTE: We need to save this one, to ensure that new additions to the project will have unique inputfiles number.
boost::signals2::signal< void () > Seg3D::Project::project_data_changed_signal_ |
PROJECT_DATA_CHANGED_SIGNAL: Triggered when the project data has changed.
Core::StateLongLongHandle Seg3D::Project::provenance_count_state_ |
Provenance counter state, this one is filled out when the project is saved NOTE: We need to save this one, to ensure that new additions to the project will have unique provenance numbers.
Core::StateStringVectorHandle Seg3D::Project::sessions_state_ |
== old state variable not used any more == NOTE: This one is maintained for backwards compatibility only