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 | Public Attributes | List of all members
Core::MaskVolumeSlice Class Reference
Inheritance diagram for Core::MaskVolumeSlice:
Core::VolumeSlice Core::ConnectionHandler Core::RecursiveLockable

Public Types

typedef boost::signals2::signal< void() > cache_updated_signal_type
 Triggered when the cache has been updated.
 
- Public Types inherited from Core::RecursiveLockable
typedef boost::recursive_mutex mutex_type
 
typedef boost::unique_lock< mutex_type > lock_type
 

Public Member Functions

 MaskVolumeSlice (const MaskVolumeHandle &mask_volume, VolumeSliceType type=VolumeSliceType::AXIAL_E, size_t slice_num=0)
 
 MaskVolumeSlice (const MaskVolumeSlice &copy)
 
bool get_mask_at (size_t i, size_t j) const
 
void set_mask_at (size_t i, size_t j)
 
void clear_mask_at (size_t i, size_t j)
 
virtual void upload_texture ()
 
virtual VolumeSliceHandle clone ()
 Make a copy of the slice, which will share texture object with the original one.
 
virtual void set_volume (const VolumeHandle &volume)
 Set the volume out of which the slice will be taken.
 
MaskDataBlockHandle get_mask_data_block () const
 Return a handle to the underlying mask data block.
 
unsigned char * get_cached_data ()
 Return a pointer to the cached data of the current slice.
 
void release_cached_data ()
 Sync the cached data back to the mask volume and then release the memory.
 
void copy_slice_data (std::vector< unsigned char > &buffer, bool invert=false) const
 Copy the mask data of current slice into the buffer.
 
void copy_slice_data (unsigned char *buffer, bool invert=false) const
 Copy the mask data of current slice into the buffer.
 
void set_slice_data (const unsigned char *buffer, bool trigger_update=false)
 Replace the data of the slice with the content of the buffer.
 
- Public Member Functions inherited from Core::VolumeSlice
bool is_valid () const
 Returns true if the underlying volume is valid and the slice is not out of boundary.
 
VolumeHandle get_volume () const
 
VolumeType volume_type () const
 
void set_slice_type (VolumeSliceType type)
 
VolumeSliceType get_slice_type () const
 
void set_slice_number (size_t slice_num)
 
size_t get_slice_number () const
 
void to_index (size_t i, size_t j, Point &index) const
 Get the index of the point in the volume.
 
size_t to_index (size_t i, size_t j) const
 Returns the linear index of the point in the volume.
 
void world_to_index (double i_pos, double j_pos, int &i, int &j) const
 
void index_to_world (int i, int j, double &world_i, double &world_j) const
 
void get_world_coord (double i_pos, double j_pos, Point &world_coord) const
 Get the 3D world coordinate of the point.
 
void project_onto_slice (const Point &pt, double &i_pos, double &j_pos) const
 Project a point in 3D space onto the plane of the slice.
 
void project_onto_slice (const Point &pt, double &i_pos, double &j_pos, double &depth) const
 Project a point in 3D space onto the plane of the slice. Return depth by reference.
 
int get_closest_slice (const Point &pt) const
 Return the slice number that's closest to the point in 3D space.
 
void move_slice_to (const Point &pos, bool fail_safe=false)
 
void move_slice_to (double depth, bool fail_safe=false)
 
size_t nx () const
 
size_t ny () const
 
size_t number_of_slices () const
 
bool out_of_boundary () const
 
double left () const
 
double right () const
 
double bottom () const
 
double top () const
 
double depth () const
 
const Pointbottom_left () const
 
const Pointbottom_right () const
 
const Pointtop_left () const
 
const Pointtop_right () const
 
void handle_volume_updated ()
 
Point apply_grid_transform (const Point &pt) const
 
Point apply_inverse_grid_transform (const Point &pt) const
 
virtual void initialize_texture ()
 
Texture2DHandle get_texture ()
 
- Public Member Functions inherited from Core::RecursiveLockable
mutex_type & get_mutex () const
 

Public Attributes

cache_updated_signal_type cache_updated_signal_
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::VolumeSlice
static void ProjectOntoSlice (VolumeSliceType slice_type, const Point &pt, double &i_pos, double &j_pos)
 
static void ProjectOntoSlice (VolumeSliceType slice_type, const Point &pt, double &i_pos, double &j_pos, double &depth)
 
- Protected Types inherited from Core::RecursiveLockable
typedef boost::recursive_mutex mutex_type
 
typedef boost::unique_lock< mutex_type > lock_type
 
- Protected Member Functions inherited from Core::VolumeSlice
 VolumeSlice (const VolumeHandle &volume, VolumeSliceType type, size_t slice_num)
 
 VolumeSlice (const VolumeSlice &copy)
 
bool get_slice_changed ()
 
void set_slice_changed (bool)
 
bool get_size_changed ()
 
void set_size_changed (bool)
 
- 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 Member Functions inherited from Core::RecursiveLockable
mutex_type & get_mutex () const
 

Constructor & Destructor Documentation

Core::MaskVolumeSlice::MaskVolumeSlice ( const MaskVolumeSlice copy)

NOTE: This is only used by the renderer to take a snapshot of the original slice. The copy constructed object shares the same texture object and cache with the original one.

Member Function Documentation

void Core::MaskVolumeSlice::upload_texture ( )
virtual

Upload the mask slice to graphics texture. NOTE: This function allocates resources on the GPU, so the caller should acquire a lock on the RenderResources before calling this function.

Implements Core::VolumeSlice.


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