#include <vimt3d_gaussian_pyramid_builder_3d.h>

Smooth with a Gaussian filter (1-5-8-5-1 by default) and subsample so that image at level i-1 is half the size of that at level i
Note that if set_uniform_reduction(false) and width of z pixels much more than that in x and y, then only smooth and sub-sample in x and y. This is useful for images with non-isotropic sampling (eg MR images) Similarly, if either x or y has significantly larger sample spacing, the others will be smoothed first. Note, currently only works for one dimension being significantly larger than the other two.
Definition at line 26 of file vimt3d_gaussian_pyramid_builder_3d.h.
Public Member Functions | |
| vimt3d_gaussian_pyramid_builder_3d () | |
| Dflt ctor. | |
| virtual | ~vimt3d_gaussian_pyramid_builder_3d () |
| Destructor. | |
| unsigned | filter_width () const |
| Current filter width. | |
| void | set_filter_width (unsigned) |
| Set current filter width (must be 5 at present). | |
| bool | uniform_reduction () const |
| When true, subsample in x,y,z every time. | |
| void | set_uniform_reduction (bool b) |
| When true, subsample in x,y,z every time. | |
| virtual vimt_image_pyramid * | new_image_pyramid () const |
| Create new (empty) pyramid on heap. | |
| virtual void | set_max_levels (int max_l) |
| Define maximum number of levels to build. | |
| virtual int | max_levels () const |
| Get the current maximum number levels allowed. | |
| virtual void | build (vimt_image_pyramid &, const vimt_image &) const |
| Build pyramid. | |
| virtual void | extend (vimt_image_pyramid &) const |
| Extend pyramid. | |
| void | gauss_reduce (vimt3d_image_3d_of< T > &dest_im, const vimt3d_image_3d_of< T > &src_im) const |
| Smooth and subsample src_im to produce dest_im. | |
| virtual double | scale_step () const |
| Scale step between levels. | |
| unsigned | min_x_size () const |
| Get the minimum X size of the top layer of the pyramid. | |
| unsigned | min_y_size () const |
| Get the minimum Y size of the top layer of the pyramid. | |
| unsigned | min_z_size () const |
| Get the minimum Z size of the top layer of the pyramid. | |
| virtual void | set_min_size (unsigned X, unsigned Y, unsigned Z) |
| Set the minimum size of the top layer of the pyramid. | |
| 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_image_pyramid_builder * | clone () const |
| Create a copy on the heap and return base class pointer. | |
| virtual void | print_summary (vcl_ostream &os) const |
| Print class to os. | |
| 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. | |
Protected Member Functions | |
| void | checkPyr (vimt_image_pyramid &im_pyr, int n_levels) const |
| Checks pyramid has at least n levels of correct type. | |
| void | emptyPyr (vimt_image_pyramid &im_pyr) const |
| Deletes all data in im_pyr. | |
| int | n_levels (const vimt3d_image_3d_of< T > &base_image) const |
| Select number of levels to use. | |
| void | get_pixel_size (double &dx, double &dy, double &dz, const vimt3d_image_3d_of< T > &image) const |
| Compute real world size of pixel in image. | |
Private Attributes | |
| int | max_levels_ |
| bool | uniform_reduction_ |
| When true, subsample in x,y,z every time. | |
| vil3d_image_view< T > | work_im1_ |
| vil3d_image_view< T > | work_im2_ |
| unsigned | filter_width_ |
| Filter width (usually 5 for a 15851 filter, or 3 for a 121 filter). | |
| unsigned | min_x_size_ |
| Minimum size in X direction of top layer of pyramid. | |
| unsigned | min_y_size_ |
| Minimum size in Y direction of top layer of pyramid. | |
| unsigned | min_z_size_ |
| Minimum size in Z direction of top layer of pyramid. | |
| vimt3d_gaussian_pyramid_builder_3d< T >::vimt3d_gaussian_pyramid_builder_3d | ( | ) | [inline] |
| vimt3d_gaussian_pyramid_builder_3d< T >::~vimt3d_gaussian_pyramid_builder_3d | ( | ) | [inline, virtual] |
| void vimt3d_gaussian_pyramid_builder_3d< T >::checkPyr | ( | vimt_image_pyramid & | im_pyr, | |
| int | n_levels | |||
| ) | const [inline, protected] |
Checks pyramid has at least n levels of correct type.
Checks pyramid has at least n levels.
Definition at line 208 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::emptyPyr | ( | vimt_image_pyramid & | im_pyr | ) | const [inline, protected] |
| int vimt3d_gaussian_pyramid_builder_3d< T >::n_levels | ( | const vimt3d_image_3d_of< T > & | base_image | ) | const [inline, protected] |
Select number of levels to use.
Definition at line 61 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::get_pixel_size | ( | double & | dx, | |
| double & | dy, | |||
| double & | dz, | |||
| const vimt3d_image_3d_of< T > & | image | |||
| ) | const [inline, protected] |
Compute real world size of pixel in image.
Compute real world size of pixel.
Definition at line 285 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| unsigned vimt3d_gaussian_pyramid_builder_3d< T >::filter_width | ( | ) | const [inline] |
| void vimt3d_gaussian_pyramid_builder_3d< T >::set_filter_width | ( | unsigned | w | ) | [inline] |
Set current filter width (must be 5 at present).
Set current filter width (must be 3 or 5 at present).
Definition at line 132 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| bool vimt3d_gaussian_pyramid_builder_3d< T >::uniform_reduction | ( | ) | const [inline] |
When true, subsample in x,y,z every time.
When not true and width of z pixels much more than that in x and y, then only smooth and sub-sample in x and y
Definition at line 79 of file vimt3d_gaussian_pyramid_builder_3d.h.
| void vimt3d_gaussian_pyramid_builder_3d< T >::set_uniform_reduction | ( | bool | b | ) | [inline] |
When true, subsample in x,y,z every time.
When not true and width of z pixels much more than that in x and y, then only smooth and sub-sample in x and y
Definition at line 84 of file vimt3d_gaussian_pyramid_builder_3d.h.
| vimt_image_pyramid * vimt3d_gaussian_pyramid_builder_3d< T >::new_image_pyramid | ( | ) | const [inline, virtual] |
Create new (empty) pyramid on heap.
Caller responsible for its deletion
Implements vimt_image_pyramid_builder.
Definition at line 116 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::set_max_levels | ( | int | max_l | ) | [inline, virtual] |
Define maximum number of levels to build.
Limits levels built in subsequent calls to build() Useful efficiency measure. As build() only takes a shallow copy of the original image, using max_l=1 avoids any copying or smoothing.
Limits levels built in subsequent calls to build()
Implements vimt_image_pyramid_builder.
Definition at line 41 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| int vimt3d_gaussian_pyramid_builder_3d< T >::max_levels | ( | ) | const [inline, virtual] |
Get the current maximum number levels allowed.
Implements vimt_image_pyramid_builder.
Definition at line 54 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::build | ( | vimt_image_pyramid & | image_pyr, | |
| const vimt_image & | im | |||
| ) | const [inline, virtual] |
Build pyramid.
Implements vimt_image_pyramid_builder.
Definition at line 234 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::extend | ( | vimt_image_pyramid & | image_pyr | ) | const [inline, virtual] |
Extend pyramid.
The first layer of the pyramid must already be set.
Implements vimt_image_pyramid_builder.
Definition at line 302 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::gauss_reduce | ( | vimt3d_image_3d_of< T > & | dest_im, | |
| const vimt3d_image_3d_of< T > & | src_im | |||
| ) | const [inline] |
Smooth and subsample src_im to produce dest_im.
Applies filter in x,y and z, then samples every other pixel. Filter width defined by set_filter_width()
Applies 1-5-8-5-1 filter in x and y, then samples every other pixel.
Definition at line 143 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| double vimt3d_gaussian_pyramid_builder_3d< T >::scale_step | ( | ) | const [inline, virtual] |
Scale step between levels.
Implements vimt_image_pyramid_builder.
Definition at line 125 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_x_size | ( | ) | const [inline] |
Get the minimum X size of the top layer of the pyramid.
Defaults to 5.
Definition at line 118 of file vimt3d_gaussian_pyramid_builder_3d.h.
| unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_y_size | ( | ) | const [inline] |
Get the minimum Y size of the top layer of the pyramid.
Defaults to 5.
Definition at line 122 of file vimt3d_gaussian_pyramid_builder_3d.h.
| unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_z_size | ( | ) | const [inline] |
Get the minimum Z size of the top layer of the pyramid.
Defaults to 5.
Definition at line 126 of file vimt3d_gaussian_pyramid_builder_3d.h.
| void vimt3d_gaussian_pyramid_builder_3d< T >::set_min_size | ( | unsigned | X, | |
| unsigned | Y, | |||
| unsigned | Z | |||
| ) | [inline, virtual] |
Set the minimum size of the top layer of the pyramid.
Definition at line 228 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| short vimt3d_gaussian_pyramid_builder_3d< T >::version_no | ( | ) | const [inline] |
Version number for I/O.
Reimplemented from vimt_image_pyramid_builder.
Definition at line 350 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| virtual vcl_string vimt3d_gaussian_pyramid_builder_3d< T >::is_a | ( | ) | const [virtual] |
| bool vimt3d_gaussian_pyramid_builder_3d< T >::is_class | ( | vcl_string const & | s | ) | const [inline, virtual] |
Does the name of the class match the argument?.
Reimplemented from vimt_image_pyramid_builder.
Definition at line 342 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| vimt_image_pyramid_builder * vimt3d_gaussian_pyramid_builder_3d< T >::clone | ( | ) | const [inline, virtual] |
Create a copy on the heap and return base class pointer.
Implements vimt_image_pyramid_builder.
Definition at line 358 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::print_summary | ( | vcl_ostream & | os | ) | const [inline, virtual] |
Print class to os.
Implements vimt_image_pyramid_builder.
Definition at line 366 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::b_write | ( | vsl_b_ostream & | bfs | ) | const [inline, virtual] |
Save class to binary file stream.
Implements vimt_image_pyramid_builder.
Definition at line 373 of file vimt3d_gaussian_pyramid_builder_3d.txx.
| void vimt3d_gaussian_pyramid_builder_3d< T >::b_read | ( | vsl_b_istream & | bfs | ) | [inline, virtual] |
Load class from binary file stream.
Implements vimt_image_pyramid_builder.
Definition at line 384 of file vimt3d_gaussian_pyramid_builder_3d.txx.
int vimt3d_gaussian_pyramid_builder_3d< T >::max_levels_ [private] |
Definition at line 28 of file vimt3d_gaussian_pyramid_builder_3d.h.
bool vimt3d_gaussian_pyramid_builder_3d< T >::uniform_reduction_ [private] |
When true, subsample in x,y,z every time.
When not true and width of z pixels much more than that in x and y, then only smooth and sub-sample in x and y
Definition at line 33 of file vimt3d_gaussian_pyramid_builder_3d.h.
vil3d_image_view<T> vimt3d_gaussian_pyramid_builder_3d< T >::work_im1_ [mutable, private] |
Definition at line 35 of file vimt3d_gaussian_pyramid_builder_3d.h.
vil3d_image_view<T> vimt3d_gaussian_pyramid_builder_3d< T >::work_im2_ [mutable, private] |
Definition at line 35 of file vimt3d_gaussian_pyramid_builder_3d.h.
unsigned vimt3d_gaussian_pyramid_builder_3d< T >::filter_width_ [private] |
Filter width (usually 5 for a 15851 filter, or 3 for a 121 filter).
Definition at line 38 of file vimt3d_gaussian_pyramid_builder_3d.h.
unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_x_size_ [private] |
Minimum size in X direction of top layer of pyramid.
Definition at line 41 of file vimt3d_gaussian_pyramid_builder_3d.h.
unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_y_size_ [private] |
Minimum size in Y direction of top layer of pyramid.
Definition at line 44 of file vimt3d_gaussian_pyramid_builder_3d.h.
unsigned vimt3d_gaussian_pyramid_builder_3d< T >::min_z_size_ [private] |
Minimum size in Z direction of top layer of pyramid.
Definition at line 47 of file vimt3d_gaussian_pyramid_builder_3d.h.
1.5.5