Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Space_filling_model_inner_approximation_module< ModuleTraits > Class Template Reference

Module building the inner approximation of a set of particles using their medial-axis and a greedy selection algorithm. Module building the inner approximation of a set of particles using their medial-axis and a greedy selection algorithm. More...

#include "Space_filling_model_inner_approximation_module.hpp"

Public Types

typedef SBL::Modules::T_Space_filling_model_inner_approximation_module< ModuleTraits > Self
 
typedef SBL::Modules::Module_base Base
 

Static Public Member Functions

static boost::program_options::options_description *& get_options (void)
 Access to the options' description of the module. More...
 
static bool has_options (void)
 
static void delete_options (void)
 
static void initialize_options (const std::string &caption)
 

Traits Requirements

typedef ModuleTraits::Union_of_balls_boundary_3 Union_of_balls_boundary_3
 Representation of the boundary of the union of balls. More...
 

Other Types

typedef Union_of_balls_boundary_3::Weighted_alpha_complex_3 Alpha_complex
 $\alpha$-complex type used for computing the boundary. More...
 
typedef Alpha_complex::Geom_traits::Kernel AC_kernel
 Geoemtric kernel used for representing basic 3D objects. More...
 
typedef SBL::GT::T_Union_of_balls_medial_axis_3_data_structure< Alpha_complex, typename Alpha_complex::FTMedial_axis
 Representation of the medial-axis of the union of balls. More...
 
typedef SBL::GT::T_Union_of_balls_medial_axis_3_builder< Medial_axisMedial_axis_builder
 Algorithm constructing the medial axis of an union of balls. More...
 
typedef Medial_axis::Delaunay_triangulation_3::Geom_traits::Kernel Medial_axis_kernel
 3D geometric kernel used for representing the objects in the medial-axis (see Union_of_balls_medial_axis_3). More...
 
typedef CGAL::Regular_triangulation_euclidean_traits_3< AC_kernelTriangulation_of_arrangements_traits
 Traits class for the 3D triangulation of the arrangements (i.e 3D balls) used in the inner cover. More...
 
typedef CGAL::Triangulation_vertex_base_with_info_3< Info_for_triangulation_of_arrangements, Triangulation_of_arrangements_traitsTriangulation_vertex_base_3
 Base representation of a vertex in the triangulation of arrangements.
More...
 
typedef Triangulation_of_arrangements_traits::Compare_weighted_squared_radius_3 Compare_weighted_squared_radius_3
 Compare the radius of the smallest orthogonal sphere of input spheres to a given radius. More...
 
typedef CGAL::Regular_triangulation_cell_base_3< Triangulation_of_arrangements_traitsTriangulation_cell_base_3
 Base representation of a cell in the triangulation of arrangements. More...
 
typedef CGAL::Triangulation_data_structure_3< Triangulation_vertex_base_3, Triangulation_cell_base_3TDS_of_arrangements
 Base data structure of the triangulation of arrangements. More...
 
typedef CGAL::Regular_triangulation_3< Triangulation_of_arrangements_traits, TDS_of_arrangementsTriangulation_of_arrangements
 Data structure of the triangulation of arrangements. More...
 
typedef CGAL::Exact_spherical_kernel_3 Spherical_kernel_3
 
typedef SBL::GT::T_Union_of_balls_surface_volume_3< Alpha_complex, Spherical_kernel_3Union_of_balls_surface_volume_3
 
typedef SBL::CADS::T_Greedy_selection< typename Medial_axis::Vertex_handle, Get_volume, Get_overlapping_spheres > Greedy_selection
 Greedy selection algorithm where the arrangements are 3D balls, and weights are volume of the arrangements (see Greedy_selection). More...
 
typedef SBL::GT::T_Betti_numbers_2< Alpha_complexGet_Betti_numbers
 Compute the Betti numbers of a 3D Cell Complex from its alpha-complex. More...
 

Input Accessors

Union_of_balls_surface_volume_3::Output_kernel::FT & get_volume (void)
 Reference to the input volume of the union of particles. More...
 
Union_of_balls_boundary_3 *& get_boundary (void)
 Reference to a pointer over the input boundary. More...
 

