Functions
contrib/mul/vimt3d/vimt3d_crop.h File Reference

Create windows into vimt3d_images. More...

#include <vimt3d/vimt3d_image_3d_of.h>
#include <vil3d/vil3d_crop.h>
#include <vgl/vgl_box_3d.h>
#include <vcl_cmath.h>
#include <vcl_cassert.h>
#include <vcl_algorithm.h>

Go to the source code of this file.

Functions

template<class T >
vimt3d_image_3d_of< T > vimt3d_crop (const vimt3d_image_3d_of< T > &im, unsigned x0, unsigned nx, unsigned y0, unsigned ny, unsigned z0, unsigned nz)
 Create windowed view of given image by specifying a cropping region in image co-ords.
template<class T >
vimt3d_image_3d_of< T > vimt3d_crop (const vimt3d_image_3d_of< T > &im, const vgl_box_3d< double > &bbox)
 Create windowed view of given image by specifying a bounding box in world co-ords.

Detailed Description

Create windows into vimt3d_images.

Author:
Kevin de Souza, Tim Cootes, Ian Scott

Definition in file vimt3d_crop.h.


Function Documentation

template<class T >
vimt3d_image_3d_of<T> vimt3d_crop ( const vimt3d_image_3d_of< T > &  im,
unsigned  x0,
unsigned  nx,
unsigned  y0,
unsigned  ny,
unsigned  z0,
unsigned  nz 
)

Create windowed view of given image by specifying a cropping region in image co-ords.

The world2im transform is set so that this appears identical to im when addressed in world co-ords.

Parameters:
imThe input image.
x0The origin (lower corner) of the cropping region in image coords.
y0The origin (lower corner) of the cropping region in image coords.
z0The origin (lower corner) of the cropping region in image coords.
nxThe width of the cropping region in image coords.
nyThe height of the cropping region in image coords.
nzThe depth of the cropping region in image coords.
Returns:
A cropped view of the original image.

Definition at line 27 of file vimt3d_crop.h.

template<class T >
vimt3d_image_3d_of<T> vimt3d_crop ( const vimt3d_image_3d_of< T > &  im,
const vgl_box_3d< double > &  bbox 
)

Create windowed view of given image by specifying a bounding box in world co-ords.

The world2im transform is set so that this appears identical to im when addressed in world co-ords.

Parameters:
imThe input image.
bboxBounding box of desired crop region in world coords.
Returns:
A cropped view of the original image.
Note:
The crop region may be expanded slightly as required to fit the voxel grid.
If the crop region extends outside the image, it is truncated to fit the image.

Definition at line 47 of file vimt3d_crop.h.