Functions
contrib/mul/vil3d/algo/vil3d_max_product_filter.h File Reference

Apply non-linear filter to a 3D image in raster order. More...

#include <vil3d/algo/vil3d_structuring_element.h>
#include <vil3d/vil3d_image_view.h>
#include <vcl_cassert.h>

Go to the source code of this file.

Functions

template<class T >
vil3d_max_product_filter (const T *im, const vcl_ptrdiff_t *offset, const double *f, unsigned n)
 Return max(im[0],max_i (f[i]*im[offset[i]])).
template<class T >
vil3d_max_product_filter (const vil3d_image_view< T > &image, const vil3d_structuring_element &se, const vcl_vector< double > &f, int i0, int j0, int k0)
 Compare voxel (i0,j0,k0) with weighted versions of offset voxels.
template<class T >
void vil3d_max_product_filter (vil3d_image_view< T > &image, const vil3d_structuring_element &se, const vcl_vector< double > &f)
 Performs raster scan through image, comparing each voxel with neighbours.

Detailed Description

Apply non-linear filter to a 3D image in raster order.

Author:
Tim Cootes

Definition in file vil3d_max_product_filter.h.


Function Documentation

template<class T >
T vil3d_max_product_filter ( const T *  im,
const vcl_ptrdiff_t *  offset,
const double *  f,
unsigned  n 
) [inline]

Return max(im[0],max_i (f[i]*im[offset[i]])).

Thus compare current voxel with weighted versions of n offset, voxels, returning the largest value. Assumes bound checking has already been done

Definition at line 17 of file vil3d_max_product_filter.h.

template<class T >
T vil3d_max_product_filter ( const vil3d_image_view< T > &  image,
const vil3d_structuring_element se,
const vcl_vector< double > &  f,
int  i0,
int  j0,
int  k0 
) [inline]

Compare voxel (i0,j0,k0) with weighted versions of offset voxels.

Return max(image(i0,i1,i2),max_i (f[i]*image(i0+p_i[i],j0+p_j[i],k0+p_k[i],plane) Performs bound checks to ensure voxels are valid

Definition at line 34 of file vil3d_max_product_filter.h.

template<class T >
void vil3d_max_product_filter ( vil3d_image_view< T > &  image,
const vil3d_structuring_element se,
const vcl_vector< double > &  f 
)

Performs raster scan through image, comparing each voxel with neighbours.

Runs through every voxel in raster order. Each voxel is compared with weighted versions of offset voxels, and is replaced with the maximum value.

Replace each voxel with max(im(i,j,k),max_a (f[a]*im(i+p_i[a],j+p_j[a],k+p_k[a],plane))

If a suitable combination of se and f is chosen, this performs half an 'exponential distance transform'. For an example of use, see vil3d_exp_distance_transform.

Definition at line 71 of file vil3d_max_product_filter.h.