Defines | Functions
contrib/mul/vil3d/vil3d_resample_trilinear.txx File Reference

Resample a 3D image by a different factor in each dimension. More...

#include "vil3d_resample_trilinear.h"
#include <vil/vil_convert.h>
#include <vil3d/vil3d_trilin_interp.h>
#include <vil3d/vil3d_plane.h>
#include <vcl_cassert.h>

Go to the source code of this file.

Defines

#define vil3d_resample_trilinear_txx_
#define VIL3D_RESAMPLE_TRILINEAR_INSTANTIATE(T, S)

Functions

bool vil3dresample_trilin_corner_in_image (double x0, double y0, double z0, const vil3d_image_view_base &image)
template<class S , class T >
void vil3d_resample_trilinear_edge_extend (const vil3d_image_view< S > &src_image, vil3d_image_view< T > &dest_image, double x0, double y0, double z0, double dx1, double dy1, double dz1, double dx2, double dy2, double dz2, double dx3, double dy3, double dz3, int n1, int n2, int n3)
 Sample grid of points in one image and place in another, using trilinear interpolation and edge extension.
template<class S , class T >
void vil3d_resample_trilinear (const vil3d_image_view< S > &src_image, vil3d_image_view< T > &dest_image, double x0, double y0, double z0, double dx1, double dy1, double dz1, double dx2, double dy2, double dz2, double dx3, double dy3, double dz3, int n1, int n2, int n3, T outval, double edge_tol)
 Sample grid of points in one image and place in another, using trilinear interpolation.
template<class S , class T >
void vil3d_resample_trilinear (const vil3d_image_view< S > &src_image, vil3d_image_view< T > &dest_image, int n1, int n2, int n3)
 Resample image to a specified dimensions (n1 * n2 * n3).
template<class T >
void vil3d_resample_trilinear (const vil3d_image_view< T > &src_image, vil3d_image_view< T > &dst_image, const double dx, const double dy, const double dz)
 Resample a 3D image by a different factor in each dimension.
template<class T >
void vil3d_resample_trilinear_scale_2 (const vil3d_image_view< T > &src_im, vil3d_image_view< T > &dest_im)
 Resample a 3D image by a factor of 2 in each dimension.

Detailed Description

Resample a 3D image by a different factor in each dimension.

Author:
Kevin de Souza, Ian Scott

Definition in file vil3d_resample_trilinear.txx.


Define Documentation

#define VIL3D_RESAMPLE_TRILINEAR_INSTANTIATE (   T,
 
)
Value:
template void vil3d_resample_trilinear(const vil3d_image_view< S >& src_image, \
                                       vil3d_image_view< T >& dest_image, \
                                       double x0, double y0, double z0, \
                                       double dx1, double dy1, double dz1, \
                                       double dx2, double dy2, double dz2, \
                                       double dx3, double dy3, double dz3, \
                                       int n1, int n2, int n3, \
                                       T outval, double edge_tol); \
template void vil3d_resample_trilinear_edge_extend(const vil3d_image_view< S >& src_image, \
                                                   vil3d_image_view< T >& dest_image, \
                                                   double x0, double y0, double z0, \
                                                   double dx1, double dy1, double dz1, \
                                                   double dx2, double dy2, double dz2, \
                                                   double dx3, double dy3, double dz3, \
                                                   int n1, int n2, int n3); \
template void vil3d_resample_trilinear(const vil3d_image_view< S >& src_image, \
                                       vil3d_image_view< T >& dest_image, \
                                       int n1, int n2, int n3); \
template void vil3d_resample_trilinear(const vil3d_image_view< T >& src_image, \
                                       vil3d_image_view< T >& dst_image, \
                                       const double dx, \
                                       const double dy, \
                                       const double dz); \
template void vil3d_resample_trilinear_scale_2(const vil3d_image_view< T >& src_image, \
                                               vil3d_image_view< T >& dst_image)

Definition at line 595 of file vil3d_resample_trilinear.txx.

#define vil3d_resample_trilinear_txx_

Definition at line 3 of file vil3d_resample_trilinear.txx.


Function Documentation

template<class S , class T >
void vil3d_resample_trilinear ( const vil3d_image_view< S > &  src_image,
vil3d_image_view< T > &  dest_image,
double  x0,
double  y0,
double  z0,
double  dx1,
double  dy1,
double  dz1,
double  dx2,
double  dy2,
double  dz2,
double  dx3,
double  dy3,
double  dz3,
int  n1,
int  n2,
int  n3,
outval = 0,
double  edge_tol = 0 
)

Sample grid of points in one image and place in another, using trilinear interpolation.

dest_image(i,j,k,p) is sampled from the src_image at (x0+i.dx1+j.dx2+k.dx3, y0+i.dy1+j.dy2+k.dy3, z0+i.dz1+j.dz2+k.dz3), where i=[0..n1-1], j=[0..n2-1], k=[0..n3-1]. dest_image resized to (n1,n2,n3,src_image.nplanes()) Points outside image return zero or outval

Definition at line 205 of file vil3d_resample_trilinear.txx.

template<class S , class T >
void vil3d_resample_trilinear ( const vil3d_image_view< S > &  src_image,
vil3d_image_view< T > &  dest_image,
int  n1,
int  n2,
int  n3 
)

Resample image to a specified dimensions (n1 * n2 * n3).

Definition at line 367 of file vil3d_resample_trilinear.txx.

template<class T >
void vil3d_resample_trilinear ( const vil3d_image_view< T > &  src_image,
vil3d_image_view< T > &  dst_image,
const double  dx,
const double  dy,
const double  dz 
)

Resample a 3D image by a different factor in each dimension.

dst_image resized by factors dx, dy, dz.

Note:
The upper image boundaries are extended.
Parameters:
dxScaling factor >1
dyScaling factor >1
dzScaling factor >1 dst_image(i, j, k, p) is sampled from src_image(i/dx, j/dy, k/dz, p). Interpolated values are rounded when the type T is smaller than double.

Definition at line 396 of file vil3d_resample_trilinear.txx.

template<class S , class T >
void vil3d_resample_trilinear_edge_extend ( const vil3d_image_view< S > &  src_image,
vil3d_image_view< T > &  dest_image,
double  x0,
double  y0,
double  z0,
double  dx1,
double  dy1,
double  dz1,
double  dx2,
double  dy2,
double  dz2,
double  dx3,
double  dy3,
double  dz3,
int  n1,
int  n2,
int  n3 
)

Sample grid of points in one image and place in another, using trilinear interpolation and edge extension.

dest_image(i,j,k,p) is sampled from the src_image at (x0+i.dx1+j.dx2+k.dx3, y0+i.dy1+j.dy2+k.dy3, z0+i.dz1+j.dz2+k.dz3), where i=[0..n1-1], j=[0..n2-1], k=[0..n3-1]. dest_image resized to (n1,n2,n3,src_image.nplanes()) Points outside src_image return the value of the nearest valid pixel.

Definition at line 37 of file vil3d_resample_trilinear.txx.

template<class T >
void vil3d_resample_trilinear_scale_2 ( const vil3d_image_view< T > &  src_image,
vil3d_image_view< T > &  dst_image 
)

Resample a 3D image by a factor of 2 in each dimension.

dst_image is resized to 2*src_image.n?()-1 in each direction. Interpolated values are truncated when the type T is smaller than double.

Definition at line 496 of file vil3d_resample_trilinear.txx.

bool vil3dresample_trilin_corner_in_image ( double  x0,
double  y0,
double  z0,
const vil3d_image_view_base image 
) [inline]

Definition at line 17 of file vil3d_resample_trilinear.txx.