Output Accessors

const std::vector< typename Medial_axis::Vertex_handle > & get_selection (void) const
 Const reference to the inner approximation as a container of maximal balls centered on the medial axis. More...
 
std::vector< typename Medial_axis::Vertex_handle > & get_selection (void)
 Reference to the inner approximation as a container of maximal balls centered on the medial axis. More...
 

Mandatory Requirements

void run (unsigned verbose, std::ostream &out)
 Runs the module following the input options. More...
 
bool is_runnable (void) const
 Checks that all the input options were set. More...
 
void statistics (std::ostream &out)
 Reports high-level statistics on the module. More...
 
std::string get_name (void) const
 Returns the name of the package. More...
 

Optional Requirements

boost::program_options::options_description add_options (void) const
 Virtual method for adding options to the module. More...
 
bool check_options (std::string &message) const
 Checks that the input options' values are coherent. More...
 
std::string get_output_prefix (void) const
 Returns a prefix that concatains the input line options used when running the module. More...
 
void report (const std::string &prefix)
 Reports the output and statistics in output files. More...
 

Modules Management

void set_module_instance_name (const std::string &module_instance_name)
 Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules. More...
 
const std::string & get_module_instance_name (void) const
 Get the name of this instance of this module. More...
 
void set_report_mode (std::ios_base::openmode report_mode)
 Set a report mode, that is open or append modes. More...
 
void set_report_mode (std::ios_base::openmode &report_mode)
 Set a report mode, that is open or append modes. More...
 
const std::ios_base::openmode get_report_mode (void) const
 Get the report mode to be used when reporting. More...
 

Others

template<class Self_ >
Self_ * clone (const Self_ *s) const
 Clones the object using the copy constructor. More...
 
virtual bool is_logical_module (void) const
 Checks that this module defines a logical operator. More...
 
virtual bool is_condition_module (void) const
 Checks that this module defines a condition operator. More...
 
virtual bool operator() (void)
 Only for condition modules, for returning the predicate value. More...
 
virtual bool is_modules_collection (void) const
 Checks that this module defines a collection of modules. More...
 

Detailed Description

template<class ModuleTraits>
class SBL::Modules::T_Space_filling_model_inner_approximation_module< ModuleTraits >

Module building the inner approximation of a set of particles using their medial-axis and a greedy selection algorithm. Module building the inner approximation of a set of particles using their medial-axis and a greedy selection algorithm.

It uses the algorithm described in T_Space_filling_model_coarse_graining_inner_cover for building the inner approximation: from the boundary of the input set of particles, it:

  • computes the medial axis of the union of particles,
  • selects the maximal balls centered on the vertices of the medial axis using a greedy strategy weighted by the volume increment of each ball.

The input boundary can be set using the method SBL::Modules::T_Space_filling_model_inner_approximation_module::get_boundary that returns a reference over a pointer to the input boundary.

It is also necessary to set the input volume of the union of the particles using the methods SBL::Modules::T_Space_filling_model_inner_approximation_module::get_volume, that returns a reference over the input volume.

The output inner approximation is accessible via the method SBL::Modules::T_Space_filling_model_inner_approximation_module::get_selection.

Template Parameters
ModuleTraitsTraits class defining the type SBL::Modules::T_Space_filling_model_inner_approximation_module::Union_of_balls_boundary_3.

Member Typedef Documentation

◆ AC_kernel

typedef Alpha_complex::Geom_traits::Kernel AC_kernel

Geoemtric kernel used for representing basic 3D objects.

◆ Alpha_complex

typedef Union_of_balls_boundary_3::Weighted_alpha_complex_3 Alpha_complex

$\alpha$-complex type used for computing the boundary.

◆ Base

◆ Compare_weighted_squared_radius_3

typedef Triangulation_of_arrangements_traits:: Compare_weighted_squared_radius_3 Compare_weighted_squared_radius_3

Compare the radius of the smallest orthogonal sphere of input spheres to a given radius.

◆ Get_Betti_numbers

Compute the Betti numbers of a 3D Cell Complex from its alpha-complex.

Template Parameters
AlphaComplex3A Model of the 3D $\alpha$-complex of the CGAL Library.

