Functions
contrib/mul/vil3d/vil3d_trilin_interp.h File Reference

Trilinear interpolation functions for 3D images. More...

#include <vcl_cassert.h>
#include <vcl_cstddef.h>
#include <vil/vil_na.h>
#include <vil3d/vil3d_image_view.h>

Go to the source code of this file.

Functions

template<class T >
double vil3d_trilin_interp_raw (double x, double y, double z, const T *data, vcl_ptrdiff_t xstep, vcl_ptrdiff_t ystep, vcl_ptrdiff_t zstep)
 Compute trilinear interpolation at (x,y,z), no bound checks.
template<class T >
double vil3d_trilin_interp_safe (double x, double y, double z, const T *data, unsigned nx, unsigned ny, unsigned nz, vcl_ptrdiff_t xstep, vcl_ptrdiff_t ystep, vcl_ptrdiff_t zstep, double outval=0)
 Compute trilinear interpolation at (x,y,z), with bound checks.
template<class T >
double vil3d_trilin_interp_safe (const vil3d_image_view< T > &image, double x, double y, double z, unsigned p=0, T outval=0)
 Compute trilinear interpolation at (x,y,z,p), with bound checks.
template<class T >
double vil3d_trilin_interp_assert (double x, double y, double z, const T *data, unsigned nx, unsigned ny, unsigned nz, vcl_ptrdiff_t xstep, vcl_ptrdiff_t ystep, vcl_ptrdiff_t zstep)
 Compute trilinear interpolation at (x,y), with bound checks.
template<class T >
double vil3d_trilin_interp_safe_extend (double x, double y, double z, const T *data, unsigned nx, unsigned ny, unsigned nz, vcl_ptrdiff_t xstep, vcl_ptrdiff_t ystep, vcl_ptrdiff_t zstep)
 Compute trilinear interpolation at (x,y), with bounds checks.
template<class T >
double vil3d_trilin_interp_safe_edgena (double x, double y, double z, const T *data, unsigned nx, unsigned ny, unsigned nz, vcl_ptrdiff_t xstep, vcl_ptrdiff_t ystep, vcl_ptrdiff_t zstep)
 Compute trilinear interpolation at (x,y), with bounds checks.
template<class T >
double vil3d_trilin_interp_safe_extend (const vil3d_image_view< T > &image, double x, double y, double z, unsigned p=0)
 Compute trilinear interpolation at (x,y), using the nearest valid value if out of bounds.

Detailed Description

Trilinear interpolation functions for 3D images.

Author:
Tim Cootes

Definition in file vil3d_trilin_interp.h.


Function Documentation

template<class T >
double vil3d_trilin_interp_assert ( double  x,
double  y,
double  z,
const T *  data,
unsigned  nx,
unsigned  ny,
unsigned  nz,
vcl_ptrdiff_t  xstep,
vcl_ptrdiff_t  ystep,
vcl_ptrdiff_t  zstep 
) [inline]

Compute trilinear interpolation at (x,y), with bound checks.

Image is nx * ny * nz array of Ts. x,y element is data[nx*y+x] If (x,y) is outside interpolatable image region and NDEBUG is not defined the code will fail an ASSERT. The safe interpolatable region is [0,nx)*[0,ny)*[0,nz].

Definition at line 89 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_raw ( double  x,
double  y,
double  z,
const T *  data,
vcl_ptrdiff_t  xstep,
vcl_ptrdiff_t  ystep,
vcl_ptrdiff_t  zstep 
) [inline]

Compute trilinear interpolation at (x,y,z), no bound checks.

Image is nx * ny * nz array of T. x,y,z element is data[z*zstep+ystep*y+x*xstep] No bound checks are done.

Definition at line 18 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_safe ( double  x,
double  y,
double  z,
const T *  data,
unsigned  nx,
unsigned  ny,
unsigned  nz,
vcl_ptrdiff_t  xstep,
vcl_ptrdiff_t  ystep,
vcl_ptrdiff_t  zstep,
double  outval = 0 
) [inline]

Compute trilinear interpolation at (x,y,z), with bound checks.

Image is nx * ny * nz array of T. x,y,z element is data[z*zstep+ystep*y+x*xstep] If (x,y,z) is outside interpolatable image region, returns zero or outval

Definition at line 54 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_safe ( const vil3d_image_view< T > &  image,
double  x,
double  y,
double  z,
unsigned  p = 0,
outval = 0 
) [inline]

Compute trilinear interpolation at (x,y,z,p), with bound checks.

Image is nx * ny * nz array of T. x,y,z element is data[z*zstep+ystep*y+x*xstep] If (x,y,z) is outside interpolatable image region, returns zero or outval

Definition at line 72 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_safe_edgena ( double  x,
double  y,
double  z,
const T *  data,
unsigned  nx,
unsigned  ny,
unsigned  nz,
vcl_ptrdiff_t  xstep,
vcl_ptrdiff_t  ystep,
vcl_ptrdiff_t  zstep 
) [inline]

Compute trilinear interpolation at (x,y), with bounds checks.

Image is nx * ny array of Ts. x,y element is data[nx*y+x] If (x,y,z) is outside safe interpolatable image region, NA is returned.

Definition at line 123 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_safe_extend ( double  x,
double  y,
double  z,
const T *  data,
unsigned  nx,
unsigned  ny,
unsigned  nz,
vcl_ptrdiff_t  xstep,
vcl_ptrdiff_t  ystep,
vcl_ptrdiff_t  zstep 
) [inline]

Compute trilinear interpolation at (x,y), with bounds checks.

Image is nx * ny array of Ts. x,y element is data[nx*y+x] If (x,y,z) is outside safe interpolatable image region, nearest pixel value is returned.

Definition at line 106 of file vil3d_trilin_interp.h.

template<class T >
double vil3d_trilin_interp_safe_extend ( const vil3d_image_view< T > &  image,
double  x,
double  y,
double  z,
unsigned  p = 0 
) [inline]

Compute trilinear interpolation at (x,y), using the nearest valid value if out of bounds.

If (x,y,z) is outside safe interpolatable image region, nearest pixel value is returned.

Definition at line 134 of file vil3d_trilin_interp.h.