Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Related Functions
vimt3d_image_3d_of< T > Class Template Reference

Represent 3D image of type T together with a transform. More...

#include <vimt3d_image_3d_of.h>

Inheritance diagram for vimt3d_image_3d_of< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vimt3d_image_3d_of ()
 Construct an empty one-plane image.
 vimt3d_image_3d_of (unsigned ni, unsigned nj, unsigned nk, unsigned np=1, const vimt3d_transform_3d &w2i=vimt3d_transform_3d())
 Construct an image of size (ni, nj, nk, np) with optional world_to_image transform w2i.
 vimt3d_image_3d_of (const vil3d_image_view< T > &view, const vimt3d_transform_3d &w2i)
 Construct from a view and a world-to-image transform.
virtual ~vimt3d_image_3d_of ()
 Destructor.
virtual const
vil3d_image_view_base
image_base () const
 Base class view of image.
vil3d_image_view< T > & image ()
 Image view.
const vil3d_image_view< T > & image () const
 Image view.
unsigned n_planes () const
 Get the number of planes in the image.
bool operator== (const vimt3d_image_3d_of< T > &) const
 True if transforms are equal, and they share same image data.
void set_valid_region (int i0, unsigned ni, int j0, unsigned nj, int k0, unsigned nk)
 Define valid data region (including transform).
void deep_copy (const vimt3d_image_3d_of &image)
 Take a deep copy of image (copy data, not just pointers).
short version_no () const
 Version number for I/O.
virtual vcl_string is_a () const
 Name of the class.
virtual bool is_class (vcl_string const &s) const
 Does the name of the class match the argument?.
virtual vimt_imageclone () const
 Create a copy on the heap and return base class pointer.
virtual vimt_imagedeep_clone () const
 Create a deep copy on the heap and return base class pointer.
virtual void print_summary (vcl_ostream &os) const
 Print class to os.
virtual void print_all (vcl_ostream &os) const
 print all data to os (rounds output to int).
virtual void b_write (vsl_b_ostream &bfs) const
 Save class to binary file stream.
virtual void b_read (vsl_b_istream &bfs)
 Load class from binary file stream.
virtual unsigned n_dims () const
 Return dimensionality of image.
virtual vcl_vector< unsigned > image_size () const
 Return 3 element vector indicating size of image in pixels.
virtual void world_bounds (vcl_vector< double > &b_lo, vcl_vector< double > &b_hi) const
 Return 3D vectors defining bounding box containing image in world co-ords.
virtual vcl_vector< double > pixel_size () const
 Return 3 element vector indicating the size of a pixel.
const vimt3d_transform_3dworld2im () const
 Current world-to-image transformation.
vimt3d_transform_3dworld2im ()
 Current world-to-image transformation.
void set_world2im (const vimt3d_transform_3d &w2i)
 Set world-to-image transformation.
bool operator== (const vimt_image &) const

Protected Attributes

vimt3d_transform_3d world2im_

Private Member Functions

bool equals (const vimt_image &) const
 Shallow equality tester.

Private Attributes

vil3d_image_view< T > image_

Related Functions

(Note that these are not member functions.)

template<class sType , class dType >
void vimt3d_resample_tricubic_edge_extend (const vimt3d_image_3d_of< sType > &src_image, vimt3d_image_3d_of< dType > &dest_image, const vgl_point_3d< double > &p, const vgl_vector_3d< double > &u, const vgl_vector_3d< double > &v, const vgl_vector_3d< double > &w, int ni, int nj, int nk)
 Sample grid of points in one image and place in another, using tricubic interpolation.
template<class sType , class dType >
void vimt3d_resample_trilin_edge_extend (const vimt3d_image_3d_of< sType > &src_image, vimt3d_image_3d_of< dType > &dest_image, const vgl_point_3d< double > &p, const vgl_vector_3d< double > &u, const vgl_vector_3d< double > &v, const vgl_vector_3d< double > &w, int ni, int nj, int nk)
 Sample grid of points in one image and place in another, using trilinear interpolation.
