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

A helper class for accessing data in a slice of a volume. More...

#include <VolumeSlice.h>

Inheritance diagram for Core::VolumeSlice:
Core::ConnectionHandler Core::RecursiveLockable Core::DataVolumeSlice Core::LargeVolumeSlice Core::MaskVolumeSlice

Public Member Functions

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 ()
 
virtual void upload_texture ()=0
 
virtual VolumeSliceHandle clone ()=0
 Make a copy of the slice, which will share texture object with the original one.
 
Texture2DHandle get_texture ()
 
virtual void set_volume (const VolumeHandle &volume)=0
 Set the volume out of which the slice will be taken.
 
- Public Member Functions inherited from Core::RecursiveLockable
mutex_type & get_mutex () const
 

Static Public Member Functions

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 Member Functions

 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
 

Friends

class VolumeSlicePrivate
 

Additional Inherited Members

- Public Types inherited from Core::RecursiveLockable
typedef boost::recursive_mutex mutex_type
 
typedef boost::unique_lock< mutex_type > lock_type
 
- Protected Types inherited from Core::RecursiveLockable
typedef boost::recursive_mutex mutex_type
 
typedef boost::unique_lock< mutex_type > lock_type
 

Detailed Description

A helper class for accessing data in a slice of a volume.

Constructor & Destructor Documentation

Core::VolumeSlice::VolumeSlice ( const VolumeSlice copy)
protected

NOTE: This is provided for the purpose of taking a snapshot of current status of a VolumeSlice, which will then be used for rendering. The copy constructor shouldn't connect to any signals so its state won't be changed after construction. NOTE: The copy-constructed object will share the same texture object with the old one.

Member Function Documentation

void Core::VolumeSlice::move_slice_to ( double  depth,
bool  fail_safe = false 
)

Move the slice to the specified depth in world space. Returns true if the slice is moved successfully, otherwise false.

virtual void Core::VolumeSlice::upload_texture ( )
pure virtual

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

Implemented in Core::MaskVolumeSlice, Core::DataVolumeSlice, and Core::LargeVolumeSlice.

void Core::VolumeSlice::world_to_index ( double  i_pos,
double  j_pos,
int &  i,
int &  j 
) const

Get the index of the point that's closest to the given position in world space NOTE: the indices returned can be out of the slice boundary.


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