◆ Greedy_selection

typedef SBL::CADS::T_Greedy_selection<typename Medial_axis::Vertex_handle, Get_volume, Get_overlapping_spheres> Greedy_selection

Greedy selection algorithm where the arrangements are 3D balls, and weights are volume of the arrangements (see Greedy_selection).

for an incremental version of the greedy selection algorithm, defines SBL_INCREMENTAL_GREEDY .

◆ Medial_axis

Representation of the medial-axis of the union of balls.

For the moment, I just link the halfedges to the bounding vertices. In the future, it may be important to set the bounding faces, the next and prev of a halfedge, etc...

Template Parameters
WeightedAlphaComplex3A Model of the 3D Weighted $\alpha$-complex of the CGAL Library.
HalfedgeDSBaseBase data structure for the boundary of union of balls.

◆ Medial_axis_builder

Algorithm constructing the medial axis of an union of balls.

The medial axis of a closed surface is the set of centers of empty balls which touch the surface at more than one point. For an union of balls B, the medial axis is the intersection of the alpha-shape of B for alpha = 0, with the Voronoi diagram of the intersection points at the boundary of B.

The method for computing this medial axis follows the article The medial axis of a union of balls from Amenta et al in 2001. It consists on 8 steps:

  • Step 0: computing the weighted alpha-shape of the input balls.
  • Step 1: adding to the medial axis all singular faces of the 0-shape.
  • Step 2: computing the Delaunay triangulation of intersection points on the boundary of union of input balls.
  • Step 3: determining crossing and alpha-shape edges of dual of the Delaunay triangulation.
  • Step 4: tagging as inside of the medial axis all Voronoi vertices that are centers of input balls.
  • Step 5: tagging as outside of the medial axis all infinite Voronoi vertices.
  • Step 6: for each Voronoi cell with at least one labeled vertex not bounding an alpha-shape edge, labeling as inside or outside all bounding Voronoi vertices.
  • Step 7: adding all full / clipped Voronoi faces that are in the medial axis.

Note that all intermediate data structures are stored during the process and the class provides accessors for these data structures.

Template Parameters
KernelGeometric kernel for constant size objects, predicates and constructions from the CGAL library
RealTypeRepresentation of a real number for Delaunay computation

◆ Medial_axis_kernel

typedef Medial_axis::Delaunay_triangulation_3::Geom_traits::Kernel Medial_axis_kernel

3D geometric kernel used for representing the objects in the medial-axis (see Union_of_balls_medial_axis_3).

◆ Self

◆ Spherical_kernel_3

typedef CGAL::Exact_spherical_kernel_3 Spherical_kernel_3

◆ TDS_of_arrangements

typedef CGAL::Triangulation_data_structure_3<Triangulation_vertex_base_3, Triangulation_cell_base_3> TDS_of_arrangements

Base data structure of the triangulation of arrangements.

◆ Triangulation_cell_base_3

typedef CGAL::Regular_triangulation_cell_base_3<Triangulation_of_arrangements_traits> Triangulation_cell_base_3

Base representation of a cell in the triangulation of arrangements.

◆ Triangulation_of_arrangements

Data structure of the triangulation of arrangements.

◆ Triangulation_of_arrangements_traits

typedef CGAL::Regular_triangulation_euclidean_traits_3<AC_kernel> Triangulation_of_arrangements_traits

Traits class for the 3D triangulation of the arrangements (i.e 3D balls) used in the inner cover.

◆ Triangulation_vertex_base_3

typedef CGAL::Triangulation_vertex_base_with_info_3<Info_for_triangulation_of_arrangements, Triangulation_of_arrangements_traits> Triangulation_vertex_base_3

Base representation of a vertex in the triangulation of arrangements.

◆ Union_of_balls_boundary_3

typedef ModuleTraits::Union_of_balls_boundary_3 Union_of_balls_boundary_3

Representation of the boundary of the union of balls.

Representation of the boundary of the union of balls.

Template Parameters
WeightedAlphaComplex3A Model of the 3D Weighted $\alpha$-complex of the CGAL Library.
IS_CCWTag allowing to orientate in CW or CCW the sense of the half-edges.
HalfedgeDSBaseBase data structure for the boundary of union of balls.

