contrib/mul/vil3d/vil3d_switch_axes.h
Go to the documentation of this file.
00001 #ifndef vil3d_switch_axes_h_
00002 #define vil3d_switch_axes_h_
00003 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00004 #pragma interface
00005 #endif
00006 //:
00007 // \file
00008 // \author Tim Cootes.
00009 
00010 #include <vil3d/vil3d_image_view.h>
00011 
00012 //: Change axes so that result(j,i,k)==im(i,j,k)
00013 // \relatesalso vil3d_image_view
00014 template<class T>
00015 inline vil3d_image_view<T> vil3d_switch_axes_jik(const vil3d_image_view<T> &im)
00016 {
00017   return vil3d_image_view<T>(im.memory_chunk(),im.origin_ptr(),
00018                              im.nj(),im.ni(),im.nk(),im.nplanes(),
00019                              im.jstep(),im.istep(),im.kstep(),im.planestep());
00020 }
00021 
00022 //: Change axes so that result(j,k,i)==im(i,j,k)
00023 // \relatesalso vil3d_image_view
00024 template<class T>
00025 inline vil3d_image_view<T> vil3d_switch_axes_jki(const vil3d_image_view<T> &im)
00026 {
00027   return vil3d_image_view<T>(im.memory_chunk(),im.origin_ptr(),
00028                              im.nj(),im.nk(),im.ni(),im.nplanes(),
00029                              im.jstep(),im.kstep(),im.istep(),im.planestep());
00030 }
00031 
00032 //: Change axes so that result(k,i,j)==im(i,j,k)
00033 // \relatesalso vil3d_image_view
00034 template<class T>
00035 inline vil3d_image_view<T> vil3d_switch_axes_kij(const vil3d_image_view<T> &im)
00036 {
00037   return vil3d_image_view<T>(im.memory_chunk(),im.origin_ptr(),
00038                              im.nk(),im.ni(),im.nj(),im.nplanes(),
00039                              im.kstep(),im.istep(),im.jstep(),im.planestep());
00040 }
00041 
00042 //: Change axes so that result(k,j,i)==im(i,j,k)
00043 // \relatesalso vil3d_image_view
00044 template<class T>
00045 inline vil3d_image_view<T> vil3d_switch_axes_kji(const vil3d_image_view<T> &im)
00046 {
00047   return vil3d_image_view<T>(im.memory_chunk(),im.origin_ptr(),
00048                              im.nk(),im.nj(),im.ni(),im.nplanes(),
00049                              im.kstep(),im.jstep(),im.istep(),im.planestep());
00050 }
00051 
00052 //: Change axes so that result(i,k,j)==im(i,j,k)
00053 // \relatesalso vil3d_image_view
00054 template<class T>
00055 inline vil3d_image_view<T> vil3d_switch_axes_ikj(const vil3d_image_view<T> &im)
00056 {
00057   return vil3d_image_view<T>(im.memory_chunk(),im.origin_ptr(),
00058                              im.ni(),im.nk(),im.nj(),im.nplanes(),
00059                              im.istep(),im.kstep(),im.jstep(),im.planestep());
00060 }
00061 
00062 #endif // vil3d_switch_axes_h_