template<class sType , class dType >
void vimt3d_resample_trilin_smoothing_edge_extend (const vimt3d_image_3d_of< sType > &src_image, vimt3d_image_3d_of< dType > &dest_image, const vgl_point_3d< double > &p, const vgl_vector_3d< double > &u, const vgl_vector_3d< double > &v, const vgl_vector_3d< double > &w, int ni, int nj, int nk)
 Resample an image using appropriate smoothing if the resolution changes significantly.
template<class sType , class dType >
void vimt3d_resample_trilin_smoothing_edge_extend (const vimt3d_image_3d_of< sType > &src, vimt3d_image_3d_of< dType > &dest)
 Resample src, using the grid defined by dest.

Detailed Description

template<class T>
class vimt3d_image_3d_of< T >

Represent 3D image of type T together with a transform.

Each plane is ni() x nj() Ts, with the (x,y) element of the i'th plane accessible using im.plane(i)[x*im.istep() + y*im.jstep()]

Definition at line 21 of file vimt3d_image_3d_of.h.


Constructor & Destructor Documentation

template<class T>
vimt3d_image_3d_of< T >::vimt3d_image_3d_of ( ) [inline]

Construct an empty one-plane image.

Definition at line 35 of file vimt3d_image_3d_of.h.

template<class T>
vimt3d_image_3d_of< T >::vimt3d_image_3d_of ( unsigned  ni,
unsigned  nj,
unsigned  nk,
unsigned  np = 1,
const vimt3d_transform_3d w2i = vimt3d_transform_3d() 
) [inline]

Construct an image of size (ni, nj, nk, np) with optional world_to_image transform w2i.

Definition at line 39 of file vimt3d_image_3d_of.h.

template<class T>
vimt3d_image_3d_of< T >::vimt3d_image_3d_of ( const vil3d_image_view< T > &  view,
const vimt3d_transform_3d w2i 
) [inline]

Construct from a view and a world-to-image transform.

The underlying pixel data is not duplicated.

Definition at line 46 of file vimt3d_image_3d_of.h.

template<class T>
virtual vimt3d_image_3d_of< T >::~vimt3d_image_3d_of ( ) [inline, virtual]

Destructor.

Definition at line 52 of file vimt3d_image_3d_of.h.


Member Function Documentation

template<class T >
void vimt3d_image_3d_of< T >::b_read ( vsl_b_istream bfs) [virtual]

Load class from binary file stream.

Implements vimt_image.

Definition at line 111 of file vimt3d_image_3d_of.txx.

template<class T >
void vimt3d_image_3d_of< T >::b_write ( vsl_b_ostream bfs) const [virtual]

Save class to binary file stream.

Implements vimt_image.

Definition at line 101 of file vimt3d_image_3d_of.txx.

template<class T>
virtual vimt_image* vimt3d_image_3d_of< T >::clone ( ) const [inline, virtual]

Create a copy on the heap and return base class pointer.

Note that this will make a shallow copy of any contained images

Implements vimt_image.

Definition at line 95 of file vimt3d_image_3d_of.h.

template<class T >
vimt_image * vimt3d_image_3d_of< T >::deep_clone ( ) const [virtual]

Create a deep copy on the heap and return base class pointer.

This will make a deep copy of any contained images

Implements vimt_image.

Definition at line 71 of file vimt3d_image_3d_of.txx.

template<class T >
void vimt3d_image_3d_of< T >::deep_copy ( const vimt3d_image_3d_of< T > &  image)

Take a deep copy of image (copy data, not just pointers).

Perform deep copy of src into this image.

Definition at line 21 of file vimt3d_image_3d_of.txx.

template<class T >
bool vimt3d_image_3d_of< T >::equals ( const vimt_image im) const [private, virtual]

Shallow equality tester.

The parameter must be identical type to this.

Implements vimt_image.

Definition at line 32 of file vimt3d_image_3d_of.txx.

template<class T>
vil3d_image_view<T>& vimt3d_image_3d_of< T >::image ( ) [inline]

Image view.

Definition at line 58 of file vimt3d_image_3d_of.h.

template<class T>
const vil3d_image_view<T>& vimt3d_image_3d_of< T >::image ( ) const [inline]

Image view.

Definition at line 61 of file vimt3d_image_3d_of.h.