◆ Union_of_balls_surface_volume_3

Member Function Documentation

◆ add_options()

boost::program_options::options_description add_options ( void  ) const
inlinevirtual

Virtual method for adding options to the module.

Reimplemented from T_Module_option_description< Dummy >.

◆ check_options()

bool check_options ( std::string &  message) const
inlinevirtual

Checks that the input options' values are coherent.

Reimplemented from T_Module_option_description< Dummy >.

◆ clone()

Self_* clone ( const Self_ *  s) const
inlineinherited

Clones the object using the copy constructor.

◆ delete_options()

static void delete_options ( void  )
inlinestaticinherited

◆ get_boundary()

T_Space_filling_model_inner_approximation_module< ModuleTraits >::Union_of_balls_boundary_3 *& get_boundary ( void  )
inline

Reference to a pointer over the input boundary.

◆ get_module_instance_name()

const std::string& get_module_instance_name ( void  ) const
inlineinherited

Get the name of this instance of this module.

◆ get_name()

std::string get_name ( void  ) const
inlinevirtual

Returns the name of the package.

Reimplemented from Module_base.

◆ get_options()

static boost::program_options::options_description*& get_options ( void  )
inlinestaticinherited

Access to the options' description of the module.

◆ get_output_prefix()

std::string get_output_prefix ( void  ) const
inlinevirtual

Returns a prefix that concatains the input line options used when running the module.

Reimplemented from T_Module_option_description< Dummy >.

◆ get_report_mode()

const std::ios_base::openmode get_report_mode ( void  ) const
inlineinherited

Get the report mode to be used when reporting.

◆ get_selection() [1/2]

std::vector< typename T_Space_filling_model_inner_approximation_module< ModuleTraits >::Medial_axis::Vertex_handle > & get_selection ( void  )
inline

Reference to the inner approximation as a container of maximal balls centered on the medial axis.

◆ get_selection() [2/2]

const std::vector< typename T_Space_filling_model_inner_approximation_module< ModuleTraits >::Medial_axis::Vertex_handle > & get_selection ( void  ) const
inline

Const reference to the inner approximation as a container of maximal balls centered on the medial axis.

◆ get_volume()

T_Space_filling_model_inner_approximation_module< ModuleTraits >::Union_of_balls_surface_volume_3::Output_kernel::FT & get_volume ( void  )
inline

Reference to the input volume of the union of particles.

◆ has_options()

static bool has_options ( void  )
inlinestaticinherited

◆ initialize_options()

static void initialize_options ( const std::string &  caption)
inlinestaticinherited

◆ is_condition_module()

virtual bool is_condition_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a condition operator.

◆ is_logical_module()

virtual bool is_logical_module ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a logical operator.

◆ is_modules_collection()

virtual bool is_modules_collection ( void  ) const
inlineprotectedvirtualinherited

Checks that this module defines a collection of modules.

◆ is_runnable()

bool is_runnable ( void  ) const
inlinevirtual

Checks that all the input options were set.

Reimplemented from Module_base.

◆ operator()()

virtual bool operator() ( void  )
inlineprotectedvirtualinherited

Only for condition modules, for returning the predicate value.

◆ report()

void report ( const std::string &  prefix)
inlinevirtual

Reports the output and statistics in output files.

Reimplemented from Module_base.

◆ run()

void run ( unsigned  verbose,
std::ostream &  out 
)
inlinevirtual

Runs the module following the input options.

Implements Module_base.

◆ set_module_instance_name()

void set_module_instance_name ( const std::string &  module_instance_name)
inlineinherited

Sets a name for this instance of this module. In particular, it will be used in the prefix of output files generated by a collection of modules.

◆ set_report_mode() [1/2]

void set_report_mode ( std::ios_base::openmode &  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ set_report_mode() [2/2]

void set_report_mode ( std::ios_base::openmode  report_mode)
inlineinherited

Set a report mode, that is open or append modes.

◆ statistics()

void statistics ( std::ostream &  out)
inlinevirtual

Reports high-level statistics on the module.

Reimplemented from Module_base.