Commit [896f5b] default Maximize Restore History

Rewrite nlfilter for support of N-dimensional input.

* nlfilter.m: complete rewrite to support N-dimensional images and blocks.
Also make use of im2col rather than rewrite the block creation.
* private/im2col_check.m: new function that performs that perform most
of input checking for both im2col() and nlfilter().
* im2col.m: leave most input check to new private function im2col_check(),
and add a few more tests for input checking.
* private/pad_for_spatial_filter.m: rename to pad_for_sliding_filter for a
better match of what it does (no longer only meant to prepare input for the
__spatial_filter__ function).
* private/pad_for_sliding_filter.m: previously named pad_for_spatial_filter().
Also changed one of its input argument to be size of block/domain, rather
than the block/domain itself.
* ordfiltn.m: fix call to the changed pad_for_spatial_filter function.
* NEWS: add nlfilter to list of functions that now support N-dimensional
input.

Carnë Draug Carnë Draug 2013-11-01

added inst/private/im2col_check.m
changed NEWS
changed inst/im2col.m
changed inst/nlfilter.m
changed inst/ordfiltn.m
copied inst/private/pad_for_spatial_filter.m -> inst/private/pad_for_sliding_filter.m
inst/private/im2col_check.m Diff Switch to side-by-side view
Loading...
NEWS Diff Switch to side-by-side view
Loading...
inst/im2col.m Diff Switch to side-by-side view
Loading...
inst/nlfilter.m Diff Switch to side-by-side view
Loading...
inst/ordfiltn.m Diff Switch to side-by-side view
Loading...
inst/private/pad_for_spatial_filter.m to inst/private/pad_for_sliding_filter.m
--- a/inst/private/pad_for_spatial_filter.m
+++ b/inst/private/pad_for_sliding_filter.m
@@ -18,15 +18,15 @@
 ## __spatial_filtering__. It may be better to have __spatial_filtering__ do this
 ## part as well then
 
-function im = pad_for_spatial_filter (im, domain, padval)
+function im = pad_for_sliding_filter (im, window_size, padval)
 
-  if (ndims (im) != ndims (domain))
+  if (ndims (im) != numel (window_size))
     error ("image and domain must have the same number of dimensions")
   endif
 
-  pad  = floor (size (domain) / 2);
+  pad  = floor (window_size / 2);
   im   = padarray (im, pad, padval);
-  even = ! mod (size(domain), 2);
+  even = ! mod (window_size, 2);
 
   ## if one of the domain dimensions is even, its origin is must be
   ##     floor ([size(domain)/2] + 1)