Namespaces | |
namespace | chan_vese |
namespace | detail |
Classes | |
class | Grid |
struct | inside_region_tag |
struct | outside_region_tag |
Functions | |
template<typename T , typename M > | |
T | min_element (OpenTissue::grid::Grid< T, M > const &G) |
template<typename T , typename M > | |
T | max_element (OpenTissue::grid::Grid< T, M > const &G) |
template<typename T , typename M > | |
Grid< T, M > & | fabs (Grid< T, M > &G) |
template<typename T , typename M > | |
Grid< T, M > & | negate (Grid< T, M > &G) |
template<typename T , typename M > | |
Grid< T, M > & | scale (Grid< T, M > &G, T fac) |
template<typename grid_type > | |
bool | binary_read (std::string const &filename, grid_type &grid) |
template<typename grid_type > | |
bool | binary_write (std::string const &filename, grid_type &grid) |
template<typename grid_type > | |
bool | image_read (std::string const &directory, std::string const &filter, grid_type &grid) |
template<typename grid_type > | |
bool | matlab_write (std::string const &mfile, grid_type const &grid) |
template<typename grid_type > | |
bool | raw_read (std::string const &filename, grid_type &grid) |
template<typename grid_type > | |
void | raw_read_8bit (std::string const &filename, grid_type &target) |
template<typename grid_type > | |
void | raw_read_8bit_to_16bit (std::string const &filename, grid_type &target) |
template<typename grid_type > | |
void | raw_read_16bit (std::string const &filename, grid_type &target) |
template<typename grid_type > | |
bool | raw_write (std::string const &filename, grid_type &grid) |
template<typename grid_type > | |
void | aof (grid_type const &phi, grid_type &F) |
template<class grid_type > | |
void | approximate_gaussian_filter (grid_type const &src, size_t order, size_t size, grid_type &dst) |
template<class grid_type > | |
void | approximate_gaussian_filter_border_correct (grid_type const &src, size_t order, size_t size, grid_type &dst) |
template<typename grid_type > | |
void | average (grid_type &phi) |
template<typename vector3_type , typename grid_type > | |
vector3_type | bisection_line_search (vector3_type q_a, vector3_type q_b, grid_type &phi, bool maximize=true) |
template<typename grid_type > | |
void | blockify (grid_type &phi) |
template<typename grid_type , typename value_type > | |
void | blockify (grid_type &phi, value_type inside, value_type outside, size_t offset, size_t spacing) |
template<typename grid_type , typename value_type > | |
void | blockify (grid_type &phi, value_type inside, value_type outside, size_t offset, size_t spacing, size_t slice) |
template<typename grid_type > | |
void | box_filter (grid_type const &src, size_t size, grid_type &dst) |
template<typename grid_type_in , typename image_grid_type , typename real_type , typename grid_type_out > | |
void | chan_vese_auto_in_out (grid_type_in &phi, image_grid_type const &U, real_type const &lambda, real_type const &mu, real_type const &nu, real_type const &dt, grid_type_out &psi, real_type const &epsilon=10e-7, size_t const &max_iterations=10) |
template<typename grid_type_in , typename image_type , typename real_type , typename grid_type_out > | |
void | chan_vese_fixed_in_out (grid_type_in const &phi, image_type const &U, typename image_type::value_type const &C_in, typename image_type::value_type const &C_out, real_type const &lambda, real_type const &mu, real_type const &nu, real_type const &dt, grid_type_out &psi) |
template<typename grid_type_in , typename image_grid_type , typename real_type , typename grid_type_out > | |
void | chan_vese_fixed_in (grid_type_in const &phi, image_grid_type const &U, typename image_grid_type::value_type C_in, real_type const &lambda, real_type const &mu, real_type const &nu, real_type const &dt, grid_type_out &psi) |
template<typename grid_type_in , typename image_grid_type , typename real_type , typename grid_type_out > | |
void | chan_vese_fixed_out (grid_type_in const &phi, image_grid_type const &U, typename image_grid_type::value_type C_out, real_type const &lambda, real_type const &mu, real_type const &nu, real_type const &dt, grid_type_out &psi) |
template<typename grid_type_in , typename real_type , typename grid_type_out > | |
void | closing (grid_type_in const &phi, real_type const &radius, real_type const &dt, grid_type_out &psi) |
template<typename grid_type > | |
void | compute_sign_function (grid_type const &phi, grid_type &S0) |
template<typename grid_type > | |
size_t | connected_components (grid_type const &image, grid_type &components) |
template<typename grid_type , typename vector3_type > | |
void | coord2idx (grid_type const &grid, vector3_type const &point, size_t &i, size_t &j, size_t &k) |
template<typename grid_type > | |
void | crop (grid_type const &M, grid_type &m, typename grid_type::value_type const &treshold) |
template<typename grid_type > | |
void | crop (grid_type const &M, grid_type &m, size_t min_i, size_t min_j, size_t min_k, size_t max_i, size_t max_j, size_t max_k) |
template<typename grid_type , typename real_type > | |
void | curvature (grid_type const &grid, size_t i, size_t j, size_t k, real_type &K, real_type &G, real_type &k1, real_type &k2) |
template<typename grid_type , typename real_type > | |
void | eigen_curvature (grid_type const &grid, size_t i, size_t j, size_t k, real_type &k1, real_type &k2) |
template<typename grid_type , typename real_type > | |
void | algebra_curvature (grid_type const &grid, size_t i, size_t j, size_t k, real_type &k1, real_type &k2) |
template<typename grid_type , typename real_type > | |
void | curvature_flow (grid_type const &phi, real_type const &mu, real_type const &dt, grid_type &psi) |
template<typename grid_type_in , typename real_type , typename grid_type_out > | |
void | dilation (grid_type_in const &phi, real_type const &radius, real_type const &dt, grid_type_out &psi) |
template<typename grid_type > | |
void | div_grad (grid_type const &phi, grid_type &M) |
template<typename grid_type , typename vector3_type > | |
void | enclosing_indices (grid_type const &grid, vector3_type const &point, size_t &i0, size_t &j0, size_t &k0, size_t &i1, size_t &j1, size_t &k1) |
template<typename grid_type_in , typename real_type , typename grid_type_out > | |
void | erosion (grid_type_in const &phi, real_type const &radius, real_type const &dt, grid_type_out &psi) |
template<typename grid_type_in , typename transfer_function , typename grid_type_out > | |
void | extract_voxels (grid_type_in const &in, transfer_function const &func, grid_type_out &out) |
template<typename grid_type > | |
void | extrapolation (grid_type &S, grid_type const &phi, size_t max_iterations=10) |
template<typename grid_type > | |
void | fast_blur (grid_type &image, double sx, double sy, double sz, double log_base, size_t iterations) |
template<typename grid_type > | |
void | fast_blur (grid_type &image, double s, double log_base, size_t iterations) |
template<typename grid_type , typename real_type > | |
void | gaussian_convolution (grid_type const &src, grid_type &dst, real_type sx, real_type sy, real_type sz) |
template<typename grid_type , typename vector3_type > | |
void | gradient (grid_type const &grid, size_t i, size_t j, size_t k, vector3_type &gradient) |
template<typename grid_iterator , typename vector3_type > | |
void | gradient (grid_iterator const &iter, vector3_type &gradient) |
template<typename grid_iterator > | |
grid_iterator::math_types::vector3_type | gradient (grid_iterator const &iter) |
template<typename grid_type , typename vector3_type > | |
vector3_type | gradient_at_point (grid_type const &grid, vector3_type const &point) |
template<typename grid_type , typename real_type > | |
void | gradient_magnitude (grid_type const &grid, size_t i, size_t j, size_t k, real_type &grad_mag) |
template<typename grid_iterator , typename real_type > | |
void | gradient_magnitude (grid_iterator const &iter, real_type &grad_mag) |
template<typename grid_iterator > | |
grid_iterator::math_types::real_type | gradient_magnitude (grid_iterator const &iter) |
template<typename grid_type , typename matrix3x3_type > | |
void | hessian (grid_type const &grid, size_t i, size_t j, size_t k, matrix3x3_type &H) |
template<typename grid_iterator , typename matrix3x3_type > | |
void | hessian (grid_iterator const &iter, matrix3x3_type &H) |
template<typename grid_iterator > | |
OpenTissue::math::Matrix3x3 < typename grid_iterator::math_types::real_type > | hessian (grid_iterator const &iter) |
template<typename grid_type , typename vector3_type > | |
void | idx2coord (grid_type const &grid, size_t i, size_t j, size_t k, vector3_type &point) |
template<typename grid_iterator , typename vector3_type > | |
void | idx2coord (grid_iterator const &iter, vector3_type &point) |
template<typename grid_iterator > | |
grid_iterator::math_types::vector3_type | idx2coord (grid_iterator const &iter) |
template<typename grid_type > | |
void | ignore_region (grid_type &phi, inside_region_tag const &) |
template<typename grid_type > | |
void | ignore_region (grid_type &phi, outside_region_tag const &) |
template<typename grid_type , typename vector3_type > | |
bool | is_point_inside (grid_type const &grid, vector3_type const &point) |
template<typename grid_type , typename vector3_iterator > | |
void | isosurface_projection (grid_type const &phi, vector3_iterator begin, vector3_iterator end, bool project_inside=true, bool project_outside=true, double isovalue=0.0) |
template<typename grid_type , typename mesh_type , typename point_container > | |
void | junctions (grid_type const &aof, grid_type &phi, mesh_type &mesh, point_container &points) |
template<typename grid_type , typename mesh_type , typename point_container > | |
void | junctions2 (grid_type const &aof, grid_type const &phi, mesh_type &mesh, point_container &points) |
template<typename grid_type > | |
void | laplacian_blur (grid_type &image, double diffusion=1.0, size_t max_iterations=10) |
template<typename grid_type , typename point_container > | |
void | local_minima_as_points (grid_type const &phi, point_container &points) |
template<typename grid_type , typename point_container > | |
void | local_minima_as_points (grid_type const &phi, grid_type const &mask, point_container &points) |
template<typename grid_type , typename real_type > | |
void | mean_curvature (grid_type const &grid, size_t i, size_t j, size_t k, real_type &K) |
template<typename grid_iterator , typename real_type > | |
void | mean_curvature (grid_iterator const &iter, real_type &K) |
template<typename grid_iterator > | |
grid_iterator::math_types::real_type | mean_curvature (grid_iterator const &iter) |
template<typename mesh_type , typename grid_type > | |
void | mesh2phi (mesh_type &mesh, grid_type &phi, size_t max_resolution=64, bool use_gpu=true) |
template<typename mesh_type , typename grid_type > | |
void | mesh2phi (mesh_type &mesh, grid_type &phi, double bandsize, size_t resolution, bool use_gpu=true) |
template<typename grid_type > | |
void | metamorphosis_speed_function (grid_type const &phi, grid_type const &gamma, grid_type &F) |
template<typename grid_type > | |
void | metamorphosis (grid_type &phi, grid_type const &gamma, typename grid_type::math_types::real_type const &dt) |
template<typename grid_type_in , typename real_type , typename grid_type_out > | |
void | opening (grid_type_in const &phi, real_type const &radius, real_type const &dt, grid_type_out &psi) |
template<typename grid_type > | |
void | poisson_solver (grid_type &phi, grid_type const &W, size_t max_iterations=10) |
template<typename grid_type > | |
void | redistance (grid_type const &phi, grid_type &psi, size_t max_iterations=10, double steady_threshold=0.05) |
template<typename grid_type , typename real_type > | |
void | resample (grid_type const &M, grid_type &m, real_type factor_i, real_type factor_j, real_type factor_k) |
template<typename grid_type > | |
void | rescale_range (grid_type &grid, typename grid_type::value_type src_min, typename grid_type::value_type src_max, typename grid_type::value_type dst_min, typename grid_type::value_type dst_max) |
template<typename grid_type , typename real_type > | |
void | second_derivative (grid_type const &grid, size_t i, size_t j, size_t k, real_type &derivative) |
template<typename grid_iterator , typename real_type > | |
void | second_derivative (grid_iterator const &iter, real_type &derivative) |
template<typename grid_iterator > | |
grid_iterator::math_types::real_type | second_derivative (grid_iterator const &iter) |
template<typename grid_type , typename grid_container > | |
void | split2slices (grid_type &grid, grid_container &slices, size_t axis=2) |
template<typename grid_type , typename point_container > | |
void | strict_local_minima_as_points (grid_type const &phi, point_container &points) |
template<typename grid_type , typename point_container > | |
void | strict_local_minima_as_points (grid_type const &phi, grid_type const &mask, point_container &points) |
template<typename input_iterator , typename output_iterator , typename function_type > | |
void | transform (input_iterator in_begin, input_iterator in_end, output_iterator out_begin, function_type func) |
template<typename grid_type , typename vector3_int_type > | |
void | translate (grid_type const &src, vector3_int_type const &v, grid_type &dst) |
template<typename grid_type , typename vector3_container > | |
void | uniform_point_sampling (grid_type const &phi, vector3_container &points, size_t sub_sample=2u) |
template<typename grid_type , typename vector3_type > | |
void | upwind_gradient (grid_type const &phi, grid_type const &F, size_t i, size_t j, size_t k, vector3_type &gradient) |
template<typename grid_type > | |
void | upwind_gradient_field (grid_type const &phi, grid_type const &F, grid_type &Nx, grid_type &Ny, grid_type &Nz) |
template<typename grid_type , typename vector3_type > | |
grid_type::value_type | value_at_point (grid_type const &grid, vector3_type const &point) |
template<typename grid_type , typename plane_type > | |
void | voxel_plane_clip (grid_type const &voxels, plane_type const &plane, grid_type &below, grid_type &above) |
template<typename mesh_type , typename grid_type > | |
void | voxelizer (mesh_type &mesh, grid_type &phi) |
void OpenTissue::grid::algebra_curvature | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | k1, | |||
real_type & | k2 | |||
) | [inline] |
Computes principal curvatures based on linear algebra.
This is similar to the approach used in the paper:
{museth.breen.ea02, author = {Ken Museth and David E. Breen and Ross T. Whitaker and Alan H. Barr}, title = {Level set surface editing operators}, booktitle = {Proceedings of the 29th annual conference on Computer graphics and interactive techniques}, year = {2002}, isbn = {1-58113-521-1}, pages = {330--338}, location = {San Antonio, Texas}, doi = {http://doi.acm.org/10.1145/566570.566585}, publisher = {ACM Press}, }
k1 | Upon return this value contains the first principal curvature. | |
k2 | Upon return this value contains the second principal curvature. |
void OpenTissue::grid::aof | ( | grid_type const & | phi, | |
grid_type & | F | |||
) | [inline] |
Average Outward Flux.
phi | A the distance grid. | |
F | A grid containing the values of the average outward flux. |
void OpenTissue::grid::approximate_gaussian_filter | ( | grid_type const & | src, | |
size_t | order, | |||
size_t | size, | |||
grid_type & | dst | |||
) | [inline] |
Fast convolution by an approximate "integer" guassian filter. This just applies several box_filter's (boxsize=size and order times), and is only efficient for low orders. If size is even, the order must also be even for the resulting image to lay on the same grid (else translated 0.5 voxel towards (0,0,0) ).
src | Source grid to be convolved. | |
order | Order of filter. Corresponds to the number of times the boxfilter is applied. | |
size | Size of filter. | |
dst | Upon return, contains the filtered grid. |
void OpenTissue::grid::approximate_gaussian_filter_border_correct | ( | grid_type const & | src, | |
size_t | order, | |||
size_t | size, | |||
grid_type & | dst | |||
) | [inline] |
Approximate Gaussian filter with compensation on image borders. Attenuation on border regions is compensated. This is equivalent to Gaussian filtering using only filter coefficients that are inside the "shape" being considered.
src | Source grid to be convolved. | |
order | Order of filter. Corresponds to the number of times the boxfilter is applied. | |
size | Size of filter. | |
dst | Upon return, contains the filtered grid. |
void OpenTissue::grid::average | ( | grid_type & | phi | ) | [inline] |
bool OpenTissue::grid::binary_read | ( | std::string const & | filename, | |
grid_type & | grid | |||
) | [inline] |
bool OpenTissue::grid::binary_write | ( | std::string const & | filename, | |
grid_type & | grid | |||
) | [inline] |
vector3_type OpenTissue::grid::bisection_line_search | ( | vector3_type | q_a, | |
vector3_type | q_b, | |||
grid_type & | phi, | |||
bool | maximize = true | |||
) | [inline] |
Grid Bisection Line Search
q_a | ||
q_b | ||
phi | ||
maximize | If true the bisection method tries to find the maximimum value between q_a and q_b otherwise it tries to find the minimum value. |
void OpenTissue::grid::blockify | ( | grid_type & | phi | ) | [inline] |
Level Set Blockifier. This function takes a level set grid and re-initializes it into small cubic blocks (-1 inside and +1 outside).
phi | The level set grid. |
void OpenTissue::grid::blockify | ( | grid_type & | phi, | |
value_type | inside, | |||
value_type | outside, | |||
size_t | offset, | |||
size_t | spacing | |||
) | [inline] |
Initialize a grid with a pattern of boxes of width offset.
phi | The grid to initialize. | |
inside | Value to fill inside blocks | |
outside | Value to fill outside blocks | |
offset | The offset from the borders. | |
spacing | The width, height, depth and half the spacing of boxes. |
void OpenTissue::grid::blockify | ( | grid_type & | phi, | |
value_type | inside, | |||
value_type | outside, | |||
size_t | offset, | |||
size_t | spacing, | |||
size_t | slice | |||
) | [inline] |
Initialize a slice of a grid with a pattern of boxes of width offset.
phi | The grid to initialize. | |
inside | Value to fill inside blocks | |
outside | Value to fill outside blocks | |
offset | The offset from the borders. | |
spacing | The width, height, and half the spacing of boxes. | |
slice | The slice in z-depth that needs to be filled |
void OpenTissue::grid::box_filter | ( | grid_type const & | src, | |
size_t | size, | |||
grid_type & | dst | |||
) | [inline] |
Fast convolution by an integer sized box signal. Variance of the filter is 1/12*(size*size-1).
src | Source grid to be convolved. | |
size | Size of box filter. | |
dst | Upon return, contains the filtered grid. |
void OpenTissue::grid::chan_vese_auto_in_out | ( | grid_type_in & | phi, | |
image_grid_type const & | U, | |||
real_type const & | lambda, | |||
real_type const & | mu, | |||
real_type const & | nu, | |||
real_type const & | dt, | |||
grid_type_out & | psi, | |||
real_type const & | epsilon = 10e-7 , |
|||
size_t const & | max_iterations = 10 | |||
) | [inline] |
phi | Input level set. | |
U | Input image. | |
lambda | Weight of input/output regions (legal values 0..1) 0.5 means input and output are weighted equally. | |
mu | Mean Curvature regularization (requires input level set to be close to signed distance grid) | |
nu | Area (Well, it is really volume:-) regularization. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance grid then output may not be a signed distance grid, thus you may need to redistance output levelset. | |
epsilon | Steady state threshold testing. | |
max_iterations | Maximum number of iterations allowed to reach steady state. |
void OpenTissue::grid::chan_vese_fixed_in | ( | grid_type_in const & | phi, | |
image_grid_type const & | U, | |||
typename image_grid_type::value_type | C_in, | |||
real_type const & | lambda, | |||
real_type const & | mu, | |||
real_type const & | nu, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
phi | Input level set. | |
U | Input image. | |
C_in | Mean value of inside region. This is the mean value of the region that phi is supposed to enclose. | |
lambda | Weight of input/output regions (legal values 0..1) 0.5 means input and output are weighted equally. | |
mu | Mean Curvature regularization (requires input level set to be close to signed distance grid) | |
nu | Area (Well, it is really volume:-) regularization. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance grid then output may not be a signed distance grid, thus you may need to redistance output levelset. |
void OpenTissue::grid::chan_vese_fixed_in_out | ( | grid_type_in const & | phi, | |
image_type const & | U, | |||
typename image_type::value_type const & | C_in, | |||
typename image_type::value_type const & | C_out, | |||
real_type const & | lambda, | |||
real_type const & | mu, | |||
real_type const & | nu, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
phi | Input level set. | |
U | Input image. | |
C_in | Mean value of inside region. This is the mean value of the region that phi is supposed to enclose. | |
C_out | Mean value of outside region. This is the mean value of the region that is supposed to lie outside phi. | |
lambda | Weight of input/output regions (legal values 0..1) 0.5 means input and output are weighted equally. | |
mu | Mean Curvature regularization (requires input level set to be close to signed distance grid) | |
nu | Area (Well, it is really volume:-) regularization. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance grid then output may not be a signed distance grid, thus you may need to redistance output levelset. |
void OpenTissue::grid::chan_vese_fixed_out | ( | grid_type_in const & | phi, | |
image_grid_type const & | U, | |||
typename image_grid_type::value_type | C_out, | |||
real_type const & | lambda, | |||
real_type const & | mu, | |||
real_type const & | nu, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
phi | Input level set. | |
U | Input image. | |
C_out | Mean value of outside region. This is the mean value of the region that is supposed to lie outside phi. | |
lambda | Weight of input/output regions (legal values 0..1) 0.5 means input and output are weighted equally. | |
mu | Mean Curvature regularization (requires input level set to be close to signed distance grid) | |
nu | Area (Well, it is really volume:-) regularization. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance grid then output may not be a signed distance grid, thus you may need to redistance output levelset. |
void OpenTissue::grid::closing | ( | grid_type_in const & | phi, | |
real_type const & | radius, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
Closing Operation.
phi | Input level set. | |
radius | Radius of spherical structural element. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance map then output may not be a signed distance map, thus you may need to redistance output levelset. |
void OpenTissue::grid::compute_sign_function | ( | grid_type const & | phi, | |
grid_type & | S0 | |||
) | [inline] |
size_t OpenTissue::grid::connected_components | ( | grid_type const & | image, | |
grid_type & | components | |||
) | [inline] |
Compute the 8-connected components of a binary image. The components in the returned image are labeled with positive integer values. If the image is identically zero, then the components image is identically zero and the returned quantity is zero.
image | Input image. Should be binary, with 1 representing data. | |
components | Output image. Each components is labelled with an unique identifier. |
void OpenTissue::grid::coord2idx | ( | grid_type const & | grid, | |
vector3_type const & | point, | |||
size_t & | i, | |||
size_t & | j, | |||
size_t & | k | |||
) | [inline] |
Coordinate 2 Voxel Indices. This method computes the indices (i,j,k) of the voxel containing the specified point.
The voxel index of the voxel containing the points is equal to index of the grid node of the containing voxel with lowest coordinates (ie. lower-left-back grid node).
grid | The grid. | |
point | The point. | |
i | Upon return this parameter contains the index of the voxel along the I-axe. | |
j | Upon return this parameter contains the index of the voxel along the J-axe. | |
k | Upon return this parameter contains the index of the voxel along the K-axe. |
void OpenTissue::grid::crop | ( | grid_type const & | M, | |
grid_type & | m, | |||
typename grid_type::value_type const & | treshold | |||
) | [inline] |
Crop grid to bounding box that do not include treshold. Can be used to automatically crop emptyness from scanned data.
M | Original grid to be cropped. | |
m | Destination grid. | |
treshold | Maximum value that needs to be cropped. |
void OpenTissue::grid::crop | ( | grid_type const & | M, | |
grid_type & | m, | |||
size_t | min_i, | |||
size_t | min_j, | |||
size_t | min_k, | |||
size_t | max_i, | |||
size_t | max_j, | |||
size_t | max_k | |||
) | [inline] |
Crop grid to user specified bounding box.
M | Original grid to be cropped. | |
m | Destination grid. | |
min_i | Lower i-coord of bounding box. | |
min_j | Lower j-coord of bounding box. | |
min_k | Lower k-coord of bounding box. | |
max_i | Upper i-coord of bounding box. | |
max_j | Upper j-coord of bounding box. | |
max_k | Upper k-coord of bounding box. |
void OpenTissue::grid::curvature | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | K, | |||
real_type & | G, | |||
real_type & | k1, | |||
real_type & | k2 | |||
) | [inline] |
Get Curvature.
i | Node coordinate | |
j | Node coordinate | |
k | Node coordinate | |
H | Upon return this value contains the mean curvature. | |
K | Upon return this value contains the gauss curvature. | |
k1 | Upon return this value contains the first principal curvature. | |
k2 | Upon return this value contains the second principal curvature. |
void OpenTissue::grid::curvature_flow | ( | grid_type const & | phi, | |
real_type const & | mu, | |||
real_type const & | dt, | |||
grid_type & | psi | |||
) | [inline] |
Calculate curvature flow.
WARNING: Unexpected behavior if input and output level sets are the same.
phi | Input level set. | |
mu | Mean Curvature coefficient. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance map then output may not be a signed distance map, thus you may need to redistance output levelset. |
void OpenTissue::grid::dilation | ( | grid_type_in const & | phi, | |
real_type const & | radius, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
Dilate level set.
phi | Input level set. | |
radius | Radius of spherical structural element. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance map then output may not be a signed distance map, thus you may need to redistance output levelset. |
void OpenTissue::grid::div_grad | ( | grid_type const & | phi, | |
grid_type & | M | |||
) | [inline] |
Div-Grad. Computes the divergence of the gradient of a specified field. Ie. the flux of the gradient field!
phi | A the grid. | |
M | A grid containing the values of the divergence of the gradient field of phi. |
void OpenTissue::grid::eigen_curvature | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | k1, | |||
real_type & | k2 | |||
) | [inline] |
Compute principal curvatures based on eigen value decomposition of the shape matrix.
Based on:
Bridson, R., Teran, J., Molino, N. and Fedkiw, R., "Adaptive Physics Based Tetrahedral Mesh Generation Using Level Sets", Engineering with Computers, (in press).
Earlier vesion appears to be (unpublished)
Tetrahedral Mesh Generation for Deformable Bodies Neil Molino (Stanford University) Robert Bridson (Stanford University) Ronald Fedkiw (Stanford University) Submitted to SCA 2003
k1 | Upon return this value contains the first principal curvature. | |
k2 | Upon return this value contains the second principal curvature. |
void OpenTissue::grid::enclosing_indices | ( | grid_type const & | grid, | |
vector3_type const & | point, | |||
size_t & | i0, | |||
size_t & | j0, | |||
size_t & | k0, | |||
size_t & | i1, | |||
size_t & | j1, | |||
size_t & | k1 | |||
) | [inline] |
Get Enclosing Indices. Finds enclosing node indices for a given point. Assumes that the point is strictly inside the volume.
grid | The grid. | |
point | Vector with coordinates of the point. | |
i0 | Upon return, this parameter contains the i-index of the lower-left-back node. | |
j0 | Upon return, this parameter contains the j-index of the lower-left-back node. | |
k0 | Upon return, this parameter contains the k-index of the lower-left-back node. | |
i1 | Upon return, this parameter contains the i-index of the upper-right-front node. | |
j1 | Upon return, this parameter contains the j-index of the upper-right-front node. | |
k1 | Upon return, this parameter contains the k-index of the upper-right-front node. |
void OpenTissue::grid::erosion | ( | grid_type_in const & | phi, | |
real_type const & | radius, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
Erode level set.
phi | Input level set. | |
radius | Radius of spherical structural element. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance map then output may not be a signed distance map, thus you may need to redistance output levelset. |
void OpenTissue::grid::extract_voxels | ( | grid_type_in const & | in, | |
transfer_function const & | func, | |||
grid_type_out & | out | |||
) | [inline] |
Extract Voxels using Transfer Function. The transfer function grids voxels to colors, this function creates a new voxel grid containining all visible colored voxels.
in | A reference to a input voxel grid. | |
func | A reference to the transfer function that should be used. | |
out | Upon return this argument holds the colored voxels. |
void OpenTissue::grid::extrapolation | ( | grid_type & | S, | |
grid_type const & | phi, | |||
size_t | max_iterations = 10 | |||
) | [inline] |
max_iterations | The maximum number of iterations allowed to do extrapolation. | |
stead_threshold | The threshold value used to test for steady state. |
Grid<T,M>& OpenTissue::grid::fabs | ( | Grid< T, M > & | G | ) |
Get absolute value. Note this function changes the values stored in the arugment.
map | The map from which the maximum value is wanted. |
void OpenTissue::grid::fast_blur | ( | grid_type & | image, | |
double | sx, | |||
double | sy, | |||
double | sz, | |||
double | log_base, | |||
size_t | iterations | |||
) | [inline] |
void OpenTissue::grid::fast_blur | ( | grid_type & | image, | |
double | s, | |||
double | log_base, | |||
size_t | iterations | |||
) | [inline] |
void OpenTissue::grid::gaussian_convolution | ( | grid_type const & | src, | |
grid_type & | dst, | |||
real_type | sx, | |||
real_type | sy, | |||
real_type | sz | |||
) | [inline] |
Gaussian Convolution.
src | Input image | |
dst | Upon return holds the resulting output image. | |
sx | Standard deviation in the x-axis direction. | |
sy | Standard deviation in the y-axis direction. | |
sz | Standard deviation in the z-axis direction. |
void OpenTissue::grid::gradient | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
vector3_type & | gradient | |||
) | [inline] |
void OpenTissue::grid::gradient | ( | grid_iterator const & | iter, | |
vector3_type & | gradient | |||
) | [inline] |
grid_iterator::math_types::vector3_type OpenTissue::grid::gradient | ( | grid_iterator const & | iter | ) | [inline] |
vector3_type OpenTissue::grid::gradient_at_point | ( | grid_type const & | grid, | |
vector3_type const & | point | |||
) | [inline] |
void OpenTissue::grid::gradient_magnitude | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | grad_mag | |||
) | [inline] |
void OpenTissue::grid::gradient_magnitude | ( | grid_iterator const & | iter, | |
real_type & | grad_mag | |||
) | [inline] |
grid_iterator::math_types::real_type OpenTissue::grid::gradient_magnitude | ( | grid_iterator const & | iter | ) | [inline] |
void OpenTissue::grid::hessian | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
matrix3x3_type & | H | |||
) | [inline] |
< Pre-computed value of 1./grid.dx()*grid.dx()
< Pre-computed value of 1./grid.dy()*grid.dy()
< Pre-computed value of 1./grid.dz()*grid.dz()
< Pre-computed value of 1./4*grid.dx()*grid.dy()
< Pre-computed value of 1./4*grid.dx()*grid.dz()
< Pre-computed value of 1./4*grid.dy()*grid.dz()
void OpenTissue::grid::hessian | ( | grid_iterator const & | iter, | |
matrix3x3_type & | H | |||
) | [inline] |
OpenTissue::math::Matrix3x3< typename grid_iterator::math_types::real_type > OpenTissue::grid::hessian | ( | grid_iterator const & | iter | ) | [inline] |
grid_iterator::math_types::vector3_type OpenTissue::grid::idx2coord | ( | grid_iterator const & | iter | ) | [inline] |
Index To Coordinate Conversion. This method computes the coordinates of the voxel with indices (i,j,k)
iter | An iterator to the voxel. |
void OpenTissue::grid::idx2coord | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
vector3_type & | point | |||
) | [inline] |
Index To Coordinate Conversion. This method computes the coordinates of the voxel with indices (i,j,k)
map | The grid. | |
i | The index of the voxel along the I-axe. | |
j | The index of the voxel along the J-axe. | |
k | The index of the voxel along the K-axe. | |
point | Upon return this parameter contains the coordinates. |
void OpenTissue::grid::idx2coord | ( | grid_iterator const & | iter, | |
vector3_type & | point | |||
) | [inline] |
Index To Coordinate Conversion. This method computes the coordinates of the voxel with indices (i,j,k)
iter | An iterator to the voxel. | |
point | Upon return this parameter contains the coordinates. |
void OpenTissue::grid::ignore_region | ( | grid_type & | phi, | |
inside_region_tag const & | ||||
) | [inline] |
Mask out inside region. This function masks out the inside region of level set function by assigning the unused value to all phi<0.
phi | The level set grid. |
void OpenTissue::grid::ignore_region | ( | grid_type & | phi, | |
outside_region_tag const & | ||||
) | [inline] |
Mask out outside region. This function masks out the inside region of level set function by assigning the unused value to all phi>0.
phi | The level set grid. |
bool OpenTissue::grid::image_read | ( | std::string const & | directory, | |
std::string const & | filter, | |||
grid_type & | grid | |||
) | [inline] |
Read images into Grid.
Reads a stack of images into a grid data structure. The order of the images are determined by the alphabetic sorting of the filenames and images are stored in increasing k-planes.
It is assumed that all images being read have the same (I,J) dimension, the number of images determined the K-dimension of the resulting grid.
directory | The location of a folder containing image files | |
filter | A file filter, for instance "*.bmp" or "*.png" etc. | |
grid | Upon return holds the grid. |
bool OpenTissue::grid::is_point_inside | ( | grid_type const & | grid, | |
vector3_type const & | point | |||
) | [inline] |
Point Inclusion Test.
Checks if a given points is strictly inside the grid. Notice if point lies on boundary of grid, then it is not consider to be inside the grid.
point | Vector with coordinates for a point. |
void OpenTissue::grid::isosurface_projection | ( | grid_type const & | phi, | |
vector3_iterator | begin, | |||
vector3_iterator | end, | |||
bool | project_inside = true , |
|||
bool | project_outside = true , |
|||
double | isovalue = 0.0 | |||
) | [inline] |
Project Point Cloud Onto Iso-surface.
phi | The (signed distance grid) level set grid. | |
begin | An iterator to the first point that should be projected. | |
end | An iterator to one position past the last point that should be projected. | |
project_inside | Boolan flag indicating whether points lying inside should be projected. | |
project_outside | Boolan flag indicating whether points lying outside should be projected. | |
isovalue | The isovalue of the iso-surface onto which the points should be projected. WARNING if value is larger or smaller than what is actual in stored in phi, then the projection algorithm may run into an infinite loop. |
void OpenTissue::grid::junctions | ( | grid_type const & | aof, | |
grid_type & | phi, | |||
mesh_type & | mesh, | |||
point_container & | points | |||
) | [inline] |
Detect MREP junctions.
KE 2006-02-15: This is work in progress, please ignore it!
aof | A the aof grid. | |
F | A grid containing non-zero values for junctions. |
void OpenTissue::grid::junctions2 | ( | grid_type const & | aof, | |
grid_type const & | phi, | |||
mesh_type & | mesh, | |||
point_container & | points | |||
) | [inline] |
void OpenTissue::grid::laplacian_blur | ( | grid_type & | image, | |
double | diffusion = 1.0 , |
|||
size_t | max_iterations = 10 | |||
) | [inline] |
Solves the PDE
^2 = phi(t=0)
image | The image to blur. | |
diffusion | The value of the diffusion coefficient. | |
max_iterations | The maximum number of iterations allowed. Default is 30 iterations. |
void OpenTissue::grid::local_minima_as_points | ( | grid_type const & | phi, | |
grid_type const & | mask, | |||
point_container & | points | |||
) | [inline] |
Extract Local Minima as Points.
phi | ||
mask | A mask that can be used to mask-out nodes in phi, which is not of interest. Positive values correspond to nodes that are allowed to be classified as local minima. | |
points |
void OpenTissue::grid::local_minima_as_points | ( | grid_type const & | phi, | |
point_container & | points | |||
) | [inline] |
Extract local minima nodes. Note that local minima may exist at non-nodal locations. This function only considers nodal positions. Thus if you are looking for local minima at sub-pixel accuracy, then you need another approach.
phi | The map from where local minima nodes should be extracted from. | |
points | Upon return this container contains all the coordinates of all nodes that where local minima. |
bool OpenTissue::grid::matlab_write | ( | std::string const & | mfile, | |
grid_type const & | grid | |||
) | [inline] |
T OpenTissue::grid::max_element | ( | OpenTissue::grid::Grid< T, M > const & | G | ) |
Get Maximum Value.
map | The map from which the maximum value is wanted. |
grid_iterator::math_types::real_type OpenTissue::grid::mean_curvature | ( | grid_iterator const & | iter | ) | [inline] |
void OpenTissue::grid::mean_curvature | ( | grid_iterator const & | iter, | |
real_type & | K | |||
) | [inline] |
void OpenTissue::grid::mean_curvature | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | K | |||
) | [inline] |
void OpenTissue::grid::mesh2phi | ( | mesh_type & | mesh, | |
grid_type & | phi, | |||
size_t | max_resolution = 64 , |
|||
bool | use_gpu = true | |||
) | [inline] |
Mesh to signed distance field conversion.
This function tries to find a reasonable resolution of a signed distance field and uses t4 gpu scan method to compute the signed distance field.
mesh | A polygonal mesh. | |
phi | Upon return this argument contains a signed distance field of the specified mesh. | |
max_resolution | This argument can be used to set a maximum upper limit on the resolution of the signed distance field. Default value is 64. | |
use_gpu | Boolean flag indicating whether the gpu should be used to compute the signed distance field. Default value is true. |
void OpenTissue::grid::mesh2phi | ( | mesh_type & | mesh, | |
grid_type & | phi, | |||
double | bandsize, | |||
size_t | resolution, | |||
bool | use_gpu = true | |||
) | [inline] |
Mesh to signed distance field conversion.
mesh | A polygonal mesh. | |
phi | Upon return this argument contains a signed distance field of the specified mesh. | |
bandsize | This argument can be used to set the size of a band enclosing the mesh. | |
max_resolution | This argument can be used to set the wanted resolution of the resuling distance field. | |
use_gpu | Boolean flag indicating whether the gpu should be used to compute the signed distance field. Default value is true. |
void OpenTissue::grid::metamorphosis | ( | grid_type & | phi, | |
grid_type const & | gamma, | |||
typename grid_type::math_types::real_type const & | dt | |||
) | [inline] |
Solid Shape Metamorphosis.
Solve the PDE:
{ (x) }{ t} = | (x)| (x)
where usually is an inside-outside function of the target object. Usually the signed distance map of the target is used as . That is
(x) = (x)
It could be defined more genrally as
(x) = f ( (x) )
where the function f is used to control the speed of the moving interface of phi.
The process is controlled by the user by defining the initial overlapping regions of source and target.
The final metamorphosis strategy is
{ (x) }{ t} = | (x)| ( T(x,alpha) )
Given the coordinate transform:
y = T(x,alpha)
where x is a point in source and y is corresponding point in target, and 0 alpha 1 is a parameterization such that
T(x,0) = x T(x,1) = y
The transform T is for instance useful for alignment of the objects.
The flow is implemented using a upwind (Godonov) scheme. Currently implementation do not support the T-transform. The user do have the option of applying an f-function outside the function, since only the gamma-field is surplied to this function.
phi | Input/output level set. | |
gamma | The inside/outside function of the target object. | |
dt | The time-step size. |
void OpenTissue::grid::metamorphosis_speed_function | ( | grid_type const & | phi, | |
grid_type const & | gamma, | |||
grid_type & | F | |||
) | [inline] |
Auxilliary function used by metamorphosis().
This function compute the normal velocity flow.
phi | The current surface | |
gamma | The inside-outside function of target surface | |
F | Upon return contains the normal velocity flow field. |
T OpenTissue::grid::min_element | ( | OpenTissue::grid::Grid< T, M > const & | G | ) |
Get Minimum Value.
map | The map from which the minimum value is wanted. |
Grid<T,M>& OpenTissue::grid::negate | ( | Grid< T, M > & | G | ) |
Negate using '-' operator of class T. This function is thus only valid when T implements unary negation Note this function changes the values stored in the arugment.
map | The map to be negated. |
void OpenTissue::grid::opening | ( | grid_type_in const & | phi, | |
real_type const & | radius, | |||
real_type const & | dt, | |||
grid_type_out & | psi | |||
) | [inline] |
Opening Operation.
phi | Input level set. | |
radius | Radius of spherical structural element. | |
dt | Time-step to use in update. | |
psi | Output levelset. Note if input is a signed distance map then output may not be a signed distance map, thus you may need to redistance output levelset. |
void OpenTissue::grid::poisson_solver | ( | grid_type & | phi, | |
grid_type const & | W, | |||
size_t | max_iterations = 10 | |||
) | [inline] |
Gauss-Seidel Poisson Solver with Pure Von Neuman Boundary Conditions.
Theory: Given the PDE
^2 = W
Solve for phi. Writing out we have
{^2}{ x^2} phi + {^2}{ y^2} phi + {^2}{ z^2} phi = W
Using central diff approximation leads to
a_2 ( phi_{i+1,j,k} + phi_{i-1,j,k} ) + a_1( phi_{i,j+1,k} + phi_{i,j-1,k} ) + a_0( phi_{i,j,k+1} + phi_{i,j,k-1} ) - a_3 W phi_{i,j,k} = -------------------------------------------------------------------------------------------------------------------------------- 2 a_4
where
a_0 = (dx*dx*dy*dy) a_1 = (dx*dx*dz*dz) a_2 = (dy*dy*dz*dz) a_3 = (dx*dx*dy*dy*dz*dz) a_4 = a_0 + a_1 + a_2
In case dx=dy=dz this simplifies to
phi_{i+1,j,k} + phi_{i-1,j,k} + phi_{i,j+1,k} + phi_{i,j-1,k} + phi_{i,j,k+1} + phi_{i,j,k-1} - dx*dx W phi_{i,j,k} = ---------------------------------------------------------------------------------------------------------- 8
The solver uses pure Neumann bondary conditions. i.e.:
phi = 0
on any boundary. This means that values outside boundary are copied from nearest boundary voxel => claming out-of-bound indices onto boundary.
phi | Contains initial guess for solution, and upon return contains the solution. | |
b | The right hand side of the poisson equation. | |
max_iterations | The maximum number of iterations allowed. Default is 30 iterations. |
bool OpenTissue::grid::raw_read | ( | std::string const & | filename, | |
grid_type & | grid | |||
) | [inline] |
Read Raw File. Grid must be initialized to prober dimensions before reading
filename | The path and filename of the raw file | |
grid | Upon return holds the grid. |
void OpenTissue::grid::raw_read_16bit | ( | std::string const & | filename, | |
grid_type & | target | |||
) | [inline] |
Read 16 bit data (mostly just 12 bit)
void OpenTissue::grid::raw_read_8bit | ( | std::string const & | filename, | |
grid_type & | target | |||
) | [inline] |
Read 8 bit data
void OpenTissue::grid::raw_read_8bit_to_16bit | ( | std::string const & | filename, | |
grid_type & | target | |||
) | [inline] |
Read 8 bit data and convert it to 16 bit
bool OpenTissue::grid::raw_write | ( | std::string const & | filename, | |
grid_type & | grid | |||
) | [inline] |
Write Raw file
filename | The path and filename of the raw file. | |
grid | The grid that should be written. |
void OpenTissue::grid::redistance | ( | grid_type const & | phi, | |
grid_type & | psi, | |||
size_t | max_iterations = 10 , |
|||
double | steady_threshold = 0.05 | |||
) | [inline] |
Signed Distance Map Reinitialization.
Brute-force implementation of the reinitialization of the distance function. The following Hamilton-Jacobi equation is solved: d_tau + S(d) * ( |grad phi| - 1 ) = 0 d(x,0) = d_0(x) = phi(x,t) to steady state, with S(d) approximated by: s = d / ( sqrt( d^2 + |Dd|^2 * delta_x^2) )
Calculates gradient magnitude of phi using upwind-scheme. Performs PDE update using forward Euler time discretization.
phi | Input level set that should be redistanced into a signed distance grid. | |
psi | Output level set. That is the redistanced phi. | |
max_iterations | The maximum number of iterations allowed to do re-initialization. | |
stead_threshold | The threshold value used to test for steady state. |
void OpenTissue::grid::resample | ( | grid_type const & | M, | |
grid_type & | m, | |||
real_type | factor_i, | |||
real_type | factor_j, | |||
real_type | factor_k | |||
) | [inline] |
Resample a grid to lower dimensions.
M | Original grid to be resampled. | |
m | Destination grid. | |
factor_i | Scale factor in the I-direction of the grid. | |
factor_j | Scale factor in the J-direction of the grid. | |
factor_k | Scale factor in the K-direction of the grid. |
void OpenTissue::grid::rescale_range | ( | grid_type & | grid, | |
typename grid_type::value_type | src_min, | |||
typename grid_type::value_type | src_max, | |||
typename grid_type::value_type | dst_min, | |||
typename grid_type::value_type | dst_max | |||
) | [inline] |
Rescale input range to output range.
grid | The grid to re-scale. | |
src_min | Scale factor in the I-direction of the grid. | |
src_max | Scale factor in the J-direction of the grid. | |
dst_min | Scale factor in the K-direction of the grid. | |
dst_max | Scale factor in the K-direction of the grid. |
Grid<T,M>& OpenTissue::grid::scale | ( | Grid< T, M > & | G, | |
T | fac | |||
) |
void OpenTissue::grid::second_derivative | ( | grid_iterator const & | iter, | |
real_type & | derivative | |||
) | [inline] |
void OpenTissue::grid::second_derivative | ( | grid_type const & | grid, | |
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
real_type & | derivative | |||
) | [inline] |
grid_iterator::math_types::real_type OpenTissue::grid::second_derivative | ( | grid_iterator const & | iter | ) | [inline] |
void OpenTissue::grid::split2slices | ( | grid_type & | grid, | |
grid_container & | slices, | |||
size_t | axis = 2 | |||
) | [inline] |
Split a 3D grid into multiple 2D grids along some major axis.
grid | The grid that should be split inot slices. | |
slices | Upon return this container holds grids corresponding to all the slices. | |
axis | The axis to split along. |
void OpenTissue::grid::strict_local_minima_as_points | ( | grid_type const & | phi, | |
grid_type const & | mask, | |||
point_container & | points | |||
) | [inline] |
Extract Strict Local Minima as Points.
phi | ||
mask | A mask that can be used to mask-out nodes in phi, which is not of interest. Positive values correspond to nodes that are allowed to be classified as local minima. | |
points |
void OpenTissue::grid::strict_local_minima_as_points | ( | grid_type const & | phi, | |
point_container & | points | |||
) | [inline] |
Extract local minima nodes. Note that local minima may exist at non-nodal locations. This function only considers nodal positions. Thus if you are looking for local minima at sub-pixel accuracy, then you need another approach.
phi | The map from where local minima nodes should be extracted from. | |
points | Upon return this container contains all the coordinates of all nodes that where local minima. |
void OpenTissue::grid::transform | ( | input_iterator | in_begin, | |
input_iterator | in_end, | |||
output_iterator | out_begin, | |||
function_type | func | |||
) | [inline] |
This is great for generating maps from other maps, say we want a map, G, with the gradient magnitude of another map, U. Then simply write:
transform( U.begin() , U.end() , G.begin() , boost::bind( gradient_magnitude<intensity_iterator> , _1 ) );
This is very similar to the std::transform. The major difference is that std::transform dereference an iterator before invoking the functor. The transform version simply invokes the functor by passing the iterator as argument.
This is important because map iterators contain spatial information about the location of the iterator. This location information is for instance needed for finite difference computations etc..
in_begin | ||
in_end | ||
out_begin | ||
func |
void OpenTissue::grid::translate | ( | grid_type const & | src, | |
vector3_int_type const & | v, | |||
grid_type & | dst | |||
) | [inline] |
Translate a grid by an integer vector and wrap around at border.
Behavior is un-expected if input and output grid is the same.... TODO: make it work for zero-trans and negative trans.
src | Source grid to be translated. | |
v | translation vector. | |
dst | Upon return, contains the translated grid. |
void OpenTissue::grid::uniform_point_sampling | ( | grid_type const & | phi, | |
vector3_container & | points, | |||
size_t | sub_sample = 2u | |||
) | [inline] |
Uniform Point Sampling of Grid.
phi | The (signed distance grid) level set grid. | |
points | Upon return this container containts the random points. | |
sub_Sample | Optimal argument, allows one to control the density of points. |
void OpenTissue::grid::upwind_gradient | ( | grid_type const & | phi, | |
grid_type const & | F, | |||
size_t | i, | |||
size_t | j, | |||
size_t | k, | |||
vector3_type & | gradient | |||
) | [inline] |
Compute Upwind Gradient at Specified Node location.
phi | A the map in which we want to know the gradient. | |
F | A map containing the values of the speed function. | |
i | The i'th index of the node at which we want to compute the gradient. | |
j | The j'th index of the node at which we want to compute the gradient. | |
k | The k'th index of the node at which we want to compute the gradient. | |
gradient | Upon completion contains the upwind gradient |
void OpenTissue::grid::upwind_gradient_field | ( | grid_type const & | phi, | |
grid_type const & | F, | |||
grid_type & | Nx, | |||
grid_type & | Ny, | |||
grid_type & | Nz | |||
) | [inline] |
Picks upwind direction of gradient according to the speed function (F).
grid_type::value_type OpenTissue::grid::value_at_point | ( | grid_type const & | grid, | |
vector3_type const & | point | |||
) | [inline] |
Warning this method do not test whether the point lies inside the grid. If the point is outside the behavior is undefined.
void OpenTissue::grid::voxel_plane_clip | ( | grid_type const & | voxels, | |
plane_type const & | plane, | |||
grid_type & | below, | |||
grid_type & | above | |||
) | [inline] |
Clip a voxelgrid against a plane.
voxels | Input voxel grid. | |
plane | Plane to clip against. | |
below | Upon return, contains grid of all voxels below plane. | |
above | Upon return, contains grid of all voxels above plane. |