#include <vil3d_image_view.h>
Inheritance diagram for vil3d_image_view< T >:

Views nplanes() planes of data each of size ni() x nj() x nk(). The (i,j,k) element of the p'th plane is given by im.origin_ptr()[i*im.istep() + j*im.jstep()+ k*im.kstep() + p*im.planestep] The actual image data is either allocated by the class (using set_size), in which case it is deleted only when it has no views observing it, or is allocated outside (and is not deleted on destruction). This allows external images to be accessed without a deep copy.
Note that copying one vil3d_image_view<T> to another takes a shallow copy by default - it copies the view, not the raw image data. Use the explicit deep_copy() call to take a deep copy.
Definition at line 35 of file vil3d_image_view.h.
Public Types | |
| typedef T | pixel_type |
| The pixel type of this image. | |
| typedef T * | iterator |
| typedef T const * | const_iterator |
Public Member Functions | |
| vil3d_image_view () | |
| Dflt ctor. | |
| vil3d_image_view (unsigned ni, unsigned nj, unsigned nk, unsigned n_planes=1) | |
| Create an n_plane plane image of ni x nj x nk pixels. | |
| vil3d_image_view (const T *top_left, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t k_step, vcl_ptrdiff_t plane_step) | |
| Set this view to look at someone else's memory data. | |
| vil3d_image_view (const vil_memory_chunk_sptr &mem_chunk, const T *top_left, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t k_step, vcl_ptrdiff_t plane_step) | |
| Set this view to look at another view's data. | |
| vil3d_image_view (const vil3d_image_view< T > &rhs) | |
| Copy construct. | |
| vil3d_image_view (const vil3d_image_view_base &base_ref) | |
| Create shallow copy of image with given base reference. | |
| vil3d_image_view (const vil3d_image_view_base_sptr &base_sptr) | |
| Create shallow copy of image with given base reference. | |
| const vil3d_image_view< T > & | operator= (const vil3d_image_view< T > &rhs) |
| Copy a view. The rhs and lhs will point to the same image data. | |
| const vil3d_image_view & | operator= (const vil3d_image_view_base &base_ref) |
| Create shallow copy of image with given base reference. | |
| const vil3d_image_view< T > & | operator= (const vil3d_image_view_base_sptr &rhs) |
| Copy a view. The rhs and lhs will point to the same image data. | |
| virtual | ~vil3d_image_view () |
| bool | is_contiguous () const |
| True if data all in one unbroken block and origin_ptr() is lowest data address. | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| T * | origin_ptr () |
| Pointer to the first (top left in plane 0) pixel. | |
| const T * | origin_ptr () const |
| Pointer to the first (top left in plane 0) pixel. | |
| vcl_ptrdiff_t | istep () const |
| Add this to your pixel pointer to get next i pixel. | |
| vcl_ptrdiff_t | jstep () const |
| Add this to your pixel pointer to get next j pixel. | |
| vcl_ptrdiff_t | kstep () const |
| Add this to your pixel pointer to get next k pixel. | |
| vcl_ptrdiff_t | planestep () const |
| Add this to your pixel pointer to get pixel on next plane. | |
| operator safe_bool () const | |
| Cast to bool is true if pointing at some data. | |
| bool | operator! () const |
| Return false if pointing at some data. | |
| unsigned | size_bytes () const |
| The number of bytes in the data. | |
| const vil_memory_chunk_sptr & | memory_chunk () const |
| Smart pointer to the object holding the data for this view. | |
| vil_memory_chunk_sptr & | memory_chunk () |
| Smart pointer to the object holding the data for this view. | |
| const T & | operator() (unsigned i, unsigned j, unsigned k) const |
| Return read-only reference to pixel at (i,j,k) in plane 0. | |
| T & | operator() (unsigned i, unsigned j, unsigned k) |
| Return read/write reference to pixel at (i,j,k) in plane 0. | |
| const T & | operator() (unsigned i, unsigned j, unsigned k, unsigned p) const |
| Return read-only reference to pixel at (i,j,k) in plane p. | |
| T & | operator() (unsigned i, unsigned j, unsigned k, unsigned p) |
| Return read-only reference to pixel at (i,j,k) in plane p. | |
| virtual void | set_size (unsigned ni, unsigned nj, unsigned nk) |
| resize current planes to ni x nj x nk. | |
| virtual void | set_size (unsigned ni, unsigned nj, unsigned nk, unsigned nplanes) |
| resize to ni x nj x nk x nplanes. | |
| void | deep_copy (const vil3d_image_view< T > &src) |
| Make a copy of the data in src and set this to view it. | |
| void | clear () |
| Make empty. | |
| void | set_to_memory (const T *top_left, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t k_step, vcl_ptrdiff_t plane_step) |
| Set this view to look at someone else's memory data. | |
| void | fill (T value) |
| Fill view with given value. | |
| virtual void | print (vcl_ostream &) const |
| Print a 1-line summary of contents. | |
| virtual vcl_string | is_a () const |
| Return class name. | |
| virtual bool | is_class (vcl_string const &s) const |
| True if this is (or is derived from) class s. | |
| vil_pixel_format | pixel_format () const |
| Return a description of the concrete data pixel type. | |
| bool | operator== (const vil3d_image_view< T > &other) const |
| True if they share same view of same image data. | |
| bool | operator!= (const vil3d_image_view< T > &rhs) const |
| True if they do not share same view of same image data. | |
| bool | operator< (const vil3d_image_view< T > &other) const |
| Provides an ordering. | |
| bool | operator>= (const vil3d_image_view< T > &other) const |
| Provides an ordering. | |
| bool | operator> (const vil3d_image_view< T > &other) const |
| Provides an ordering. | |
| bool | operator<= (const vil3d_image_view< T > &other) const |
| Provides an ordering. | |
| unsigned | ni () const |
| Width. | |
| unsigned | nj () const |
| Height. | |
| unsigned | nk () const |
| Depth. | |
| unsigned | nplanes () const |
| Number of planes. | |
| unsigned long | size () const |
| The number of pixels. | |
Protected Member Functions | |
| void | release_memory () |
| Disconnect this view from the underlying data,. | |
Protected Attributes | |
| T * | top_left_ |
| Pointer to pixel at origin. | |
| vcl_ptrdiff_t | istep_ |
| Add this to a pixel pointer to move one column left. | |
| vcl_ptrdiff_t | jstep_ |
| Add this to a pixel pointer to move one row down. | |
| vcl_ptrdiff_t | kstep_ |
| Add this to a pixel pointer to move one slice down. | |
| vcl_ptrdiff_t | planestep_ |
| Add this to a pixel pointer to move one plane back. | |
| vil_memory_chunk_sptr | ptr_ |
| Reference to actual image data. | |
| unsigned | ni_ |
| Number of columns. | |
| unsigned | nj_ |
| Number of rasters. | |
| unsigned | nk_ |
| Number of slices. | |
| unsigned | nplanes_ |
| Number of planes. | |
Private Attributes | |
| VCL_SAFE_BOOL_DEFINE | |
Related Functions | |
| (Note that these are not member functions.) | |
| void | vil3d_convolve_1d (const vil3d_image_view< srcT > &src_im, vil3d_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, enum vil_convolve_boundary_option start_option, enum vil_convolve_boundary_option end_option) |
| Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction. | |
| void | vil3d_grad_1x3 (const vil3d_image_view< srcT > &src, vil3d_image_view< destT > &grad_i, vil3d_image_view< destT > &grad_j, vil3d_image_view< destT > &grad_k) |
| Compute gradients of an image using (-0.5 0 0.5) Sobel filters. | |
| void | vil3d_grad_1x3 (const vil3d_image_view< srcT > &src, vil3d_image_view< destT > &grad_ijk) |
| Compute gradients of an image using (-0.5 0 0.5) filters. | |
| accumT | vil_norm_corr_2d_at_pt (const srcT *src_im, vcl_ptrdiff_t s_istep, vcl_ptrdiff_t s_jstep, vcl_ptrdiff_t s_kstep, vcl_ptrdiff_t s_pstep, const vil3d_image_view< kernelT > &kernel, accumT) |
| Evaluate dot product between kernel and src_im. | |
| void | vil3d_normalised_correlation_3d (const vil3d_image_view< srcT > &src_im, vil3d_image_view< destT > &dest_im, const vil3d_image_view< kernelT > &kernel, accumT ac) |
| Normalised cross-correlation of (pre-normalised) kernel with srcT. | |
| void | vil3d_clamp (vil3d_image_view< T > &src, vil3d_image_view< T > &dest, T lo, T hi) |
| Clamp an image view between two values. | |
| void | vil3d_clamp_below (vil3d_image_view< T > &src, T t, T v) |
| Clamp an image view above a given value t, setting it to v if below or on t. | |
| void | vil3d_clamp_below (vil3d_image_view< T > &src, T t) |
| Clamp an image view above a given value t, setting it to this t if below t. | |
| void | vil3d_clamp_above (vil3d_image_view< T > &src, T t, T v) |
| Clamp an image view below a given value t, setting it to v if above or on t. | |
| void | vil3d_clamp_above (vil3d_image_view< T > &src, T t) |
| Clamp an image view below a given value t, setting it to this t if above t. | |
| void | vil3d_convert_cast (const vil3d_image_view< inP > &src, vil3d_image_view< outP > &dest) |
| Cast one pixel type to another (with rounding). | |
| void | vil3d_convert_round (const vil3d_image_view< inP > &src, vil3d_image_view< outP > &dest) |
| Convert one pixel type to another with rounding. | |
| void | vil3d_convert_stretch_range (const vil3d_image_view< T > &src, vil3d_image_view< vxl_byte > &dest) |
| Convert src to byte image dest by stretching to range [0,255]. | |
| void | vil3d_copy_reformat (const vil3d_image_view< T > &src, vil3d_image_view< T > &dest) |
| Copy src to dest, without changing dest's view parameters. | |
| void | vil3d_copy_to_window (const vil3d_image_view< T > &src, vil3d_image_view< T > &dest, unsigned i0, unsigned j0, unsigned k0) |
| Copy src to window in dest. | |
| void | vil3d_copy_deep (const vil3d_image_view< T > &src, vil3d_image_view< T > &dest) |
| Deep copy src to dest. | |
| vil3d_image_view< T > | vil3d_copy_deep (const vil3d_image_view< T > &src) |
| Create a deep copy of an image, with completely new underlying memory. | |
| vil3d_image_view< T > | vil3d_decimate (const vil3d_image_view< T > &im, unsigned i_factor, unsigned j_factor=0, unsigned k_factor=0) |
| Create a view which is a decimated version of src. | |
| bool | vil3d_image_view_deep_equality (const vil3d_image_view< T > &lhs, const vil3d_image_view< T > &rhs) |
| True if the actual images are identical. | |
| void | vil3d_math_value_range (const vil3d_image_view< T > &im, T &min_value, T &max_value) |
| Compute minimum and maximum values over im. | |
| void | vil3d_math_value_range_percentile (const vil3d_image_view< T > &im, const double fraction, T &value) |
| Compute value corresponding to a percentile of the range of im. | |
| void | vil3d_math_value_range_percentiles (const vil3d_image_view< T > &im, const vcl_vector< double > fraction, vcl_vector< T > &value) |
| Compute value corresponding to several percentiles of the range of im. | |
| void | vil3d_math_mean_over_planes (const vil3d_image_view< aT > &src, vil3d_image_view< sumT > &dest) |
| Calc the mean of each pixel over all the planes. | |
| void | vil3d_math_mean_over_planes (const vil3d_image_view< inT > &src, vil3d_image_view< outT > &dest, sumT) |
| Calc the mean of each pixel over all the planes. | |
| void | vil3d_math_rms (const vil3d_image_view< inT > &src, vil3d_image_view< outT > &dest, sumT) |
| Calculate the rms of each pixel over all the planes. | |
| void | vil3d_math_sum (sumT &sum, const vil3d_image_view< imT > &im, unsigned p) |
| Compute sum of values in plane p. | |
| void | vil3d_math_mean (sumT &mean, const vil3d_image_view< imT > &im, unsigned p) |
| Mean of elements in plane p of image. | |
| void | vil3d_math_sum_squares (sumT &sum, sumT &sum_sq, const vil3d_image_view< imT > &im, unsigned p) |
| Sum of squares of elements in plane p of image. | |
| void | vil3d_math_scale_and_offset_values (vil3d_image_view< imT > &image, double scale, offsetT offset) |
| Multiply values in-place in image view by scale and add offset. | |
| void | vil3d_math_mean_and_variance (sumT &mean, sumT &var, const vil3d_image_view< imT > &im, unsigned p) |
| Mean and variance of elements in plane p of image. | |
| sumT | vil3d_math_dot_product (const vil3d_image_view< imT > &imA, const vil3d_image_view< imT > &imB, sumT) |
| Mean and variance of elements in plane p of image. | |
| void | vil3d_math_truncate_range (vil3d_image_view< T > &image, T min_v, T max_v) |
| Truncate each pixel value so it fits into range [min_v,max_v]. | |
| vil3d_image_view< T > | vil3d_plane (const vil3d_image_view< T > &im, unsigned p) |
| Return a view of im's plane p. | |
| void | vil3d_print_all (vcl_ostream &os, const vil3d_image_view< T > &view) |
| Print all image data to os in a grid (rounds output to int). | |
| vil3d_image_view< T > | vil3d_reflect_i (const vil3d_image_view< T > &v) |
| Create a reflected view in which i -> ni-1-i. | |
| vil3d_image_view< T > | vil3d_reflect_j (const vil3d_image_view< T > &v) |
| Create a reflected view in which j -> nj-1-j. | |
| vil3d_image_view< T > | vil3d_reflect_k (const vil3d_image_view< T > &v) |
| Create a reflected view in which k -> nk-1-k. | |
| void | vil3d_sample_profile_trilin (vecType *v, const vil3d_image_view< imType > &image, double x0, double y0, double z0, double dx, double dy, double dz, unsigned n) |
| Sample along profile, using trilinear interpolation. | |
| void | vil3d_sample_profile_trilin_extend (vecType *v, const vil3d_image_view< imType > &image, double x0, double y0, double z0, double dx, double dy, double dz, unsigned n) |
| Sample along profile, using safe-extend trilinear interpolation. | |
| bool | vil3d_save (const vil3d_image_view_base &im, float voxel_width_i, float voxel_width_j, float voxel_width_k, char const *filename) |
| Send a vil3d_image_view to disk, deducing format from filename. | |
| bool | vil3d_save (const vil3d_image_view_base &, char const *filename) |
| Send a vil3d_image_view to disk, deducing format from filename. | |
| bool | vil3d_save (const vil3d_image_view_base &, char const *filename, char const *file_format) |
| Send a vil3d_image_view to disk, given filename. | |
| vil3d_image_view< T > | vil3d_switch_axes_jik (const vil3d_image_view< T > &im) |
| Change axes so that result(j,i,k)==im(i,j,k). | |
| vil3d_image_view< T > | vil3d_switch_axes_jki (const vil3d_image_view< T > &im) |
| Change axes so that result(j,k,i)==im(i,j,k). | |
| vil3d_image_view< T > | vil3d_switch_axes_kij (const vil3d_image_view< T > &im) |
| Change axes so that result(k,i,j)==im(i,j,k). | |
| vil3d_image_view< T > | vil3d_switch_axes_kji (const vil3d_image_view< T > &im) |
| Change axes so that result(k,j,i)==im(i,j,k). | |
| vil3d_image_view< T > | vil3d_switch_axes_ikj (const vil3d_image_view< T > &im) |
| Change axes so that result(i,k,j)==im(i,j,k). | |
| typedef T vil3d_image_view< T >::pixel_type |
| typedef T* vil3d_image_view< T >::iterator |
Definition at line 128 of file vil3d_image_view.h.
| typedef T const* vil3d_image_view< T >::const_iterator |
Definition at line 132 of file vil3d_image_view.h.
| vil3d_image_view< T >::vil3d_image_view | ( | ) |
| vil3d_image_view< T >::vil3d_image_view | ( | unsigned | ni, | |
| unsigned | nj, | |||
| unsigned | nk, | |||
| unsigned | n_planes = 1 | |||
| ) |
Create an n_plane plane image of ni x nj x nk pixels.
Definition at line 32 of file vil3d_image_view.txx.
| vil3d_image_view< T >::vil3d_image_view | ( | const T * | top_left, | |
| unsigned | ni, | |||
| unsigned | nj, | |||
| unsigned | nk, | |||
| unsigned | nplanes, | |||
| vcl_ptrdiff_t | i_step, | |||
| vcl_ptrdiff_t | j_step, | |||
| vcl_ptrdiff_t | k_step, | |||
| vcl_ptrdiff_t | plane_step | |||
| ) |
Set this view to look at someone else's memory data.
If the data goes out of scope then this view could be invalid, and there's no way of knowing until its too late - so take care!
Definition at line 41 of file vil3d_image_view.txx.
| vil3d_image_view< T >::vil3d_image_view | ( | const vil_memory_chunk_sptr & | mem_chunk, | |
| const T * | top_left, | |||
| unsigned | ni, | |||
| unsigned | nj, | |||
| unsigned | nk, | |||
| unsigned | nplanes, | |||
| vcl_ptrdiff_t | i_step, | |||
| vcl_ptrdiff_t | j_step, | |||
| vcl_ptrdiff_t | k_step, | |||
| vcl_ptrdiff_t | plane_step | |||
| ) |
Set this view to look at another view's data.
Typically used by functions which generate a manipulated view of another's image data. Need to pass the memory chunk to set up the internal smart ptr appropriately
Definition at line 52 of file vil3d_image_view.txx.
| vil3d_image_view< T >::vil3d_image_view | ( | const vil3d_image_view< T > & | rhs | ) |
Copy construct.
The new object will point to the same underlying image as the rhs.
Definition at line 81 of file vil3d_image_view.txx.
| vil3d_image_view< T >::vil3d_image_view | ( | const vil3d_image_view_base & | base_ref | ) |
Create shallow copy of image with given base reference.
Sets to empty image if target is of different pixel type
Definition at line 93 of file vil3d_image_view.txx.
| vil3d_image_view< T >::vil3d_image_view | ( | const vil3d_image_view_base_sptr & | base_sptr | ) |
Create shallow copy of image with given base reference.
Sets to empty image if target is of different pixel type
Definition at line 102 of file vil3d_image_view.txx.
| vil3d_image_view< T >::~vil3d_image_view | ( | ) | [virtual] |
Definition at line 177 of file vil3d_image_view.txx.
| void vil3d_image_view< T >::release_memory | ( | ) | [inline, protected] |
| const vil3d_image_view< T > & vil3d_image_view< T >::operator= | ( | const vil3d_image_view< T > & | rhs | ) |
Copy a view. The rhs and lhs will point to the same image data.
Definition at line 110 of file vil3d_image_view.txx.
| const vil3d_image_view< T > & vil3d_image_view< T >::operator= | ( | const vil3d_image_view_base & | base_ref | ) |
Create shallow copy of image with given base reference.
Sets to empty image if target is of different pixel type
Definition at line 118 of file vil3d_image_view.txx.
| const vil3d_image_view<T>& vil3d_image_view< T >::operator= | ( | const vil3d_image_view_base_sptr & | rhs | ) | [inline] |
Copy a view. The rhs and lhs will point to the same image data.
If the view types are not compatible this object will be set to empty. If the pointer is null, this object will be set to empty.
Definition at line 107 of file vil3d_image_view.h.
| bool vil3d_image_view< T >::is_contiguous | ( | ) | const |
True if data all in one unbroken block and origin_ptr() is lowest data address.
Definition at line 192 of file vil3d_image_view.txx.
| iterator vil3d_image_view< T >::begin | ( | ) | [inline] |
Definition at line 129 of file vil3d_image_view.h.
| iterator vil3d_image_view< T >::end | ( | ) | [inline] |
Definition at line 130 of file vil3d_image_view.h.
| const_iterator vil3d_image_view< T >::begin | ( | ) | const [inline] |
Definition at line 133 of file vil3d_image_view.h.
| const_iterator vil3d_image_view< T >::end | ( | ) | const [inline] |
Definition at line 134 of file vil3d_image_view.h.
| T* vil3d_image_view< T >::origin_ptr | ( | ) | [inline] |
Pointer to the first (top left in plane 0) pixel.
Note that this is not necessarily the lowest data memory address.
Definition at line 140 of file vil3d_image_view.h.
| const T* vil3d_image_view< T >::origin_ptr | ( | ) | const [inline] |
Pointer to the first (top left in plane 0) pixel.
Note that this is not necessarily the lowest data memory address.
Definition at line 143 of file vil3d_image_view.h.
| vcl_ptrdiff_t vil3d_image_view< T >::istep | ( | ) | const [inline] |
Add this to your pixel pointer to get next i pixel.
Note that istep() may well be negative;
Definition at line 147 of file vil3d_image_view.h.
| vcl_ptrdiff_t vil3d_image_view< T >::jstep | ( | ) | const [inline] |
Add this to your pixel pointer to get next j pixel.
Note that jstep() may well be negative;
Definition at line 150 of file vil3d_image_view.h.
| vcl_ptrdiff_t vil3d_image_view< T >::kstep | ( | ) | const [inline] |
Add this to your pixel pointer to get next k pixel.
Note that kstep() may well be negative;
Definition at line 153 of file vil3d_image_view.h.
| vcl_ptrdiff_t vil3d_image_view< T >::planestep | ( | ) | const [inline] |
Add this to your pixel pointer to get pixel on next plane.
Note that planestep() may well be negative, e.g. with BMP file images
Definition at line 156 of file vil3d_image_view.h.
| vil3d_image_view< T >::operator safe_bool | ( | ) | const [inline] |
| bool vil3d_image_view< T >::operator! | ( | ) | const [inline] |
| unsigned vil3d_image_view< T >::size_bytes | ( | ) | const [inline] |
| const vil_memory_chunk_sptr& vil3d_image_view< T >::memory_chunk | ( | ) | const [inline] |
Smart pointer to the object holding the data for this view.
Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory.
Typically used when creating new views of the data
Definition at line 174 of file vil3d_image_view.h.
| vil_memory_chunk_sptr& vil3d_image_view< T >::memory_chunk | ( | ) | [inline] |
Smart pointer to the object holding the data for this view.
Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory
Typically used when creating new views of the data
Definition at line 181 of file vil3d_image_view.h.
| const T& vil3d_image_view< T >::operator() | ( | unsigned | i, | |
| unsigned | j, | |||
| unsigned | k | |||
| ) | const [inline] |
Return read-only reference to pixel at (i,j,k) in plane 0.
Definition at line 186 of file vil3d_image_view.h.
| T& vil3d_image_view< T >::operator() | ( | unsigned | i, | |
| unsigned | j, | |||
| unsigned | k | |||
| ) | [inline] |
Return read/write reference to pixel at (i,j,k) in plane 0.
Definition at line 191 of file vil3d_image_view.h.
| const T& vil3d_image_view< T >::operator() | ( | unsigned | i, | |
| unsigned | j, | |||
| unsigned | k, | |||
| unsigned | p | |||
| ) | const [inline] |
Return read-only reference to pixel at (i,j,k) in plane p.
Definition at line 196 of file vil3d_image_view.h.
| T& vil3d_image_view< T >::operator() | ( | unsigned | i, | |
| unsigned | j, | |||
| unsigned | k, | |||
| unsigned | p | |||
| ) | [inline] |
Return read-only reference to pixel at (i,j,k) in plane p.
Definition at line 201 of file vil3d_image_view.h.
| void vil3d_image_view< T >::set_size | ( | unsigned | ni, | |
| unsigned | nj, | |||
| unsigned | nk | |||
| ) | [virtual] |
resize current planes to ni x nj x nk.
If already correct size, this function returns quickly
Implements vil3d_image_view_base.
Definition at line 185 of file vil3d_image_view.txx.
| void vil3d_image_view< T >::set_size | ( | unsigned | ni, | |
| unsigned | nj, | |||
| unsigned | nk, | |||
| unsigned | nplanes | |||
| ) | [virtual] |
resize to ni x nj x nk x nplanes.
If already correct size, this function returns quickly
Implements vil3d_image_view_base.
Definition at line 224 of file vil3d_image_view.txx.
| void vil3d_image_view< T >::deep_copy | ( | const vil3d_image_view< T > & | src | ) |
Make a copy of the data in src and set this to view it.
Definition at line 145 of file vil3d_image_view.txx.
| void vil3d_image_view< T >::clear | ( | ) | [inline] |
Make empty.
Disconnects view from underlying data.
Definition at line 220 of file vil3d_image_view.h.
| void vil3d_image_view< T >::set_to_memory | ( | const T * | top_left, | |
| unsigned | ni, | |||
| unsigned | nj, | |||
| unsigned | nk, | |||
| unsigned | nplanes, | |||
| vcl_ptrdiff_t | i_step, | |||
| vcl_ptrdiff_t | j_step, | |||
| vcl_ptrdiff_t | k_step, | |||
| vcl_ptrdiff_t | plane_step | |||
| ) |
Set this view to look at someone else's memory data.
If the data goes out of scope then this view could be invalid, and there's no way of knowing until it's too late -- so take care!
Note that though top_left is passed in as const, the data may be manipulated through the view.
Definition at line 249 of file vil3d_image_view.txx.
| void vil3d_image_view< T >::fill | ( | T | value | ) |
| void vil3d_image_view< T >::print | ( | vcl_ostream & | ) | const [virtual] |
Print a 1-line summary of contents.
Implements vil3d_image_view_base.
Definition at line 308 of file vil3d_image_view.txx.
| virtual vcl_string vil3d_image_view< T >::is_a | ( | ) | const [virtual] |
| bool vil3d_image_view< T >::is_class | ( | vcl_string const & | s | ) | const [virtual] |
True if this is (or is derived from) class s.
Reimplemented from vil3d_image_view_base.
Definition at line 300 of file vil3d_image_view.txx.
| vil_pixel_format vil3d_image_view< T >::pixel_format | ( | ) | const [inline, virtual] |
Return a description of the concrete data pixel type.
The value corresponds directly to pixel_type.
Implements vil3d_image_view_base.
Definition at line 247 of file vil3d_image_view.h.
| bool vil3d_image_view< T >::operator== | ( | const vil3d_image_view< T > & | other | ) | const |
True if they share same view of 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 319 of file vil3d_image_view.txx.
| bool vil3d_image_view< T >::operator!= | ( | const vil3d_image_view< T > & | rhs | ) | const [inline] |
True if they do not share same view of same image data.
This does not do a deep inequality on image data. If the images point to different image data objects that contain identical images, then the result will still be true.
Definition at line 259 of file vil3d_image_view.h.
| bool vil3d_image_view< T >::operator< | ( | const vil3d_image_view< T > & | other | ) | const |
Provides an ordering.
Useful for ordered containers. There is no guaranteed meaning to the less than operator, except that (a<b && b<a) is false and !(a<b) && !(b<a) is equivalent to a==b
Definition at line 340 of file vil3d_image_view.txx.
| bool vil3d_image_view< T >::operator>= | ( | const vil3d_image_view< T > & | other | ) | const [inline] |
| bool vil3d_image_view< T >::operator> | ( | const vil3d_image_view< T > & | other | ) | const [inline] |
| bool vil3d_image_view< T >::operator<= | ( | const vil3d_image_view< T > & | other | ) | const [inline] |
| unsigned vil3d_image_view_base::ni | ( | ) | const [inline, inherited] |
| unsigned vil3d_image_view_base::nj | ( | ) | const [inline, inherited] |
| unsigned vil3d_image_view_base::nk | ( | ) | const [inline, inherited] |
| unsigned vil3d_image_view_base::nplanes | ( | ) | const [inline, inherited] |
| unsigned long vil3d_image_view_base::size | ( | ) | const [inline, inherited] |
| void vil3d_convolve_1d | ( | const vil3d_image_view< srcT > & | src_im, | |
| vil3d_image_view< destT > & | dest_im, | |||
| const kernelT * | kernel, | |||
| vcl_ptrdiff_t | k_lo, | |||
| vcl_ptrdiff_t | k_hi, | |||
| accumT | ac, | |||
| enum vil_convolve_boundary_option | start_option, | |||
| enum vil_convolve_boundary_option | end_option | |||
| ) | [related] |
Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
On exit dest_im(i,j) = sum src_m(i-x,j)*kernel(x) (x=k_lo..k_hi)
| kernel | should point to tap 0. | |
| dest_im | will be resized to size of src_im. |
vil3d_convolve_1d(vil3d_switch_axes_jki(smoothed1), smoothed2, ... ); smoothed2_im = vil3d_switch_axes_kij(smoothed2);
vil3d_convolve_1d(vil3d_switch_axes_kij(smoothed2), smoothed3, ... ); smoothed3_im = vil3d_switch_axes_jki(smoothed3);
Definition at line 40 of file vil3d_convolve_1d.h.
| void vil3d_grad_1x3 | ( | const vil3d_image_view< srcT > & | src, | |
| vil3d_image_view< destT > & | grad_i, | |||
| vil3d_image_view< destT > & | grad_j, | |||
| vil3d_image_view< destT > & | grad_k | |||
| ) | [related] |
Compute gradients of an image using (-0.5 0 0.5) Sobel filters.
Computes both i,j and k gradients of an ni x nj x nk plane of data 1 pixel border around grad images is set to zero
Definition at line 91 of file vil3d_grad_1x3.txx.
| void vil3d_grad_1x3 | ( | const vil3d_image_view< srcT > & | src, | |
| vil3d_image_view< destT > & | grad_ijk | |||
| ) | [related] |
Compute gradients of an image using (-0.5 0 0.5) filters.
Computes both i,j and k gradients of an image. grad_ijk has three times as many planes as src, with dest plane (3i) being the i-gradient of source plane i and dest plane (3i+1) being the j-gradient etc 1 pixel border around grad images is set to zero
Definition at line 54 of file vil3d_grad_1x3.txx.
| accumT vil_norm_corr_2d_at_pt | ( | const srcT * | src_im, | |
| vcl_ptrdiff_t | s_istep, | |||
| vcl_ptrdiff_t | s_jstep, | |||
| vcl_ptrdiff_t | s_kstep, | |||
| vcl_ptrdiff_t | s_pstep, | |||
| const vil3d_image_view< kernelT > & | kernel, | |||
| accumT | ||||
| ) | [related] |
Evaluate dot product between kernel and src_im.
Assumes that the kernel has been normalised to have zero mean and unit variance
Definition at line 19 of file vil3d_normalised_correlation_3d.h.
| void vil3d_normalised_correlation_3d | ( | const vil3d_image_view< srcT > & | src_im, | |
| vil3d_image_view< destT > & | dest_im, | |||
| const vil3d_image_view< kernelT > & | kernel, | |||
| accumT | ac | |||
| ) | [related] |
Normalised cross-correlation of (pre-normalised) kernel with srcT.
Each dimension of dest is resized to (1+src_im.nX()-kernel.nX()) (a one plane image). On exit dest(x,y,z) = sum_ijk src_im(x+i,y+j,y+k)*kernel(i,j,k)/sd_under_region
Assumes that the kernel has been normalised to have zero mean and unit variance
Definition at line 79 of file vil3d_normalised_correlation_3d.h.
| void vil3d_clamp | ( | vil3d_image_view< T > & | src, | |
| vil3d_image_view< T > & | dest, | |||
| T | lo, | |||
| T | hi | |||
| ) | [related] |
| void vil3d_clamp_below | ( | vil3d_image_view< T > & | src, | |
| T | t, | |||
| T | v | |||
| ) | [related] |
Clamp an image view above a given value t, setting it to v if below or on t.
Definition at line 38 of file vil3d_clamp.h.
| void vil3d_clamp_below | ( | vil3d_image_view< T > & | src, | |
| T | t | |||
| ) | [related] |
Clamp an image view above a given value t, setting it to this t if below t.
Definition at line 63 of file vil3d_clamp.h.
| void vil3d_clamp_above | ( | vil3d_image_view< T > & | src, | |
| T | t, | |||
| T | v | |||
| ) | [related] |
Clamp an image view below a given value t, setting it to v if above or on t.
Definition at line 71 of file vil3d_clamp.h.
| void vil3d_clamp_above | ( | vil3d_image_view< T > & | src, | |
| T | t | |||
| ) | [related] |
Clamp an image view below a given value t, setting it to this t if above t.
Definition at line 96 of file vil3d_clamp.h.
| void vil3d_convert_cast | ( | const vil3d_image_view< inP > & | src, | |
| vil3d_image_view< outP > & | dest | |||
| ) | [related] |
Cast one pixel type to another (with rounding).
There must be a cast operator from inP to outP
If the two pixel types are the same, the destination may only be a shallow copy of the source.
Definition at line 74 of file vil3d_convert.h.
| void vil3d_convert_round | ( | const vil3d_image_view< inP > & | src, | |
| vil3d_image_view< outP > & | dest | |||
| ) | [related] |
Convert one pixel type to another with rounding.
This should only be used to convert scalar pixel types to other scalar pixel types, or RGBs to RGBs. This function only rounds in terms of the destination type.
If the two pixel types are the same, the destination may only be a shallow copy of the source.
Definition at line 93 of file vil3d_convert.h.
| void vil3d_convert_stretch_range | ( | const vil3d_image_view< T > & | src, | |
| vil3d_image_view< vxl_byte > & | dest | |||
| ) | [related] |
Convert src to byte image dest by stretching to range [0,255].
Definition at line 106 of file vil3d_convert.h.
| void vil3d_copy_reformat | ( | const vil3d_image_view< T > & | src, | |
| vil3d_image_view< T > & | dest | |||
| ) | [related] |
Copy src to dest, without changing dest's view parameters.
This is useful if you want to copy on image into a window on another image. src and dest must have identical sizes, and types. O(size).
Definition at line 37 of file vil3d_copy.txx.
| void vil3d_copy_to_window | ( | const vil3d_image_view< T > & | src, | |
| vil3d_image_view< T > & | dest, | |||
| unsigned | i0, | |||
| unsigned | j0, | |||
| unsigned | k0 | |||
| ) | [related] |
Copy src to window in dest.
Size of window is defined by src. O(src.size).
Definition at line 54 of file vil3d_copy.txx.
| void vil3d_copy_deep | ( | const vil3d_image_view< T > & | src, | |
| vil3d_image_view< T > & | dest | |||
| ) | [related] |
| vil3d_image_view< T > vil3d_copy_deep | ( | const vil3d_image_view< T > & | src | ) | [related] |
Create a deep copy of an image, with completely new underlying memory.
O(size).
Definition at line 25 of file vil3d_copy.txx.
| vil3d_image_view< T > vil3d_decimate | ( | const vil3d_image_view< T > & | im, | |
| unsigned | i_factor, | |||
| unsigned | j_factor = 0, |
|||
| unsigned | k_factor = 0 | |||
| ) | [related] |
Create a view which is a decimated version of src.
Doesn't modify underlying data. O(1).
The factor describes the number of input rows (or columns) that are equivalent to one output. If you don't specify the j_factor or k_factor, they will be set equal to i_factor.
Definition at line 21 of file vil3d_decimate.h.
| bool vil3d_image_view_deep_equality | ( | const vil3d_image_view< T > & | lhs, | |
| const vil3d_image_view< T > & | rhs | |||
| ) | [related] |
True if the actual images are identical.
The data may be formatted differently in each memory chunk. O(size).
Definition at line 362 of file vil3d_image_view.txx.
| void vil3d_math_value_range | ( | const vil3d_image_view< T > & | im, | |
| T & | min_value, | |||
| T & | max_value | |||
| ) | [related] |
| void vil3d_math_value_range_percentile | ( | const vil3d_image_view< T > & | im, | |
| const double | fraction, | |||
| T & | value | |||
| ) | [related] |
Compute value corresponding to a percentile of the range of im.
Percentiles expressed as fraction, e.g. 0.05, or 0.95.
| im | The image to examine. | |
| fraction | The fraction of the data range (from the lower end). |
| value | The image data value corresponding to the specified percentile. |
Definition at line 70 of file vil3d_math.h.
| void vil3d_math_value_range_percentiles | ( | const vil3d_image_view< T > & | im, | |
| const vcl_vector< double > | fraction, | |||
| vcl_vector< T > & | value | |||
| ) | [related] |
Compute value corresponding to several percentiles of the range of im.
Percentiles expressed as fraction, e.g. 0.05, or 0.95.
| im | The image to examine. | |
| fraction | The fraction of the data range (from the lower end). |
| value | The image data value corresponding to the specified percentiles. |
Definition at line 91 of file vil3d_math.h.
| void vil3d_math_mean_over_planes | ( | const vil3d_image_view< aT > & | src, | |
| vil3d_image_view< sumT > & | dest | |||
| ) | [related] |
| void vil3d_math_mean_over_planes | ( | const vil3d_image_view< inT > & | src, | |
| vil3d_image_view< outT > & | dest, | |||
| sumT | ||||
| ) | [related] |
| void vil3d_math_rms | ( | const vil3d_image_view< inT > & | src, | |
| vil3d_image_view< outT > & | dest, | |||
| sumT | ||||
| ) | [related] |
| void vil3d_math_sum | ( | sumT & | sum, | |
| const vil3d_image_view< imT > & | im, | |||
| unsigned | p | |||
| ) | [related] |
| void vil3d_math_mean | ( | sumT & | mean, | |
| const vil3d_image_view< imT > & | im, | |||
| unsigned | p | |||
| ) | [related] |
| void vil3d_math_sum_squares | ( | sumT & | sum, | |
| sumT & | sum_sq, | |||
| const vil3d_image_view< imT > & | im, | |||
| unsigned | p | |||
| ) | [related] |
| void vil3d_math_scale_and_offset_values | ( | vil3d_image_view< imT > & | image, | |
| double | scale, | |||
| offsetT | offset | |||
| ) | [related] |
Multiply values in-place in image view by scale and add offset.
Definition at line 310 of file vil3d_math.h.
| void vil3d_math_mean_and_variance | ( | sumT & | mean, | |
| sumT & | var, | |||
| const vil3d_image_view< imT > & | im, | |||
| unsigned | p | |||
| ) | [related] |
| sumT vil3d_math_dot_product | ( | const vil3d_image_view< imT > & | imA, | |
| const vil3d_image_view< imT > & | imB, | |||
| sumT | ||||
| ) | [related] |
| void vil3d_math_truncate_range | ( | vil3d_image_view< T > & | image, | |
| T | min_v, | |||
| T | max_v | |||
| ) | [related] |
Truncate each pixel value so it fits into range [min_v,max_v].
If value < min_v value=min_v If value > max_v value=max_v
Definition at line 525 of file vil3d_math.h.
| vil3d_image_view< T > vil3d_plane | ( | const vil3d_image_view< T > & | im, | |
| unsigned | p | |||
| ) | [related] |
| void vil3d_print_all | ( | vcl_ostream & | os, | |
| const vil3d_image_view< T > & | view | |||
| ) | [related] |
Print all image data to os in a grid (rounds output to int).
Definition at line 23 of file vil3d_print.h.
| vil3d_image_view< T > vil3d_reflect_i | ( | const vil3d_image_view< T > & | v | ) | [related] |
Create a reflected view in which i -> ni-1-i.
i.e. vil3d_reflect_i(view)(i, j, k, p) = view(ni-1-i, j, k, p) O(1).
Definition at line 21 of file vil3d_reflect.h.
| vil3d_image_view< T > vil3d_reflect_j | ( | const vil3d_image_view< T > & | v | ) | [related] |
Create a reflected view in which j -> nj-1-j.
i.e. vil3d_reflect_j(view)(i, j, k, p) = view(i, nj-1-j, k, p) O(1).
Definition at line 35 of file vil3d_reflect.h.
| vil3d_image_view< T > vil3d_reflect_k | ( | const vil3d_image_view< T > & | v | ) | [related] |
Create a reflected view in which k -> nk-1-k.
i.e. vil3d_reflect_k(view)(i, j, k, p) = view(i, j, nk-1-k, p) O(1).
Definition at line 49 of file vil3d_reflect.h.
| void vil3d_sample_profile_trilin | ( | vecType * | v, | |
| const vil3d_image_view< imType > & | image, | |||
| double | x0, | |||
| double | y0, | |||
| double | z0, | |||
| double | dx, | |||
| double | dy, | |||
| double | dz, | |||
| unsigned | n | |||
| ) | [related] |
Sample along profile, using trilinear interpolation.
Profile points are (x0+i.dx,y0+i.dy,z0+i.dz), where i=[0..n-1]. Vector v is filled with n*np elements, where np=image.nplanes()*image.ncomponents() v[0]..v[np-1] are the values from point (x0,y0,z0) Points outside image return zero.
Definition at line 39 of file vil3d_sample_profile_trilin.txx.
| void vil3d_sample_profile_trilin_extend | ( | vecType * | v, | |
| const vil3d_image_view< imType > & | image, | |||
| double | x0, | |||
| double | y0, | |||
| double | z0, | |||
| double | dx, | |||
| double | dy, | |||
| double | dz, | |||
| unsigned | n | |||
| ) | [related] |
Sample along profile, using safe-extend trilinear interpolation.
Profile points are along the line between p0 and p1 (in image co-ordinates). Vector v is resized to n*np elements, where np=image.n_planes(). v[0]..v[np-1] are the values from point p Points outside image return zero.
Definition at line 104 of file vil3d_sample_profile_trilin.txx.
| bool vil3d_save | ( | const vil3d_image_view_base & | im, | |
| float | voxel_width_i, | |||
| float | voxel_width_j, | |||
| float | voxel_width_k, | |||
| char const * | filename | |||
| ) | [related] |
Send a vil3d_image_view to disk, deducing format from filename.
Utility function, allowing definition of voxel widths in header info.
Definition at line 119 of file vil3d_save.cxx.
| bool vil3d_save | ( | const vil3d_image_view_base & | , | |
| char const * | filename | |||
| ) | [related] |
Send a vil3d_image_view to disk, deducing format from filename.
Definition at line 91 of file vil3d_save.cxx.
| bool vil3d_save | ( | const vil3d_image_view_base & | , | |
| char const * | filename, | |||
| char const * | file_format | |||
| ) | [related] |
| vil3d_image_view< T > vil3d_switch_axes_jik | ( | const vil3d_image_view< T > & | im | ) | [related] |
| vil3d_image_view< T > vil3d_switch_axes_jki | ( | const vil3d_image_view< T > & | im | ) | [related] |
| vil3d_image_view< T > vil3d_switch_axes_kij | ( | const vil3d_image_view< T > & | im | ) | [related] |
| vil3d_image_view< T > vil3d_switch_axes_kji | ( | const vil3d_image_view< T > & | im | ) | [related] |
| vil3d_image_view< T > vil3d_switch_axes_ikj | ( | const vil3d_image_view< T > & | im | ) | [related] |
vil3d_image_view< T >::VCL_SAFE_BOOL_DEFINE [private] |
Definition at line 38 of file vil3d_image_view.h.
T* vil3d_image_view< T >::top_left_ [protected] |
vcl_ptrdiff_t vil3d_image_view< T >::istep_ [protected] |
Add this to a pixel pointer to move one column left.
Definition at line 43 of file vil3d_image_view.h.
vcl_ptrdiff_t vil3d_image_view< T >::jstep_ [protected] |
vcl_ptrdiff_t vil3d_image_view< T >::kstep_ [protected] |
Add this to a pixel pointer to move one slice down.
Definition at line 47 of file vil3d_image_view.h.
vcl_ptrdiff_t vil3d_image_view< T >::planestep_ [protected] |
Add this to a pixel pointer to move one plane back.
Definition at line 49 of file vil3d_image_view.h.
vil_memory_chunk_sptr vil3d_image_view< T >::ptr_ [protected] |
unsigned vil3d_image_view_base::ni_ [protected, inherited] |
unsigned vil3d_image_view_base::nj_ [protected, inherited] |
unsigned vil3d_image_view_base::nk_ [protected, inherited] |
unsigned vil3d_image_view_base::nplanes_ [protected, inherited] |
1.5.1