00001 // This is contrib/mul/vil3d/algo/vil3d_world_gradients.h 00002 #ifndef vil3d_world_gradients_h_ 00003 #define vil3d_world_gradients_h_ 00004 //: 00005 // \file 00006 // \brief Given image gradients compute world gradients and gradient magnitude 00007 // \author Tim Cootes 00008 00009 #include <vil3d/vil3d_image_view.h> 00010 00011 //: Given image gradients compute world gradients and gradient magnitude 00012 // Input gradient images are assumed to be un-normalised pixel gradients 00013 // (ie no scaling has been done to take account of world pixel widths). 00014 // Divides each by corresponding pixel dimension to give gradient in world units 00015 // (ie intensity change per unit world length) in world_grad (3 plane image) 00016 // The gradient magnitude output is in units of intensity change per world length 00017 // (ie it does take account of voxel sizes). 00018 // 00019 // Note: Currently assumes single plane only. 00020 // 1 pixel border around output set to zero. 00021 // 00022 // \relatesalso vil3d_image_view 00023 template<class srcT, class destT> 00024 void vil3d_world_gradients(const vil3d_image_view<srcT>& grad_i, 00025 const vil3d_image_view<srcT>& grad_j, 00026 const vil3d_image_view<srcT>& grad_k, 00027 double voxel_width_i, 00028 double voxel_width_j, 00029 double voxel_width_k, 00030 vil3d_image_view<destT>& world_grad, 00031 vil3d_image_view<destT>& grad_mag); 00032 #endif // vil3d_world_gradients_h_