00001
00002 #ifndef vimt_crop_h_
00003 #define vimt_crop_h_
00004
00005
00006
00007
00008
00009
00010 #include <vimt/vimt_image_2d_of.h>
00011 #include <vil/vil_crop.h>
00012
00013
00014
00015
00016
00017
00018 template<class T>
00019 vimt_image_2d_of<T> vimt_crop(const vimt_image_2d_of<T>& im,
00020 unsigned x0, unsigned nx,
00021 unsigned y0, unsigned ny)
00022 {
00023 vimt_transform_2d trans;
00024 trans.set_translation(-double(x0),-double(y0));
00025 return vimt_image_2d_of<T>(vil_crop(im.image(),x0,nx,y0,ny),trans*im.world2im());
00026 }
00027
00028
00029
00030 #endif // vimt_crop_h_