contrib/mul/vil3d/algo/vil3d_make_distance_filter.h
Go to the documentation of this file.
00001 #ifndef vil3d_make_distance_filter_h_
00002 #define vil3d_make_distance_filter_h_
00003 //:
00004 //  \file
00005 //  \brief Compute filter for a distance transform.
00006 //  \author Tim Cootes
00007 
00008 #include <vil3d/algo/vil3d_structuring_element.h>
00009 
00010 //: Create filter such that d[a] is distance from origin of se[a]
00011 //  Pixel widths are (width_i,width_j,width_k).  Elements are 
00012 //  selected so that only voxels visited before in a raster scan 
00013 //  of the image are included.  Distance transforms require two
00014 //  passes, a forward and reverse pass.
00015 //
00016 //  Consider only voxels within 1 voxel (1 norm) of origin.
00017 //  Indexes (27-1)/2 = 13 voxels.
00018 void vil3d_make_distance_filter_r1(
00019                            double width_i, 
00020                            double width_j, 
00021                            double width_k,
00022                            vil3d_structuring_element& se,
00023                            vcl_vector<double>& d);
00024 
00025 //: Create filter such that d[a] is distance from origin of se[a]
00026 //  Pixel widths are (width_i,width_j,width_k).  Elements are 
00027 //  selected so that only voxels visited before in a raster scan 
00028 //  of the image are included.  Distance transforms require two
00029 //  passes, a forward and reverse pass.
00030 //
00031 //  Consider only voxels within r voxels (1 norm) of origin.
00032 void vil3d_make_distance_filter(
00033                            double width_i, 
00034                            double width_j, 
00035                            double width_k,
00036                            int r,
00037                            vil3d_structuring_element& se,
00038                            vcl_vector<double>& d);
00039 
00040 #endif // vil3d_make_distance_filter_h_