template<class T>
virtual const vil3d_image_view_base& vimt3d_image_3d_of< T >::image_base ( ) const [inline, virtual]

Base class view of image.

Implements vimt3d_image_3d.

Definition at line 55 of file vimt3d_image_3d_of.h.

vcl_vector< unsigned > vimt3d_image_3d::image_size ( ) const [virtual, inherited]

Return 3 element vector indicating size of image in pixels.

Return vector indicating size of image in pixels.

3D image is v[0] x v[1] x v[2] Somewhat inefficient: Only use when you absolutely have to. Usually one only needs to know the size once one knows the exact type.

3D image is v[0] x v[1] x v[2]

Implements vimt_image.

Definition at line 12 of file vimt3d_image_3d.cxx.

template<class T>
virtual vcl_string vimt3d_image_3d_of< T >::is_a ( ) const [virtual]

Name of the class.

Reimplemented from vimt3d_image_3d.

template<class T >
bool vimt3d_image_3d_of< T >::is_class ( vcl_string const &  s) const [virtual]

Does the name of the class match the argument?.

Reimplemented from vimt3d_image_3d.

Definition at line 55 of file vimt3d_image_3d_of.txx.

virtual unsigned vimt3d_image_3d::n_dims ( ) const [inline, virtual, inherited]

Return dimensionality of image.

Implements vimt_image.

Definition at line 30 of file vimt3d_image_3d.h.

template<class T>
unsigned vimt3d_image_3d_of< T >::n_planes ( ) const [inline, virtual]

Get the number of planes in the image.

Implements vimt_image.

Definition at line 64 of file vimt3d_image_3d_of.h.

template<class T >
bool vimt3d_image_3d_of< T >::operator== ( const vimt3d_image_3d_of< T > &  other) const

True if transforms are equal, and they share same image data.

True if transforms, etc. are equal, and they share same image data.

This does not do a deep equality on image data. If the images point to different image data objects that contain identical images, then the result will still be false.

Definition at line 138 of file vimt3d_image_3d_of.txx.

vcl_vector< double > vimt3d_image_3d::pixel_size ( ) const [virtual, inherited]

Return 3 element vector indicating the size of a pixel.

Somewhat inefficient: Only use when you absolutely have to. Usually one only needs to know the size once one knows the exact type.

Implements vimt_image.

Definition at line 23 of file vimt3d_image_3d.cxx.

template<class T >
void vimt3d_image_3d_of< T >::print_all ( vcl_ostream &  os) const [virtual]

print all data to os (rounds output to int).

print all data to os.

Implements vimt_image.

Definition at line 91 of file vimt3d_image_3d_of.txx.

template<class T >
void vimt3d_image_3d_of< T >::print_summary ( vcl_ostream &  os) const [virtual]

Print class to os.

Implements vimt_image.

Definition at line 81 of file vimt3d_image_3d_of.txx.

template<class T >
void vimt3d_image_3d_of< T >::set_valid_region ( int  i0,
unsigned  ni,
int  j0,
unsigned  nj,
int  k0,
unsigned  nk 
)

Define valid data region (including transform).

Resizes and sets the transformation so that world2im(x,y) is valid for all points in range Specifically, set_valid_region(i0,ni,j0,nj,k0,nk); world2im() translates by (-i0,-j0,-k0)

Resizes and sets the transformation so that worldToIm(x,y) is valid for all points in range

Definition at line 44 of file vimt3d_image_3d_of.txx.

void vimt3d_image_3d::set_world2im ( const vimt3d_transform_3d w2i) [inline, inherited]

Set world-to-image transformation.

Deprecated:
in favour of non-const world2im()

Definition at line 57 of file vimt3d_image_3d.h.

template<class T >
short vimt3d_image_3d_of< T >::version_no ( ) const

Version number for I/O.

Reimplemented from vimt_image.

Definition at line 63 of file vimt3d_image_3d_of.txx.

const vimt3d_transform_3d& vimt3d_image_3d::world2im ( ) const [inline, inherited]

Current world-to-image transformation.

Definition at line 50 of file vimt3d_image_3d.h.

vimt3d_transform_3d& vimt3d_image_3d::world2im ( ) [inline, inherited]

Current world-to-image transformation.

