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

Public Types

typedef boost::signals2::signal< void(double) > update_progress_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

 Isosurface (const MaskVolumeHandle &mask_volume)
 
void compute (double quality_factor, bool capping_enabled, boost::function< bool() > check_abort)
 Compute isosurface. quality_factor must be one of: {0.125, 0.25, 0.5, 1.0}.
 
const PointFVector & get_points () const
 
const UIntVector & get_faces () const
 
const VectorFVector & get_normals () const
 
float surface_area () const
 Return the area of the isosurface.
 
const FloatVector & get_values () const
 
bool set_values (const FloatVector &values)
 
void set_color_map (ColorMapHandle color_map)
 
ColorMapHandle get_color_map () const
 Get mapping from vertex values to RGB colors.
 
void redraw (bool use_colormap)
 
bool export_legacy_isosurface (const boost::filesystem::path &path, const std::string &file_prefix)
 
bool export_vtk_isosurface (const boost::filesystem::path &filename)
 Writes out an isosurface in ASCII VTK mesh format.
 
bool export_stl_ascii_isosurface (const boost::filesystem::path &filename, const std::string &name)
 Writes out an isosurface in ASCII STL file format.
 
bool export_stl_binary_isosurface (const boost::filesystem::path &filename, const std::string &name)
 Writes out an isosurface in Binary STL file format.
 
- Public Member Functions inherited from Core::RecursiveLockable
mutex_type & get_mutex () const
 

Public Attributes

update_progress_signal_type update_progress_signal_
 

Static Public Attributes

static const std::string EXPORT_FORMATS_C
 
static const FilterMap EXPORT_FORMATS_MAP_C = { { "VTK (*.vtk)", ".vtk" }, { "ASCII (*.fac *.pts *.val)", ".fac" }, { "ASCII STL (*.stl)", ".stl" } }
 

Member Function Documentation

bool Core::Isosurface::export_legacy_isosurface ( const boost::filesystem::path &  path,
const std::string &  file_prefix 
)

Write points to .pts file, faces to .fac file, and values (if assigned) to .val file. Returns true on success, false on failure.

path: Path to existing directory where files should be written. file_prefix: File prefix to use for output files (no extension).

Format for .pts: x y z x y z ...

Format for .fac: p1 p2 p3 p1 p2 p3 ...

Format for .val: v1 v2 ...

Note: can't call this function "export" because it is reserved by the Visual C++ compiler.

const UIntVector & Core::Isosurface::get_faces ( ) const

Indices into vertices, 3 per face NOTE: This function is not thread-safe, make sure you have the mutex allocated before using this array (use get_mutex())

const VectorFVector & Core::Isosurface::get_normals ( ) const

Get one normal per vertex, interpolated NOTE: This function is not thread-safe, make sure you have the mutex allocated before using this array (use get_mutex())

const PointFVector & Core::Isosurface::get_points ( ) const

Get 3D points for vertices, each stored only once NOTE: This function is not thread-safe, make sure you have the mutex allocated before using this array (use get_mutex())

const FloatVector & Core::Isosurface::get_values ( ) const

Get values per vertex. Returns empty vector if use has not set values. NOTE: This function is not thread-safe, make sure you have the mutex allocated before using this array (use get_mutex())

void Core::Isosurface::redraw ( bool  use_colormap)

Render the isosurface. This function doesn't work in isolation – it must be called from the Seg3D Renderer.

void Core::Isosurface::set_color_map ( ColorMapHandle  color_map)

Set mapping from vertex values to RGB colors. NOTE: This function is not thread-safe. Passing handle since colormap is unlikely to be modified after creation.

bool Core::Isosurface::set_values ( const FloatVector &  values)

Set values for all vertices. Vector must be same size as points and normals vectors or empty. Returns true on success, false on failure. NOTE: This function is not thread-safe, make sure you have the mutex allocated before using this array (use get_mutex())

Member Data Documentation

update_progress_signal_type Core::Isosurface::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.


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