Definition at line 53 of file vimt3d_image_3d.h.

void vimt3d_image_3d::world_bounds ( vcl_vector< double > &  b_lo,
vcl_vector< double > &  b_hi 
) const [virtual, inherited]

Return 3D vectors defining bounding box containing image in world co-ords.

Return vectors defining bounding box containing image in world co-ords.

Somewhat inefficient: Only use when you absolutely have to. Usually one only needs to know the size once one knows the exact type.

Implements vimt_image.

Definition at line 37 of file vimt3d_image_3d.cxx.


Friends And Related Function Documentation

template<class sType , class dType >
void vimt3d_resample_tricubic_edge_extend ( const vimt3d_image_3d_of< sType > &  src_image,
vimt3d_image_3d_of< dType > &  dest_image,
const vgl_point_3d< double > &  p,
const vgl_vector_3d< double > &  u,
const vgl_vector_3d< double > &  v,
const vgl_vector_3d< double > &  w,
int  ni,
int  nj,
int  nk 
) [related]

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

dest_image(i,j,k,p) is sampled from the src_image at p+i.u+j.v+k.w, where i=[0..nk-1], j=[0..nj-1], k=[0..nk-1] in world co-ordinates.

dest_image resized to (ni,nj,nk,src_image.nplanes())

dest_image.world2im() set up so that the world co-ordinates in src and dest match

Points outside image return the value of the nearest valid pixel.

Definition at line 70 of file vimt3d_resample_tricubic.h.

template<class sType , class dType >
void vimt3d_resample_trilin_edge_extend ( const vimt3d_image_3d_of< sType > &  src_image,
vimt3d_image_3d_of< dType > &  dest_image,
const vgl_point_3d< double > &  p,
const vgl_vector_3d< double > &  u,
const vgl_vector_3d< double > &  v,
const vgl_vector_3d< double > &  w,
int  ni,
int  nj,
int  nk 
) [related]

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 p+i.u+j.v+k.w, where i=[0..nk-1], j=[0..nj-1], k=[0..nk-1] in world co-ordinates.

dest_image resized to (ni,nj,nk,src_image.nplanes())

dest_image.world2im() set up so that the world co-ordinates in src and dest match

Points outside image return the value of the nearest valid pixel.

Definition at line 88 of file vimt3d_resample_trilinear.h.

template<class sType , class dType >
void vimt3d_resample_trilin_smoothing_edge_extend ( const vimt3d_image_3d_of< sType > &  src_image,
vimt3d_image_3d_of< dType > &  dest_image,
const vgl_point_3d< double > &  p,
const vgl_vector_3d< double > &  u,
const vgl_vector_3d< double > &  v,
const vgl_vector_3d< double > &  w,
int  ni,
int  nj,
int  nk 
) [related]

Resample an image using appropriate smoothing if the resolution changes significantly.

dest_image(i,j,k,p) is sampled from the src_image at p+i.u+j.v+k.w, where i=[0..ni-1], j=[0..nj-1], k=[0..nk-1] in world co-ordinates.

dest_image resized to (ni,nj,nk,src_image.nplanes())

dest_image.world2im() set up so that the world co-ordinates in src and dest match

Points outside image return the value of the nearest valid pixel.

Definition at line 127 of file vimt3d_resample_trilinear.h.

template<class sType , class dType >
void vimt3d_resample_trilin_smoothing_edge_extend ( const vimt3d_image_3d_of< sType > &  src,
vimt3d_image_3d_of< dType > &  dest 
) [related]

Resample src, using the grid defined by dest.

Smooths appropriately if the resolution changes significantly. dest(i,j,k,p) is sampled from src at the wc grid defined by the world co-ords of the pixel centres in dest.

dest is not resized, nor has its world2im transform modified.

Points outside src return the value of the nearest valid pixel.

Definition at line 173 of file vimt3d_resample_trilinear.h.


Member Data Documentation

template<class T>
vil3d_image_view<T> vimt3d_image_3d_of< T >::image_ [private]

Definition at line 25 of file vimt3d_image_3d_of.h.

Definition at line 18 of file vimt3d_image_3d.h.


The documentation for this class was generated from the following files: