[pktools] 65/375: spectral filtering

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:53:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream-master
in repository pktools.

commit 2bd32b7ef6eb9c4745c5478948703bac0b59c3c8
Author: Pieter Kempeneers <kempenep at gmail.com>
Date:   Tue Feb 19 18:20:29 2013 +0100

    spectral filtering
---
 Makefile.in                  |  83 +++++--------
 aclocal.m4                   |  82 +++++--------
 configure                    | 270 +++++++++++++++++++------------------------
 src/algorithms/Filter.cc     |  43 ++++++-
 src/algorithms/Filter.h      | 120 ++++++++++++++++++-
 src/algorithms/Filter2d.cc   |  32 ++---
 src/algorithms/Filter2d.h    |  47 ++++----
 src/algorithms/Makefile.in   |  46 +++-----
 src/algorithms/StatFactory.h |  65 +++++++++--
 src/apps/Makefile.am         |   5 +-
 src/apps/Makefile.in         |  88 +++++++-------
 src/apps/pkdsm2shadow.cc     |   2 +-
 src/apps/pkfilter.cc         | 139 ++++++++++++----------
 src/apps/pkfs_svm.cc         |   1 -
 src/apps/pklas2img.cc        |  24 ++--
 src/base/Makefile.in         |  33 ++----
 src/base/Vector2d.h          |  32 ++---
 src/fileclasses/Makefile.in  |  38 +++---
 src/imageclasses/Makefile.in |  31 ++---
 19 files changed, 639 insertions(+), 542 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 79e3881..7146fbd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -68,11 +68,9 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  if test -d "$(distdir)"; then \
-    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
-      && rm -rf "$(distdir)" \
-      || { sleep 5 && rm -rf "$(distdir)"; }; \
-  else :; fi
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -101,8 +99,6 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
-  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -229,7 +225,7 @@ all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
 
 .SUFFIXES:
-am--refresh: Makefile
+am--refresh:
 	@:
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
@@ -265,8 +261,10 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 
 config.h: stamp-h1
-	@if test ! -f $@; then rm -f stamp-h1; else :; fi
-	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
 
 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
@@ -486,11 +484,7 @@ dist-gzip: distdir
 	$(am__remove_distdir)
 
 dist-bzip2: distdir
-	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
-
-dist-lzip: distdir
-	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
 	$(am__remove_distdir)
 
 dist-lzma: distdir
@@ -498,7 +492,7 @@ dist-lzma: distdir
 	$(am__remove_distdir)
 
 dist-xz: distdir
-	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
 	$(am__remove_distdir)
 
 dist-tarZ: distdir
@@ -529,8 +523,6 @@ distcheck: dist
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
-	*.tar.lz*) \
-	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
 	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
@@ -550,7 +542,6 @@ distcheck: dist
 	  && am__cwd=`pwd` \
 	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
-	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -579,16 +570,8 @@ distcheck: dist
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@test -n '$(distuninstallcheck_dir)' || { \
-	  echo 'ERROR: trying to run $@ with an empty' \
-	       '$$(distuninstallcheck_dir)' >&2; \
-	  exit 1; \
-	}; \
-	$(am__cd) '$(distuninstallcheck_dir)' || { \
-	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
-	  exit 1; \
-	}; \
-	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	@$(am__cd) '$(distuninstallcheck_dir)' \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
 	          echo "  (check DESTDIR support)"; \
@@ -619,15 +602,10 @@ install-am: all-am
 
 installcheck: installcheck-recursive
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
@@ -714,18 +692,17 @@ uninstall-am:
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am am--refresh check check-am clean clean-generic \
 	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-	dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distclean-hdr \
-	distclean-tags distcleancheck distdir distuninstallcheck dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
-	uninstall uninstall-am
+	dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \
+	distclean distclean-generic distclean-hdr distclean-tags \
+	distcleancheck distdir distuninstallcheck dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/aclocal.m4 b/aclocal.m4
index 1785447..1f01ab1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,8 +1,7 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
-# Inc.
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -48,8 +47,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -95,8 +93,7 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes ],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -144,9 +141,9 @@ if test $pkg_failed = yes; then
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -180,15 +177,12 @@ else
 fi[]dnl
 ])# PKG_CHECK_MODULES
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
 # Automake X.Y traces this macro to ensure aclocal.m4 has been
@@ -198,7 +192,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.11.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -214,21 +208,19 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
@@ -310,14 +302,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
+# Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 10
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -357,7 +349,6 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -422,7 +413,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -487,13 +478,10 @@ AC_DEFUN([AM_DEP_TRACK],
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
-  am__nodep='_no'
 fi
 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
 ])
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
@@ -715,15 +703,12 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
@@ -855,15 +840,12 @@ else
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_PROG_MKDIR_P
 # ---------------
 # Check for `mkdir -p'.
@@ -886,14 +868,13 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 4
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -901,13 +882,13 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
 # _AM_SET_OPTION(NAME)
-# --------------------
+# ------------------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
 # _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
+# ----------------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -983,14 +964,12 @@ Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # AM_PROG_INSTALL_STRIP
 # ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
@@ -1013,13 +992,13 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 2
 
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
@@ -1028,13 +1007,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
 # AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
+# ---------------------------
 # Public sister of _AM_SUBST_NOTMAKE.
 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1056,11 +1035,10 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 # a tarball read from stdin.
 #     $(am__untar) < result.tar
 AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AC_SUBST([AMTAR], ['$${TAR-tar}'])
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
 m4_if([$1], [v7],
-     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
      [m4_case([$1], [ustar],, [pax],,
               [m4_fatal([Unknown tar format])])
 AC_MSG_CHECKING([how to create a $1 tar archive])
diff --git a/configure b/configure
index f111ad9..5ea37c6 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for pktools 2.4.
+# Generated by GNU Autoconf 2.67 for pktools 2.4.
 #
 # Report bugs to <kempenep at gmail.com>.
 #
@@ -91,7 +91,6 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -217,18 +216,11 @@ IFS=$as_save_IFS
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -640,7 +632,6 @@ RANLIB
 am__fastdepCXX_FALSE
 am__fastdepCXX_TRUE
 CXXDEPMODE
-am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
@@ -1156,7 +1147,7 @@ Try \`$0 --help' for more information"
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
@@ -1471,7 +1462,7 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 pktools configure 2.4
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1517,7 +1508,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_compile
@@ -1555,7 +1546,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1592,7 +1583,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1605,10 +1596,10 @@ fi
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1675,7 +1666,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1684,7 +1675,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1725,7 +1716,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1739,7 +1730,7 @@ ac_fn_c_check_header_compile ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1757,7 +1748,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_compile
 
@@ -1793,7 +1784,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_cpp
@@ -1835,7 +1826,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_cxx_try_run
@@ -1848,10 +1839,10 @@ fi
 ac_fn_cxx_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1918,7 +1909,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1927,7 +1918,7 @@ eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_cxx_check_header_mongrel
 
@@ -1940,7 +1931,7 @@ ac_fn_cxx_check_type ()
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1981,7 +1972,7 @@ fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_cxx_check_type
 cat >config.log <<_ACEOF
@@ -1989,7 +1980,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by pktools $as_me 2.4, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
 
@@ -2247,7 +2238,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
   fi
 done
 
@@ -2384,7 +2375,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
+if test "${ac_cv_path_install+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2471,11 +2462,11 @@ am_lf='
 '
 case `pwd` in
   *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;;
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;;
 esac
 
 # Do `set' in a subshell so we don't clobber the current shell's
@@ -2561,7 +2552,7 @@ if test "$cross_compiling" != no; then
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
+if test "${ac_cv_prog_STRIP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -2601,7 +2592,7 @@ if test -z "$ac_cv_prog_STRIP"; then
 set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -2654,7 +2645,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
+  if test "${ac_cv_path_mkdir+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -2705,7 +2696,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
+if test "${ac_cv_prog_AWK+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -2745,7 +2736,7 @@ done
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -2833,11 +2824,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
-# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
 
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
 
@@ -2859,7 +2850,7 @@ fi
 set dummy gdal-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $GDAL_CONFIG in
@@ -2900,7 +2891,7 @@ else
 set dummy gdal-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $GDAL_CONFIG in
@@ -3066,7 +3057,7 @@ if test -z "$CXX"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
+if test "${ac_cv_prog_CXX+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
@@ -3110,7 +3101,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
@@ -3274,7 +3265,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C++ compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -3317,7 +3308,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3376,7 +3367,7 @@ $as_echo "$ac_try_echo"; } >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C++ compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
     fi
   fi
 fi
@@ -3387,7 +3378,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
+if test "${ac_cv_objext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3428,7 +3419,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3438,7 +3429,7 @@ OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3475,7 +3466,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
+if test "${ac_cv_prog_cxx_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
@@ -3608,7 +3599,6 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
-  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3624,7 +3614,7 @@ depcc="$CXX"  am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -3633,7 +3623,6 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -3693,7 +3682,7 @@ else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -3753,7 +3742,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
+if test "${ac_cv_prog_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
@@ -3793,7 +3782,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
 set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
@@ -3858,7 +3847,7 @@ fi
 set dummy gdal-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $GDAL_CONFIG in
@@ -3899,7 +3888,7 @@ else
 set dummy gdal-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GDAL_CONFIG+:} false; then :
+if test "${ac_cv_path_GDAL_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $GDAL_CONFIG in
@@ -4043,7 +4032,7 @@ if test -n "$ac_tool_prefix"; then
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4083,7 +4072,7 @@ if test -z "$ac_cv_prog_CC"; then
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4136,7 +4125,7 @@ if test -z "$CC"; then
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4176,7 +4165,7 @@ if test -z "$CC"; then
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4235,7 +4224,7 @@ if test -z "$CC"; then
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4279,7 +4268,7 @@ do
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4334,7 +4323,7 @@ fi
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4363,7 +4352,7 @@ done
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4400,7 +4389,7 @@ ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4478,7 +4467,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4577,7 +4566,7 @@ depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
 $as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
@@ -4586,7 +4575,6 @@ else
   # instance it was reported that on HP-UX the gcc test will end up
   # making a dummy file named `D' -- because `-MD' means `put the output
   # in D'.
-  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4646,7 +4634,7 @@ else
 	break
       fi
       ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+    msvisualcpp | msvcmsys)
       # This compiler won't grok `-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
@@ -4714,7 +4702,7 @@ if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -4830,7 +4818,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 
 ac_ext=c
@@ -4842,7 +4830,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+if test "${ac_cv_path_GREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -4905,7 +4893,7 @@ $as_echo "$ac_cv_path_GREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
+if test "${ac_cv_path_EGREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -4972,7 +4960,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5102,7 +5090,7 @@ done
 for ac_header in gdal.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "gdal.h" "ac_cv_header_gdal_h" "$ac_includes_default"
-if test "x$ac_cv_header_gdal_h" = xyes; then :
+if test "x$ac_cv_header_gdal_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GDAL_H 1
 _ACEOF
@@ -5124,14 +5112,13 @@ fi
 
 
 
-
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -5174,7 +5161,7 @@ if test -z "$ac_cv_path_PKG_CONFIG"; then
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -5255,7 +5242,6 @@ if test -n "$FANN_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FANN_CFLAGS=`$PKG_CONFIG --cflags "fann >= 2.1.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5272,7 +5258,6 @@ if test -n "$FANN_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_FANN_LIBS=`$PKG_CONFIG --libs "fann >= 2.1.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5292,9 +5277,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        FANN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fann >= 2.1.0" 2>&1`
+	        FANN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "fann >= 2.1.0" 2>&1`
         else
-	        FANN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fann >= 2.1.0" 2>&1`
+	        FANN_PKG_ERRORS=`$PKG_CONFIG --print-errors "fann >= 2.1.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$FANN_PKG_ERRORS" >&5
@@ -5398,7 +5383,6 @@ if test -n "$NLOPT_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NLOPT_CFLAGS=`$PKG_CONFIG --cflags "nlopt >= 2.1.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5415,7 +5399,6 @@ if test -n "$NLOPT_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_NLOPT_LIBS=`$PKG_CONFIG --libs "nlopt >= 2.1.0" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5435,9 +5418,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        NLOPT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nlopt >= 2.1.0" 2>&1`
+	        NLOPT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "nlopt >= 2.1.0" 2>&1`
         else
-	        NLOPT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nlopt >= 2.1.0" 2>&1`
+	        NLOPT_PKG_ERRORS=`$PKG_CONFIG --print-errors "nlopt >= 2.1.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$NLOPT_PKG_ERRORS" >&5
@@ -5496,7 +5479,6 @@ if test -n "$GSL_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GSL_CFLAGS=`$PKG_CONFIG --cflags "gsl >= 1.14" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5513,7 +5495,6 @@ if test -n "$GSL_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_GSL_LIBS=`$PKG_CONFIG --libs "gsl >= 1.14" 2>/dev/null`
-		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -5533,9 +5514,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gsl >= 1.14" 2>&1`
+	        GSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gsl >= 1.14" 2>&1`
         else
-	        GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gsl >= 1.14" 2>&1`
+	        GSL_PKG_ERRORS=`$PKG_CONFIG --print-errors "gsl >= 1.14" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$GSL_PKG_ERRORS" >&5
@@ -5579,7 +5560,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
 $as_echo_n "checking how to run the C++ preprocessor... " >&6; }
 if test -z "$CXXCPP"; then
-  if ${ac_cv_prog_CXXCPP+:} false; then :
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CXXCPP needs to be expanded
@@ -5695,7 +5676,7 @@ else
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 
 ac_ext=cpp
@@ -5707,7 +5688,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5820,7 +5801,7 @@ fi
 for ac_header in string
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "string" "ac_cv_header_string" "$ac_includes_default"
-if test "x$ac_cv_header_string" = xyes; then :
+if test "x$ac_cv_header_string" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STRING 1
 _ACEOF
@@ -5832,7 +5813,7 @@ done
 for ac_header in iostream
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "iostream" "ac_cv_header_iostream" "$ac_includes_default"
-if test "x$ac_cv_header_iostream" = xyes; then :
+if test "x$ac_cv_header_iostream" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_IOSTREAM 1
 _ACEOF
@@ -5844,7 +5825,7 @@ done
 
 # Checks for typedefs, structures, and compiler characteristics.
 ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
+if test "x$ac_cv_type_size_t" = x""yes; then :
 
 else
 
@@ -5932,21 +5913,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
+    test "x$cache_file" != "x/dev/null" &&
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
+    cat confcache >$cache_file
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -6026,7 +5996,7 @@ if test -z "${USE_GSL_TRUE}" && test -z "${USE_GSL_FALSE}"; then
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
-: "${CONFIG_STATUS=./config.status}"
+: ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -6127,7 +6097,6 @@ fi
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -6435,7 +6404,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # values after options handling.
 ac_log="
 This file was extended by pktools $as_me 2.4, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -6501,7 +6470,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 pktools config.status 2.4
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -6638,7 +6607,7 @@ do
     "src/fileclasses/Makefile") CONFIG_FILES="$CONFIG_FILES src/fileclasses/Makefile" ;;
     "src/apps/Makefile") CONFIG_FILES="$CONFIG_FILES src/apps/Makefile" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
   esac
 done
 
@@ -6661,10 +6630,9 @@ fi
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp= ac_tmp=
+  tmp=
   trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -6672,13 +6640,12 @@ $debug ||
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
+  test -n "$tmp" && test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -6700,7 +6667,7 @@ else
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -6728,7 +6695,7 @@ done
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -6776,7 +6743,7 @@ t delim
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -6808,7 +6775,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -6842,7 +6809,7 @@ fi # test -n "$CONFIG_FILES"
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+cat >"$tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -6854,8 +6821,8 @@ _ACEOF
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -6956,7 +6923,7 @@ do
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -6975,7 +6942,7 @@ do
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
+      -) ac_f="$tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -6984,7 +6951,7 @@ do
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -7010,8 +6977,8 @@ $as_echo "$as_me: creating $ac_file" >&6;}
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
     esac
     ;;
   esac
@@ -7147,22 +7114,21 @@ s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$ac_tmp/stdin"
+  rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -7173,20 +7139,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
+      mv "$tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
 # Compute "$ac_file"'s index in $config_headers.
diff --git a/src/algorithms/Filter.cc b/src/algorithms/Filter.cc
index 067ca12..f292314 100644
--- a/src/algorithms/Filter.cc
+++ b/src/algorithms/Filter.cc
@@ -21,24 +21,24 @@ along with pktools.  If not, see <http://www.gnu.org/licenses/>.
 #include <assert.h>
 #include <iostream>
 
-Filter::Filter(void)
+filter::Filter::Filter(void)
 {
 }
 
 
-Filter::Filter(const vector<double> &taps)
+filter::Filter::Filter(const vector<double> &taps)
   : m_taps(taps)
 {
   assert(m_taps.size()%2);
 }
 
-void Filter::setTaps(const vector<double> &taps)
+void filter::Filter::setTaps(const vector<double> &taps)
 {
   m_taps=taps;
   assert(m_taps.size()%2);
 }
 
-void Filter::morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dim, short down, int offset)
+void filter::Filter::morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dim, short down, int offset)
 {
   Vector2d<double> lineInput(input.nrOfBand(),input.nrOfCol());
   Vector2d<double> lineOutput(input.nrOfBand(),input.nrOfCol());
@@ -71,7 +71,7 @@ void Filter::morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int m
   }
 }
 
-void Filter::doit(const ImgReaderGdal& input, ImgWriterGdal& output, short down, int offset)
+void filter::Filter::doit(const ImgReaderGdal& input, ImgWriterGdal& output, short down, int offset)
 {
   Vector2d<double> lineInput(input.nrOfBand(),input.nrOfCol());
   Vector2d<double> lineOutput(input.nrOfBand(),input.nrOfCol());
@@ -104,3 +104,36 @@ void Filter::doit(const ImgReaderGdal& input, ImgWriterGdal& output, short down,
   }
 }
 
+void filter::Filter::applyFwhm(const ImgReaderGdal& input, ImgWriterGdal& output, const vector<double> &wavelengthIn, const vector<double> &wavelengthOut, const vector<double> &fwhm, bool verbose){
+  Vector2d<double> lineInput(input.nrOfBand(),input.nrOfCol());
+  Vector2d<double> lineOutput(wavelengthOut.size(),input.nrOfCol());
+  const char* pszMessage;
+  void* pProgressArg=NULL;
+  GDALProgressFunc pfnProgress=GDALTermProgress;
+  double progress=0;
+  pfnProgress(progress,pszMessage,pProgressArg);
+  for(int y=0;y<input.nrOfRow();++y){
+    for(int iband=0;iband<input.nrOfBand();++iband)
+      input.readData(lineInput[iband],GDT_Float64,y,iband);
+    vector<double> pixelInput(input.nrOfBand());
+    vector<double> pixelOutput;
+    for(int x=0;x<input.nrOfCol();++x){
+      pixelInput=lineInput.selectCol(x);
+      applyFwhm<double>(pixelInput,wavelengthIn,pixelOutput,wavelengthOut, fwhm, verbose);
+      for(int iband=0;iband<pixelOutput.size();++iband)
+        lineOutput[iband][x]=pixelOutput[iband];
+    }
+    for(int iband=0;iband<output.nrOfBand();++iband){
+      try{
+        output.writeData(lineOutput[iband],GDT_Float64,y,iband);
+      }
+      catch(string errorstring){
+        cerr << errorstring << "in band " << iband << ", line " << y << endl;
+      }
+    }
+    progress=(1.0+y)/output.nrOfRow();
+    pfnProgress(progress,pszMessage,pProgressArg);
+  }
+}
+
+
diff --git a/src/algorithms/Filter.h b/src/algorithms/Filter.h
index 7973171..a4b6cb4 100644
--- a/src/algorithms/Filter.h
+++ b/src/algorithms/Filter.h
@@ -22,6 +22,9 @@ along with pktools.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <vector>
 #include <iostream>
+#include <gslwrap/vector_double.h>
+#include <gslwrap/matrix_double.h>
+#include <gslwrap/matrix_vector_operators.h>
 #include "StatFactory.h"
 #include "imageclasses/ImgReaderGdal.h"
 #include "imageclasses/ImgWriterGdal.h"
@@ -46,12 +49,128 @@ public:
   void morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dim, short down=1, int offset=0);
   void doit(const ImgReaderGdal& input, ImgWriterGdal& output, short down=1, int offset=0);
 
+  template<class T> void applySrf(const Vector2d<T>& input, const Vector2d<double>& srf, Vector2d<T>& output, double delta=1, bool normalize=false, double centreWavelength=0, bool verbose=false);
+  template<class T> void applyFwhm(const vector<double>& input, const vector<double> &wavelengthIn, vector<double>& output, const vector<double> &wavelengthOut, const vector<double> &fwhm, bool verbose=false);
+  void applyFwhm(const ImgReaderGdal& input, ImgWriterGdal& output, const vector<double> &wavelengthIn, const vector<double> &wavelengthOut, const vector<double> &fwhm, bool verbose=false);
+// int fir(double* input, int nbandIn, vector<double>& output, int startBand, const string& wavelength, const string& fwhm, bool verbose);
+// int fir(const vector<double>&input, vector<double>& output, int startBand, double fwhm, int ntaps, int down, int offset, bool verbose);
+// int fir(double* input, int nbandIn, vector<double>& output, int startBand, double fwhm, int ntaps, int down, int offset, bool verbose);
+
 private:
   vector<double> m_taps;
   vector<short> m_class;
   vector<short> m_mask;
 };
 
+  template<class T> void Filter::applySrf(const Vector2d<T>& input, const Vector2d<double>& srf, Vector2d<T>& output, double delta, bool normalize, double centreWavelength, bool verbose)
+{  
+  output.resize(input.size());
+  assert(srf.size()==2);//[0]: wavelength, [1]: response function
+  assert(input.size()>1);//[0]: wavelength, [1],[2],...: value
+  double start=floor(input[0][0]);
+  double end=ceil(input[0].back());
+  Vector2d<double> product(input.size());  
+  assert(input.size());
+  assert(input[0].size()>1);
+  int nband=srf[0].size();  
+  gsl_interp_accel *acc=gsl_interp_accel_alloc();
+  gsl_spline *spline=gsl_spline_alloc(gsl_interp_linear,nband);
+  gsl_spline_init(spline,&(srf[0][0]),&(srf[1][0]),nband);
+//   double norm=gsl_spline_eval_integ(spline,start,end,acc);
+  double norm=gsl_spline_eval_integ(spline,srf[0].front(),srf[0].back(),acc);
+  gsl_spline_free(spline);
+  gsl_interp_accel_free(acc);  
+  //interpolate input and srf to delta
+  statfactory::StatFactory stat;
+  Vector2d<double> input_d;
+  Vector2d<double> srf_d;
+  stat.interpolateUp(input,input_d,start,end,delta);
+  stat.interpolateUp(srf,srf_d,start,end,delta);
+  nband=input_d[0].size();
+  if(verbose)
+    cout << "number of interpolated bands: " << nband << endl;
+  for(int isample=0;isample<input_d.size();++isample){
+    product[isample].resize(nband);
+    for(int iband=0;iband<nband;++iband){
+      if(!isample)
+	product[isample][iband]=input_d[isample][iband];
+      else{
+// 	if(verbose&&isample==1)
+// 	  cout << srf_d[0][iband] << " " << srf_d[1][iband] << endl;
+	product[isample][iband]=input_d[isample][iband]*srf_d[1][iband];
+      }
+    }
+  }
+  output[0].resize(1);
+  if(centreWavelength)
+    output[0][0]=centreWavelength;
+  else{
+    double maxResponse=0;
+    int maxIndex=0;
+    for(int index=0;index<srf[1].size();++index){
+      if(maxResponse<srf[1][index]){
+	maxResponse=srf[1][index];
+	maxIndex=index;
+      }
+    }
+    output[0][0]=srf[0][maxIndex];
+  }
+  for(int isample=1;isample<input_d.size();++isample){
+    output[isample].resize(1);    
+    gsl_interp_accel *acc=gsl_interp_accel_alloc();
+    gsl_spline *spline=gsl_spline_alloc(gsl_interp_linear,nband);
+    gsl_spline_init(spline,&(product[0][0]),&(product[isample][0]),nband);
+    if(normalize)
+      output[isample][0]=gsl_spline_eval_integ(spline,start,end,acc)/norm;
+    else
+      output[isample][0]=gsl_spline_eval_integ(spline,start,end,acc);
+    gsl_spline_free(spline);
+    gsl_interp_accel_free(acc);
+  }
+}
+
+  template<class T> void Filter::applyFwhm(const vector<double>& input, const vector<double> &wavelengthIn, vector<double>& output, const vector<double> &wavelengthOut, const vector<double> &fwhm, bool verbose){
+  double delta=1;//1 nm resolution
+  vector<double> stddev(fwhm.size());
+  for(int index=0;index<fwhm.size();++index)
+    stddev[index]=fwhm[index]/2.0/sqrt(2*log(2.0));//http://mathworld.wolfram.com/FullWidthatHalfMaximum.html
+  assert(wavelengthOut.size()==fwhm.size());
+  assert(wavelengthIn.size()==input.size());
+  //todo densify input to 1 nm
+  assert(wavelengthIn[0]<wavelengthOut[0]);
+  assert(wavelengthIn.back()<wavelengthOut.back());
+  statfactory::StatFactory stat;
+  Vector2d<double> input_course(1);
+  input_course[0]=input;
+  Vector2d<double> input_fine;
+  vector<double> wavelength_fine;
+  stat.interpolateUp(input_course,wavelengthIn,input_fine,wavelength_fine,wavelengthIn[0],wavelengthIn.back(),delta);
+  int nbandIn=wavelength_fine.size();
+  int nbandOut=wavelengthOut.size();
+  gsl::matrix tf(nbandIn,nbandOut);
+  for(int indexOut=0;indexOut<nbandOut;++indexOut){
+    for(int indexIn=0;indexIn<wavelengthIn.size();++indexIn){
+      tf(indexIn,indexOut)=
+	exp((wavelengthOut[indexOut]-wavelengthIn[indexIn])
+	    *(wavelengthIn[indexIn]-wavelengthOut[indexOut])
+	    /2.0/stddev[indexOut]
+	    /stddev[indexOut]);
+      tf(indexIn,indexOut)/=sqrt(2.0*M_PI);
+      tf(indexIn,indexOut)/=stddev[indexOut];
+    }
+    double norm=exp(tf.LU_lndet());//(tf.Column(indexOut+1)).NormFrobenius();
+    if(norm)
+      tf.get_col(indexOut+1)/=norm;
+  }
+  //create filtered vector
+  output.resize(nbandOut);
+  for(int indexOut=0;indexOut<nbandOut;++indexOut){
+    output[indexOut]=0;
+    for(int indexIn=0;indexIn<nbandIn;++indexIn)
+      output[indexOut]+=input_fine[0][indexIn]*tf(indexIn,indexOut);
+  }
+}
+
 template<class T> void Filter::doit(const vector<T>& input, vector<T>& output, int down, int offset)
 {
   output.resize((input.size()-offset+down-1)/down);
@@ -274,6 +393,5 @@ template<class T> void Filter::doit(T* input, int inputSize, vector<T>& output,
   }
 }
 }
-using namespace filter;
 
 #endif /* _MYFILTER_H_ */
diff --git a/src/algorithms/Filter2d.cc b/src/algorithms/Filter2d.cc
index f20ed11..0ea019e 100644
--- a/src/algorithms/Filter2d.cc
+++ b/src/algorithms/Filter2d.cc
@@ -25,32 +25,32 @@ along with pktools.  If not, see <http://www.gnu.org/licenses/>.
 #include "StatFactory.h"
 // #include "imageclasses/ImgUtils.h"
 
-Filter2d::Filter2d::Filter2d(void)
+filter2d::Filter2d::Filter2d(void)
   : m_noValue(0)
 {
 }
 
-Filter2d::Filter2d::Filter2d(const Vector2d<double> &taps)
+filter2d::Filter2d::Filter2d(const Vector2d<double> &taps)
   : m_taps(taps), m_noValue(0)
 {
 }
 
-void Filter2d::Filter2d::setTaps(const Vector2d<double> &taps)
+void filter2d::Filter2d::setTaps(const Vector2d<double> &taps)
 {
   m_taps=taps;
 }
 
-void Filter2d::Filter2d::smoothNoData(const ImgReaderGdal& input, ImgWriterGdal& output, int dim)
+void filter2d::Filter2d::smoothNoData(const ImgReaderGdal& input, ImgWriterGdal& output, int dim)
 {
   smoothNoData(input, output,dim,dim);
 }
 
-void Filter2d::Filter2d::smooth(const ImgReaderGdal& input, ImgWriterGdal& output, int dim)
+void filter2d::Filter2d::smooth(const ImgReaderGdal& input, ImgWriterGdal& output, int dim)
 {
   smooth(input, output,dim,dim);
 }
 
-void Filter2d::Filter2d::smoothNoData(const ImgReaderGdal& input, ImgWriterGdal& output, int dimX, int dimY)
+void filter2d::Filter2d::smoothNoData(const ImgReaderGdal& input, ImgWriterGdal& output, int dimX, int dimY)
 {
   m_taps.resize(dimY);
   for(int j=0;j<dimY;++j){
@@ -61,7 +61,7 @@ void Filter2d::Filter2d::smoothNoData(const ImgReaderGdal& input, ImgWriterGdal&
   filter(input,output,false,true,true);
 }
 
-void Filter2d::Filter2d::smooth(const ImgReaderGdal& input, ImgWriterGdal& output, int dimX, int dimY)
+void filter2d::Filter2d::smooth(const ImgReaderGdal& input, ImgWriterGdal& output, int dimX, int dimY)
 {
   m_taps.resize(dimY);
   for(int j=0;j<dimY;++j){
@@ -73,7 +73,7 @@ void Filter2d::Filter2d::smooth(const ImgReaderGdal& input, ImgWriterGdal& outpu
 }
 
     
-void Filter2d::Filter2d::filter(const ImgReaderGdal& input, ImgWriterGdal& output, bool absolute, bool normalize, bool noData)
+void filter2d::Filter2d::filter(const ImgReaderGdal& input, ImgWriterGdal& output, bool absolute, bool normalize, bool noData)
 {
   int dimX=m_taps[0].size();//horizontal!!!
   int dimY=m_taps.size();//vertical!!!
@@ -182,7 +182,7 @@ void Filter2d::Filter2d::filter(const ImgReaderGdal& input, ImgWriterGdal& outpu
 }
 
 
-void Filter2d::Filter2d::majorVoting(const string& inputFilename, const string& outputFilename,int dim,const vector<int> &prior)
+void filter2d::Filter2d::majorVoting(const string& inputFilename, const string& outputFilename,int dim,const vector<int> &prior)
 {
   bool usePriors=true;  
   if(prior.empty()){
@@ -383,7 +383,7 @@ void Filter2d::Filter2d::majorVoting(const string& inputFilename, const string&
 //   output.close();
 // }
 
-void Filter2d::Filter2d::median(const string& inputFilename, const string& outputFilename,int dim, bool disc)
+void filter2d::Filter2d::median(const string& inputFilename, const string& outputFilename,int dim, bool disc)
 {
   ImgReaderGdal input;
   ImgWriterGdal output;
@@ -392,7 +392,7 @@ void Filter2d::Filter2d::median(const string& inputFilename, const string& outpu
   doit(input,output,MEDIAN,dim,disc);
 }
 
-void Filter2d::Filter2d::var(const string& inputFilename, const string& outputFilename,int dim, bool disc)
+void filter2d::Filter2d::var(const string& inputFilename, const string& outputFilename,int dim, bool disc)
 {
   ImgReaderGdal input;
   ImgWriterGdal output;
@@ -401,12 +401,12 @@ void Filter2d::Filter2d::var(const string& inputFilename, const string& outputFi
   doit(input,output,VAR,dim,disc);
 }
 
-void Filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dim, short down, bool disc)
+void filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dim, short down, bool disc)
 {
   doit(input,output,method,dim,dim,down,disc);
 }
 
-void Filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dimX, int dimY, short down, bool disc)
+void filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dimX, int dimY, short down, bool disc)
 {
   assert(dimX);
   assert(dimY);
@@ -693,7 +693,7 @@ void Filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output,
 }
 
 //todo: re-implement without dependency of CImg and reg libraries
-// void Filter2d::Filter2d::dwt_texture(const string& inputFilename, const string& outputFilename,int dim, int scale, int down, int iband, bool verbose)
+// void filter2d::Filter2d::dwt_texture(const string& inputFilename, const string& outputFilename,int dim, int scale, int down, int iband, bool verbose)
 // {
 //   ImgReaderGdal input;
 //   ImgWriterGdal output;
@@ -799,7 +799,7 @@ void Filter2d::Filter2d::doit(const ImgReaderGdal& input, ImgWriterGdal& output,
 //   output.close();
 // }
 
-void Filter2d::Filter2d::morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dimX, int dimY, bool disc, double angle)
+void filter2d::Filter2d::morphology(const ImgReaderGdal& input, ImgWriterGdal& output, int method, int dimX, int dimY, bool disc, double angle)
 {
   assert(dimX);
   assert(dimY);
@@ -965,7 +965,7 @@ void Filter2d::Filter2d::morphology(const ImgReaderGdal& input, ImgWriterGdal& o
   }
 }
 
-void Filter2d::Filter2d::shadowDsm(const ImgReaderGdal& input, ImgWriterGdal& output, double sza, double saa, double pixelSize, short shadowFlag){
+void filter2d::Filter2d::shadowDsm(const ImgReaderGdal& input, ImgWriterGdal& output, double sza, double saa, double pixelSize, short shadowFlag){
   Vector2d<float> inputBuffer;
   Vector2d<float> outputBuffer;
   input.readDataBlock(inputBuffer, GDT_Float32, 0, input.nrOfCol()-1, 0, input.nrOfRow()-1, 0);
diff --git a/src/algorithms/Filter2d.h b/src/algorithms/Filter2d.h
index 785d1cf..ed45d1f 100644
--- a/src/algorithms/Filter2d.h
+++ b/src/algorithms/Filter2d.h
@@ -37,10 +37,11 @@ along with pktools.  If not, see <http://www.gnu.org/licenses/>.
 #include "base/Vector2d.h"
 #include "imageclasses/ImgReaderGdal.h"
 #include "imageclasses/ImgWriterGdal.h"
+#include "algorithms/StatFactory.h"
 
 using namespace std;
 // using namespace cimg_library;
-namespace Filter2d
+namespace filter2d
 {
   enum Type { MEDIAN=0, VAR=1 , MIN=2, MAX=3, SUM=4, MEAN=5, MINMAX=6, DILATE=7, ERODE=8, CLOSE=9, OPEN=10, HOMOG=11, SOBELX=12, SOBELY=13, SOBELXY=14, SOBELYX=-14, SMOOTH=15, DENSITY=16, MAJORITY=17, MIXED=18, SMOOTHNODATA=19, THRESHOLD=20, ISMIN=21, ISMAX=22, HETEROG=23, ORDER=24, STDEV=25};
   
@@ -151,7 +152,7 @@ private:
 
 template<class T1, class T2> void Filter2d::doit(const Vector2d<T1>& inputVector, Vector2d<T2>& outputVector, int method, int dimX, int dimY, short down, bool disc)
 {
-  Histogram hist;
+  statfactory::StatFactory stat;
   outputVector.resize((inputVector.size()+down-1)/down);
   Vector2d<T1> inBuffer(dimY);
   vector<T2> outBuffer((inputVector[0].size()+down-1)/down);
@@ -231,41 +232,41 @@ template<class T1, class T2> void Filter2d::doit(const Vector2d<T1>& inputVector
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=hist.median(windowBuffer);
+          outBuffer[x/down]=stat.median(windowBuffer);
         break;
       case(VAR):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=hist.var(windowBuffer);
+          outBuffer[x/down]=stat.var(windowBuffer);
         break;
       }
       case(STDEV):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=sqrt(hist.var(windowBuffer));
+          outBuffer[x/down]=sqrt(stat.var(windowBuffer));
         break;
       }
       case(MEAN):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=hist.mean(windowBuffer);
+          outBuffer[x/down]=stat.mean(windowBuffer);
         break;
       }
       case(MIN):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=hist.min(windowBuffer);
+          outBuffer[x/down]=stat.min(windowBuffer);
         break;
       }
       case(ISMIN):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=(hist.min(windowBuffer)==windowBuffer[dimX*dimY/2])? 1:0;
+          outBuffer[x/down]=(stat.min(windowBuffer)==windowBuffer[dimX*dimY/2])? 1:0;
         break;
       }
       case(MINMAX):{
@@ -274,7 +275,7 @@ template<class T1, class T2> void Filter2d::doit(const Vector2d<T1>& inputVector
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else{
-          hist.minmax(windowBuffer,windowBuffer.begin(),windowBuffer.end(),min,max);
+          stat.minmax(windowBuffer,windowBuffer.begin(),windowBuffer.end(),min,max);
           if(min!=max)
             outBuffer[x/down]=0;
           else
@@ -286,14 +287,14 @@ template<class T1, class T2> void Filter2d::doit(const Vector2d<T1>& inputVector
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=hist.max(windowBuffer);
+          outBuffer[x/down]=stat.max(windowBuffer);
         break;
       }
       case(ISMAX):{
         if(windowBuffer.empty())
           outBuffer[x/down]=m_noValue;
         else
-          outBuffer[x/down]=(hist.max(windowBuffer)==windowBuffer[dimX*dimY/2])? 1:0;
+          outBuffer[x/down]=(stat.max(windowBuffer)==windowBuffer[dimX*dimY/2])? 1:0;
         break;
       }
       case(ORDER):{
@@ -302,15 +303,15 @@ template<class T1, class T2> void Filter2d::doit(const Vector2d<T1>& inputVector
         else{
           double lbound=0;
           double ubound=dimX*dimY;
-          double theMin=hist.min(windowBuffer);
-          double theMax=hist.max(windowBuffer);
+          double theMin=stat.min(windowBuffer);
+          double theMax=stat.max(windowBuffer);
           double scale=(ubound-lbound)/(theMax-theMin);
           outBuffer[x/down]=static_cast<short>(scale*(windowBuffer[dimX*dimY/2]-theMin)+lbound);
         }
         break;
       }
       case(SUM):{
-        outBuffer[x/down]=hist.sum(windowBuffer);
+        outBuffer[x/down]=stat.sum(windowBuffer);
         break;
       }
       case(HOMOG):
@@ -423,7 +424,7 @@ template<class T> unsigned long int Filter2d::morphology(const Vector2d<T>& inpu
   unsigned long int nchange=0;
   assert(dimX);
   assert(dimY);
-  Histogram hist;
+  statfactory::StatFactory stat;
   Vector2d<T> inBuffer(dimY,input.nCols());
   output.clear();
   output.resize(input.nRows(),input.nCols());
@@ -455,7 +456,7 @@ template<class T> unsigned long int Filter2d::morphology(const Vector2d<T>& inpu
     for(int x=0;x<input.nCols();++x){
       output[y][x]=0;
       double currentValue=inBuffer[dimY/2][x];
-      vector<double> histBuffer;
+      vector<double> statBuffer;
       bool currentMasked=false;
       for(int imask=0;imask<m_mask.size();++imask){
         if(currentValue==m_mask[imask]){
@@ -502,23 +503,23 @@ template<class T> unsigned long int Filter2d::morphology(const Vector2d<T>& inpu
                 }
               }
               if(m_class.size())
-                histBuffer.push_back(binValue);
+                statBuffer.push_back(binValue);
               else
-                histBuffer.push_back(inBuffer[indexJ][indexI]);
+                statBuffer.push_back(inBuffer[indexJ][indexI]);
             }
           }
         }
-        if(histBuffer.size()){
+        if(statBuffer.size()){
           switch(method){
           case(DILATE):
-            if(output[y][x]<hist.max(histBuffer)-hThreshold){
-              output[y][x]=hist.max(histBuffer);
+            if(output[y][x]<stat.max(statBuffer)-hThreshold){
+              output[y][x]=stat.max(statBuffer);
               ++nchange;
             }
             break;
           case(ERODE):
-            if(output[y][x]>hist.min(histBuffer)+hThreshold){
-              output[y][x]=hist.min(histBuffer);
+            if(output[y][x]>stat.min(statBuffer)+hThreshold){
+              output[y][x]=stat.min(statBuffer);
               ++nchange;
             }
             break;
diff --git a/src/algorithms/Makefile.in b/src/algorithms/Makefile.in
index 7fbe33b..c6d7f0e 100644
--- a/src/algorithms/Makefile.in
+++ b/src/algorithms/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -53,14 +53,14 @@ ARFLAGS = cru
 libalgorithms_a_AR = $(AR) $(ARFLAGS)
 libalgorithms_a_LIBADD =
 am__libalgorithms_a_SOURCES_DIST = Egcs.h Filter2d.h Filter.h \
-	Histogram.h ConfusionMatrix.h svm.h FeatureSelector.h \
+	StatFactory.h ConfusionMatrix.h svm.h FeatureSelector.h \
 	myfann_cpp.h SensorModel.h OptFactory.h Egcs.cc Filter2d.cc \
-	Filter.cc Histogram.cc ConfusionMatrix.cc svm.cpp
+	Filter.cc ConfusionMatrix.cc svm.cpp
 am__objects_1 =
 am__objects_2 = $(am__objects_1) $(am__objects_1)
 am_libalgorithms_a_OBJECTS = $(am__objects_2) Egcs.$(OBJEXT) \
-	Filter2d.$(OBJEXT) Filter.$(OBJEXT) Histogram.$(OBJEXT) \
-	ConfusionMatrix.$(OBJEXT) svm.$(OBJEXT)
+	Filter2d.$(OBJEXT) Filter.$(OBJEXT) ConfusionMatrix.$(OBJEXT) \
+	svm.$(OBJEXT)
 libalgorithms_a_OBJECTS = $(am_libalgorithms_a_OBJECTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -78,7 +78,7 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libalgorithms_a_SOURCES)
 DIST_SOURCES = $(am__libalgorithms_a_SOURCES_DIST)
 am__libalgorithms_a_HEADERS_DIST = Egcs.h Filter2d.h Filter.h \
-	Histogram.h ConfusionMatrix.h svm.h FeatureSelector.h \
+	StatFactory.h ConfusionMatrix.h svm.h FeatureSelector.h \
 	myfann_cpp.h SensorModel.h OptFactory.h
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
@@ -101,12 +101,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(libalgorithms_adir)"
 HEADERS = $(libalgorithms_a_HEADERS)
 ETAGS = etags
@@ -234,12 +228,12 @@ noinst_LIBRARIES = libalgorithms.a
 libalgorithms_adir = $(includedir)/algorithms
 
 # the list of header files that belong to the library (to be installed later)
-libalgorithms_a_HEADERS = Egcs.h Filter2d.h Filter.h Histogram.h \
+libalgorithms_a_HEADERS = Egcs.h Filter2d.h Filter.h StatFactory.h \
 	ConfusionMatrix.h svm.h FeatureSelector.h $(am__append_1) \
 	$(am__append_2)
 
 # the sources to add to the library and to add to the source distribution
-libalgorithms_a_SOURCES = $(libalgorithms_a_HEADERS) Egcs.cc Filter2d.cc Filter.cc Histogram.cc ConfusionMatrix.cc svm.cpp
+libalgorithms_a_SOURCES = $(libalgorithms_a_HEADERS) Egcs.cc Filter2d.cc Filter.cc ConfusionMatrix.cc svm.cpp
 all: all-am
 
 .SUFFIXES:
@@ -277,7 +271,7 @@ $(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libalgorithms.a: $(libalgorithms_a_OBJECTS) $(libalgorithms_a_DEPENDENCIES) $(EXTRA_libalgorithms_a_DEPENDENCIES) 
+libalgorithms.a: $(libalgorithms_a_OBJECTS) $(libalgorithms_a_DEPENDENCIES) 
 	-rm -f libalgorithms.a
 	$(libalgorithms_a_AR) libalgorithms.a $(libalgorithms_a_OBJECTS) $(libalgorithms_a_LIBADD)
 	$(RANLIB) libalgorithms.a
@@ -292,7 +286,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Egcs.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Filter2d.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Histogram.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/svm.Po at am__quote@
 
 .cc.o:
@@ -339,7 +332,9 @@ uninstall-libalgorithms_aHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(libalgorithms_a_HEADERS)'; test -n "$(libalgorithms_adir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(libalgorithms_adir)'; $(am__uninstall_files_from_dir)
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libalgorithms_adir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libalgorithms_adir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -440,15 +435,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/algorithms/StatFactory.h b/src/algorithms/StatFactory.h
index 98e44f3..2e38ef7 100644
--- a/src/algorithms/StatFactory.h
+++ b/src/algorithms/StatFactory.h
@@ -75,7 +75,8 @@ public:
   template<class T> double correlation(const vector<T>& x, const vector<T>& y, int delay=0) const;
   template<class T> double cross_correlation(const vector<T>& x, const vector<T>& y, int maxdelay, vector<T>& z) const;
   template<class T> double linear_regression(const vector<T>& x, const vector<T>& y, double &c0, double &c1) const;
-  template<class T> void interpolateUp(const vector< vector<T> >& input, vector< vector<T> >& output, double start, double end, double step, int type=0);
+  template<class T> void interpolateUp(const vector< vector<T> >& input, vector< vector<T> >& output, double start, double end, double step, int type=1);
+  template<class T> void interpolateUp(const vector< vector<T> >& input, const vector<double>& wavelengthIn, vector< vector<T> >& output, vector<double>& wavelengthOut, double start, double end, double step, int type=1);
   template<class T> void interpolateUp(const vector<T>& input, vector<T>& output, int nbin);
   template<class T> void interpolateUp(double* input, int dim, vector<T>& output, int nbin);
   template<class T> void interpolateDown(const vector<T>& input, vector<T>& output, int nbin);
@@ -459,7 +460,59 @@ template<class T> double StatFactory::cross_correlation(const vector<T>& x, cons
 //alternatively: use GNU scientific library:
 // gsl_stats_correlation (const double data1[], const size_t stride1, const double data2[], const size_t stride2, const size_t n)
 
-template<class T> void StatFactory::interpolateUp(const vector< vector<T> >& input, vector< vector<T> >& output, double start, double end, double step, int type)
+  template<class T> void StatFactory::interpolateUp(const vector< vector<T> >& input, const vector<double>& wavelengthIn, vector< vector<T> >& output, vector<double>& wavelengthOut, double start, double end, double step, int type){
+  int nsample=input.size();//first sample contains wavelength
+  int nband=wavelengthIn.size();    
+  output.clear();
+  wavelengthOut.clear();
+  output.resize(nsample);//first sample contains wavelength
+  start=(start)?start:floor(wavelengthIn[0]);
+  end=(end)?end:ceil(wavelengthIn.back());
+  for(double xi=start;xi<=end;xi+=step)
+    wavelengthOut.push_back(xi);
+  for(int isample=0;isample<nsample;++isample){
+    gsl_interp_accel *acc=gsl_interp_accel_alloc();
+    gsl_spline *spline;
+    switch(type){
+    case(POLYNOMIAL):
+      spline=gsl_spline_alloc(gsl_interp_polynomial,nband);
+      break;
+    case(CSPLINE):
+        spline=gsl_spline_alloc(gsl_interp_cspline,nband);
+        break;
+    case(PERIODIC):
+        spline=gsl_spline_alloc(gsl_interp_cspline_periodic,nband);
+        break;
+    case(AKIMA):
+        spline=gsl_spline_alloc(gsl_interp_akima,nband);
+        break;
+    case(AKIMA_PERIODIC):
+        spline=gsl_spline_alloc(gsl_interp_akima_periodic,nband);
+        break;
+    case(LINEAR):
+        spline=gsl_spline_alloc(gsl_interp_linear,nband);
+        break;
+    case(UNDEFINED):
+    default:{
+      string errorString="Error: interpolation type not defined: ";
+      errorString+=type;
+      throw(errorString);
+        break;
+    }
+    }
+    gsl_spline_init(spline,&(wavelengthIn[0]),&(input[isample][0]),nband);      
+    for(double xi=start;xi<=end;xi+=step){
+      if(!type&&xi>wavelengthIn.back())
+        output[isample].push_back(output[isample].back());
+      else
+        output[isample].push_back(gsl_spline_eval(spline,xi,acc));
+    }
+    gsl_spline_free(spline);
+    gsl_interp_accel_free(acc);
+  }
+  }
+
+  template<class T> void StatFactory::interpolateUp(const vector< vector<T> >& input, vector< vector<T> >& output, double start, double end, double step, int type)
 {
   int nsample=input.size()-1;//first sample contains wavelength
   int nband=input[0].size();    
@@ -485,11 +538,10 @@ template<class T> void StatFactory::interpolateUp(const vector< vector<T> >& inp
     case(AKIMA):
         spline=gsl_spline_alloc(gsl_interp_akima,nband);
         break;
-    case(PERIODIC):
+    case(AKIMA_PERIODIC):
         spline=gsl_spline_alloc(gsl_interp_akima_periodic,nband);
         break;
     case(LINEAR):
-    default:
         spline=gsl_spline_alloc(gsl_interp_linear,nband);
         break;
     case(UNDEFINED):
@@ -509,9 +561,8 @@ template<class T> void StatFactory::interpolateUp(const vector< vector<T> >& inp
     }
     gsl_spline_free(spline);
     gsl_interp_accel_free(acc);
-
-  }    
-}    
+  }
+}
 
 template<class T> void StatFactory::interpolateUp(const vector<T>& input, vector<T>& output, int nbin)
 {
diff --git a/src/apps/Makefile.am b/src/apps/Makefile.am
index bff0785..c68e2a3 100644
--- a/src/apps/Makefile.am
+++ b/src/apps/Makefile.am
@@ -44,14 +44,15 @@ pkdumpimg_SOURCES = pkdumpimg.cc
 pkdumpogr_SOURCES = pkdumpogr.h pkdumpogr.cc
 pksieve_SOURCES = pksieve.cc
 pkstat_SOURCES = $(top_srcdir)/src/algorithms/Histogram.h pkstat.cc
-pkstat_LDADD = -lfileClasses $(GSL_LIBS) $(AM_LDFLAGS)
+pkstat_LDADD = -L$(top_builddir)/src/fileclasses -lfileClasses $(GSL_LIBS) $(AM_LDFLAGS)
 pkstatogr_SOURCES = pkstatogr.cc
 pkegcs_SOURCES = pkegcs.cc
 pkegcs_LDADD = -lgdal $(AM_LDFLAGS) -lgdal
 pkextract_SOURCES = pkextract.cc
 pkfillnodata_SOURCES = pkfillnodata.cc
 pkfilter_SOURCES = pkfilter.cc
-#pkfilter_LDADD = -lgdal $(AM_LDFLAGS) -lgdal
+pkfilter_LDADD = $(GSL_LIBS) $(AM_LDFLAGS) -lgslwrap -lgdal
+
 pkdsm2shadow_SOURCES = pkdsm2shadow.cc
 pkmosaic_SOURCES = pkmosaic.cc
 pkndvi_SOURCES = pkndvi.cc
diff --git a/src/apps/Makefile.in b/src/apps/Makefile.in
index 312ffff..039a633 100644
--- a/src/apps/Makefile.in
+++ b/src/apps/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -156,10 +156,7 @@ pkfillnodata_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(top_builddir)/src/imageclasses/libimageClasses.a
 am_pkfilter_OBJECTS = pkfilter.$(OBJEXT)
 pkfilter_OBJECTS = $(am_pkfilter_OBJECTS)
-pkfilter_LDADD = $(LDADD)
-pkfilter_DEPENDENCIES = $(am__DEPENDENCIES_1) \
-	$(top_builddir)/src/algorithms/libalgorithms.a \
-	$(top_builddir)/src/imageclasses/libimageClasses.a
+pkfilter_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
 am__pkfs_nn_SOURCES_DIST = $(top_srcdir)/src/algorithms/myfann_cpp.h \
 	pkfs_nn.cc
 @USE_FANN_TRUE at am_pkfs_nn_OBJECTS = pkfs_nn-pkfs_nn.$(OBJEXT)
@@ -422,14 +419,14 @@ pkdumpimg_SOURCES = pkdumpimg.cc
 pkdumpogr_SOURCES = pkdumpogr.h pkdumpogr.cc
 pksieve_SOURCES = pksieve.cc
 pkstat_SOURCES = $(top_srcdir)/src/algorithms/Histogram.h pkstat.cc
-pkstat_LDADD = $(GSL_LIBS) $(AM_LDFLAGS)
+pkstat_LDADD = -L$(top_builddir)/src/fileclasses -lfileClasses $(GSL_LIBS) $(AM_LDFLAGS)
 pkstatogr_SOURCES = pkstatogr.cc
 pkegcs_SOURCES = pkegcs.cc
 pkegcs_LDADD = -lgdal $(AM_LDFLAGS) -lgdal
 pkextract_SOURCES = pkextract.cc
 pkfillnodata_SOURCES = pkfillnodata.cc
 pkfilter_SOURCES = pkfilter.cc
-#pkfilter_LDADD = -lgdal $(AM_LDFLAGS) -lgdal
+pkfilter_LDADD = $(GSL_LIBS) $(AM_LDFLAGS) -lgslwrap -lgdal
 pkdsm2shadow_SOURCES = pkdsm2shadow.cc
 pkmosaic_SOURCES = pkmosaic.cc
 pkndvi_SOURCES = pkndvi.cc
@@ -512,94 +509,94 @@ uninstall-binPROGRAMS:
 
 clean-binPROGRAMS:
 	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-pkascii2img$(EXEEXT): $(pkascii2img_OBJECTS) $(pkascii2img_DEPENDENCIES) $(EXTRA_pkascii2img_DEPENDENCIES) 
+pkascii2img$(EXEEXT): $(pkascii2img_OBJECTS) $(pkascii2img_DEPENDENCIES) 
 	@rm -f pkascii2img$(EXEEXT)
 	$(CXXLINK) $(pkascii2img_OBJECTS) $(pkascii2img_LDADD) $(LIBS)
-pkascii2ogr$(EXEEXT): $(pkascii2ogr_OBJECTS) $(pkascii2ogr_DEPENDENCIES) $(EXTRA_pkascii2ogr_DEPENDENCIES) 
+pkascii2ogr$(EXEEXT): $(pkascii2ogr_OBJECTS) $(pkascii2ogr_DEPENDENCIES) 
 	@rm -f pkascii2ogr$(EXEEXT)
 	$(CXXLINK) $(pkascii2ogr_OBJECTS) $(pkascii2ogr_LDADD) $(LIBS)
-pkclassify_nn$(EXEEXT): $(pkclassify_nn_OBJECTS) $(pkclassify_nn_DEPENDENCIES) $(EXTRA_pkclassify_nn_DEPENDENCIES) 
+pkclassify_nn$(EXEEXT): $(pkclassify_nn_OBJECTS) $(pkclassify_nn_DEPENDENCIES) 
 	@rm -f pkclassify_nn$(EXEEXT)
 	$(pkclassify_nn_LINK) $(pkclassify_nn_OBJECTS) $(pkclassify_nn_LDADD) $(LIBS)
-pkclassify_svm$(EXEEXT): $(pkclassify_svm_OBJECTS) $(pkclassify_svm_DEPENDENCIES) $(EXTRA_pkclassify_svm_DEPENDENCIES) 
+pkclassify_svm$(EXEEXT): $(pkclassify_svm_OBJECTS) $(pkclassify_svm_DEPENDENCIES) 
 	@rm -f pkclassify_svm$(EXEEXT)
 	$(CXXLINK) $(pkclassify_svm_OBJECTS) $(pkclassify_svm_LDADD) $(LIBS)
-pkcreatect$(EXEEXT): $(pkcreatect_OBJECTS) $(pkcreatect_DEPENDENCIES) $(EXTRA_pkcreatect_DEPENDENCIES) 
+pkcreatect$(EXEEXT): $(pkcreatect_OBJECTS) $(pkcreatect_DEPENDENCIES) 
 	@rm -f pkcreatect$(EXEEXT)
 	$(CXXLINK) $(pkcreatect_OBJECTS) $(pkcreatect_LDADD) $(LIBS)
-pkcrop$(EXEEXT): $(pkcrop_OBJECTS) $(pkcrop_DEPENDENCIES) $(EXTRA_pkcrop_DEPENDENCIES) 
+pkcrop$(EXEEXT): $(pkcrop_OBJECTS) $(pkcrop_DEPENDENCIES) 
 	@rm -f pkcrop$(EXEEXT)
 	$(CXXLINK) $(pkcrop_OBJECTS) $(pkcrop_LDADD) $(LIBS)
-pkdiff$(EXEEXT): $(pkdiff_OBJECTS) $(pkdiff_DEPENDENCIES) $(EXTRA_pkdiff_DEPENDENCIES) 
+pkdiff$(EXEEXT): $(pkdiff_OBJECTS) $(pkdiff_DEPENDENCIES) 
 	@rm -f pkdiff$(EXEEXT)
 	$(CXXLINK) $(pkdiff_OBJECTS) $(pkdiff_LDADD) $(LIBS)
-pkdsm2shadow$(EXEEXT): $(pkdsm2shadow_OBJECTS) $(pkdsm2shadow_DEPENDENCIES) $(EXTRA_pkdsm2shadow_DEPENDENCIES) 
+pkdsm2shadow$(EXEEXT): $(pkdsm2shadow_OBJECTS) $(pkdsm2shadow_DEPENDENCIES) 
 	@rm -f pkdsm2shadow$(EXEEXT)
 	$(CXXLINK) $(pkdsm2shadow_OBJECTS) $(pkdsm2shadow_LDADD) $(LIBS)
-pkdumpimg$(EXEEXT): $(pkdumpimg_OBJECTS) $(pkdumpimg_DEPENDENCIES) $(EXTRA_pkdumpimg_DEPENDENCIES) 
+pkdumpimg$(EXEEXT): $(pkdumpimg_OBJECTS) $(pkdumpimg_DEPENDENCIES) 
 	@rm -f pkdumpimg$(EXEEXT)
 	$(CXXLINK) $(pkdumpimg_OBJECTS) $(pkdumpimg_LDADD) $(LIBS)
-pkdumpogr$(EXEEXT): $(pkdumpogr_OBJECTS) $(pkdumpogr_DEPENDENCIES) $(EXTRA_pkdumpogr_DEPENDENCIES) 
+pkdumpogr$(EXEEXT): $(pkdumpogr_OBJECTS) $(pkdumpogr_DEPENDENCIES) 
 	@rm -f pkdumpogr$(EXEEXT)
 	$(CXXLINK) $(pkdumpogr_OBJECTS) $(pkdumpogr_LDADD) $(LIBS)
-pkeditogr$(EXEEXT): $(pkeditogr_OBJECTS) $(pkeditogr_DEPENDENCIES) $(EXTRA_pkeditogr_DEPENDENCIES) 
+pkeditogr$(EXEEXT): $(pkeditogr_OBJECTS) $(pkeditogr_DEPENDENCIES) 
 	@rm -f pkeditogr$(EXEEXT)
 	$(CXXLINK) $(pkeditogr_OBJECTS) $(pkeditogr_LDADD) $(LIBS)
-pkegcs$(EXEEXT): $(pkegcs_OBJECTS) $(pkegcs_DEPENDENCIES) $(EXTRA_pkegcs_DEPENDENCIES) 
+pkegcs$(EXEEXT): $(pkegcs_OBJECTS) $(pkegcs_DEPENDENCIES) 
 	@rm -f pkegcs$(EXEEXT)
 	$(CXXLINK) $(pkegcs_OBJECTS) $(pkegcs_LDADD) $(LIBS)
-pkextract$(EXEEXT): $(pkextract_OBJECTS) $(pkextract_DEPENDENCIES) $(EXTRA_pkextract_DEPENDENCIES) 
+pkextract$(EXEEXT): $(pkextract_OBJECTS) $(pkextract_DEPENDENCIES) 
 	@rm -f pkextract$(EXEEXT)
 	$(CXXLINK) $(pkextract_OBJECTS) $(pkextract_LDADD) $(LIBS)
-pkfillnodata$(EXEEXT): $(pkfillnodata_OBJECTS) $(pkfillnodata_DEPENDENCIES) $(EXTRA_pkfillnodata_DEPENDENCIES) 
+pkfillnodata$(EXEEXT): $(pkfillnodata_OBJECTS) $(pkfillnodata_DEPENDENCIES) 
 	@rm -f pkfillnodata$(EXEEXT)
 	$(CXXLINK) $(pkfillnodata_OBJECTS) $(pkfillnodata_LDADD) $(LIBS)
-pkfilter$(EXEEXT): $(pkfilter_OBJECTS) $(pkfilter_DEPENDENCIES) $(EXTRA_pkfilter_DEPENDENCIES) 
+pkfilter$(EXEEXT): $(pkfilter_OBJECTS) $(pkfilter_DEPENDENCIES) 
 	@rm -f pkfilter$(EXEEXT)
 	$(CXXLINK) $(pkfilter_OBJECTS) $(pkfilter_LDADD) $(LIBS)
-pkfs_nn$(EXEEXT): $(pkfs_nn_OBJECTS) $(pkfs_nn_DEPENDENCIES) $(EXTRA_pkfs_nn_DEPENDENCIES) 
+pkfs_nn$(EXEEXT): $(pkfs_nn_OBJECTS) $(pkfs_nn_DEPENDENCIES) 
 	@rm -f pkfs_nn$(EXEEXT)
 	$(pkfs_nn_LINK) $(pkfs_nn_OBJECTS) $(pkfs_nn_LDADD) $(LIBS)
-pkfs_svm$(EXEEXT): $(pkfs_svm_OBJECTS) $(pkfs_svm_DEPENDENCIES) $(EXTRA_pkfs_svm_DEPENDENCIES) 
+pkfs_svm$(EXEEXT): $(pkfs_svm_OBJECTS) $(pkfs_svm_DEPENDENCIES) 
 	@rm -f pkfs_svm$(EXEEXT)
 	$(CXXLINK) $(pkfs_svm_OBJECTS) $(pkfs_svm_LDADD) $(LIBS)
-pkgetmask$(EXEEXT): $(pkgetmask_OBJECTS) $(pkgetmask_DEPENDENCIES) $(EXTRA_pkgetmask_DEPENDENCIES) 
+pkgetmask$(EXEEXT): $(pkgetmask_OBJECTS) $(pkgetmask_DEPENDENCIES) 
 	@rm -f pkgetmask$(EXEEXT)
 	$(CXXLINK) $(pkgetmask_OBJECTS) $(pkgetmask_LDADD) $(LIBS)
-pkinfo$(EXEEXT): $(pkinfo_OBJECTS) $(pkinfo_DEPENDENCIES) $(EXTRA_pkinfo_DEPENDENCIES) 
+pkinfo$(EXEEXT): $(pkinfo_OBJECTS) $(pkinfo_DEPENDENCIES) 
 	@rm -f pkinfo$(EXEEXT)
 	$(CXXLINK) $(pkinfo_OBJECTS) $(pkinfo_LDADD) $(LIBS)
-pklas2img$(EXEEXT): $(pklas2img_OBJECTS) $(pklas2img_DEPENDENCIES) $(EXTRA_pklas2img_DEPENDENCIES) 
+pklas2img$(EXEEXT): $(pklas2img_OBJECTS) $(pklas2img_DEPENDENCIES) 
 	@rm -f pklas2img$(EXEEXT)
 	$(CXXLINK) $(pklas2img_OBJECTS) $(pklas2img_LDADD) $(LIBS)
-pkmosaic$(EXEEXT): $(pkmosaic_OBJECTS) $(pkmosaic_DEPENDENCIES) $(EXTRA_pkmosaic_DEPENDENCIES) 
+pkmosaic$(EXEEXT): $(pkmosaic_OBJECTS) $(pkmosaic_DEPENDENCIES) 
 	@rm -f pkmosaic$(EXEEXT)
 	$(CXXLINK) $(pkmosaic_OBJECTS) $(pkmosaic_LDADD) $(LIBS)
-pkndvi$(EXEEXT): $(pkndvi_OBJECTS) $(pkndvi_DEPENDENCIES) $(EXTRA_pkndvi_DEPENDENCIES) 
+pkndvi$(EXEEXT): $(pkndvi_OBJECTS) $(pkndvi_DEPENDENCIES) 
 	@rm -f pkndvi$(EXEEXT)
 	$(CXXLINK) $(pkndvi_OBJECTS) $(pkndvi_LDADD) $(LIBS)
-pkopt_svm$(EXEEXT): $(pkopt_svm_OBJECTS) $(pkopt_svm_DEPENDENCIES) $(EXTRA_pkopt_svm_DEPENDENCIES) 
+pkopt_svm$(EXEEXT): $(pkopt_svm_OBJECTS) $(pkopt_svm_DEPENDENCIES) 
 	@rm -f pkopt_svm$(EXEEXT)
 	$(CXXLINK) $(pkopt_svm_OBJECTS) $(pkopt_svm_LDADD) $(LIBS)
-pkpolygonize$(EXEEXT): $(pkpolygonize_OBJECTS) $(pkpolygonize_DEPENDENCIES) $(EXTRA_pkpolygonize_DEPENDENCIES) 
+pkpolygonize$(EXEEXT): $(pkpolygonize_OBJECTS) $(pkpolygonize_DEPENDENCIES) 
 	@rm -f pkpolygonize$(EXEEXT)
 	$(CXXLINK) $(pkpolygonize_OBJECTS) $(pkpolygonize_LDADD) $(LIBS)
-pkreclass$(EXEEXT): $(pkreclass_OBJECTS) $(pkreclass_DEPENDENCIES) $(EXTRA_pkreclass_DEPENDENCIES) 
+pkreclass$(EXEEXT): $(pkreclass_OBJECTS) $(pkreclass_DEPENDENCIES) 
 	@rm -f pkreclass$(EXEEXT)
 	$(CXXLINK) $(pkreclass_OBJECTS) $(pkreclass_LDADD) $(LIBS)
-pksensormodel$(EXEEXT): $(pksensormodel_OBJECTS) $(pksensormodel_DEPENDENCIES) $(EXTRA_pksensormodel_DEPENDENCIES) 
+pksensormodel$(EXEEXT): $(pksensormodel_OBJECTS) $(pksensormodel_DEPENDENCIES) 
 	@rm -f pksensormodel$(EXEEXT)
 	$(CXXLINK) $(pksensormodel_OBJECTS) $(pksensormodel_LDADD) $(LIBS)
-pksetmask$(EXEEXT): $(pksetmask_OBJECTS) $(pksetmask_DEPENDENCIES) $(EXTRA_pksetmask_DEPENDENCIES) 
+pksetmask$(EXEEXT): $(pksetmask_OBJECTS) $(pksetmask_DEPENDENCIES) 
 	@rm -f pksetmask$(EXEEXT)
 	$(CXXLINK) $(pksetmask_OBJECTS) $(pksetmask_LDADD) $(LIBS)
-pksieve$(EXEEXT): $(pksieve_OBJECTS) $(pksieve_DEPENDENCIES) $(EXTRA_pksieve_DEPENDENCIES) 
+pksieve$(EXEEXT): $(pksieve_OBJECTS) $(pksieve_DEPENDENCIES) 
 	@rm -f pksieve$(EXEEXT)
 	$(CXXLINK) $(pksieve_OBJECTS) $(pksieve_LDADD) $(LIBS)
-pkstat$(EXEEXT): $(pkstat_OBJECTS) $(pkstat_DEPENDENCIES) $(EXTRA_pkstat_DEPENDENCIES) 
+pkstat$(EXEEXT): $(pkstat_OBJECTS) $(pkstat_DEPENDENCIES) 
 	@rm -f pkstat$(EXEEXT)
 	$(CXXLINK) $(pkstat_OBJECTS) $(pkstat_LDADD) $(LIBS)
-pkstatogr$(EXEEXT): $(pkstatogr_OBJECTS) $(pkstatogr_DEPENDENCIES) $(EXTRA_pkstatogr_DEPENDENCIES) 
+pkstatogr$(EXEEXT): $(pkstatogr_OBJECTS) $(pkstatogr_DEPENDENCIES) 
 	@rm -f pkstatogr$(EXEEXT)
 	$(CXXLINK) $(pkstatogr_OBJECTS) $(pkstatogr_LDADD) $(LIBS)
 
@@ -810,15 +807,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/apps/pkdsm2shadow.cc b/src/apps/pkdsm2shadow.cc
index 958f7e7..b087a50 100644
--- a/src/apps/pkdsm2shadow.cc
+++ b/src/apps/pkdsm2shadow.cc
@@ -113,7 +113,7 @@ int main(int argc,char **argv) {
   if(input.getColorTable()!=NULL)
     output.setColorTable(input.getColorTable());
 
-  Filter2d::Filter2d filter2d;
+  filter2d::Filter2d filter2d;
   if(verbose_opt[0])
     std::cout<< "class values: ";
   if(colorTable_opt[0]!="")
diff --git a/src/apps/pkfilter.cc b/src/apps/pkfilter.cc
index a229dc3..bb20580 100644
--- a/src/apps/pkfilter.cc
+++ b/src/apps/pkfilter.cc
@@ -49,6 +49,9 @@ int main(int argc,char **argv) {
   Optionpk<short> mask_opt("m", "mask", "mask value(s) ");
   Optionpk<std::string> tap_opt("tap", "tap", "text file containing taps used for spatial filtering (from ul to lr). Use dimX and dimY to specify tap dimensions in x and y. Leave empty for not using taps");
   Optionpk<double> tapz_opt("tapz", "tapz", "taps used for spectral filtering");
+  Optionpk<double> fwhm_opt("fwhm", "fwhm", "list of full width half to apply spectral filtering (-fwhm band1 -fwhm band2 ...)");
+  Optionpk<double> wavelengthIn_opt("win", "wavelengthIn", "list of wavelengths in input spectrum (-w band1 -w band2 ...)");
+  Optionpk<double> wavelengthOut_opt("wout", "wavelengthOut", "list of wavelengths in output spectrum (-w band1 -w band2 ...)");
   Optionpk<std::string>  otype_opt("ot", "otype", "Data type for output image ({Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}). Empty string: inherit type from input image","");
   Optionpk<string>  oformat_opt("of", "oformat", "Output image format (see also gdal_translate). Empty string: inherit from input image");
   Optionpk<string>  colorTable_opt("ct", "ct", "color table (file with 5 columns: id R G B ALFA (0: transparent, 255: solid)");
@@ -72,6 +75,9 @@ int main(int argc,char **argv) {
     mask_opt.retrieveOption(argc,argv);
     tap_opt.retrieveOption(argc,argv);
     tapz_opt.retrieveOption(argc,argv);
+    fwhm_opt.retrieveOption(argc,argv);
+    wavelengthIn_opt.retrieveOption(argc,argv);
+    wavelengthOut_opt.retrieveOption(argc,argv);
     down_opt.retrieveOption(argc,argv);
     otype_opt.retrieveOption(argc,argv);
     oformat_opt.retrieveOption(argc,argv);
@@ -146,8 +152,8 @@ int main(int argc,char **argv) {
   //   output.copyGeoTransform(input);
   // }
 
-  Filter2d::Filter2d filter2d;
-  Filter filter1d;
+  filter2d::Filter2d filter2d;
+  filter::Filter filter1d;
   if(class_opt.size()&&verbose_opt[0])
     std::cout<< "class values: ";
   for(int iclass=0;iclass<class_opt.size();++iclass){
@@ -196,91 +202,96 @@ int main(int argc,char **argv) {
     filter1d.setTaps(tapz_opt);    
     filter1d.doit(input,output,down_opt[0]);
   }
+  else if(wavelengthOut_opt.size()){
+    assert(wavelengthOut_opt.size()==fwhm_opt.size());
+    assert(wavelengthIn_opt.size());
+    filter1d.applyFwhm(input,output,wavelengthIn_opt,wavelengthOut_opt,fwhm_opt,verbose_opt[0]);    
+  }
   else{
     if(colorTable_opt.size())
       output.setColorTable(colorTable_opt[0]);
     switch(function_opt[0]){
-    case(Filter2d::MEDIAN):
-      filter2d.doit(input,output,Filter2d::MEDIAN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MEDIAN):
+      filter2d.doit(input,output,filter2d::MEDIAN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::VAR):
-      filter2d.doit(input,output,Filter2d::VAR,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::VAR):
+      filter2d.doit(input,output,filter2d::VAR,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::STDEV):
-      filter2d.doit(input,output,Filter2d::STDEV,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::STDEV):
+      filter2d.doit(input,output,filter2d::STDEV,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MIN):
-      filter2d.doit(input,output,Filter2d::MIN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MIN):
+      filter2d.doit(input,output,filter2d::MIN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::ISMIN):
-      filter2d.doit(input,output,Filter2d::ISMIN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::ISMIN):
+      filter2d.doit(input,output,filter2d::ISMIN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MAX):
-      filter2d.doit(input,output,Filter2d::MAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MAX):
+      filter2d.doit(input,output,filter2d::MAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::ISMAX):
-      filter2d.doit(input,output,Filter2d::ISMAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::ISMAX):
+      filter2d.doit(input,output,filter2d::ISMAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MINMAX):
-      filter2d.doit(input,output,Filter2d::MINMAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MINMAX):
+      filter2d.doit(input,output,filter2d::MINMAX,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::SUM):
-      filter2d.doit(input,output,Filter2d::SUM,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::SUM):
+      filter2d.doit(input,output,filter2d::SUM,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MEAN):
-      filter2d.doit(input,output,Filter2d::MEAN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MEAN):
+      filter2d.doit(input,output,filter2d::MEAN,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MAJORITY):
-      filter2d.doit(input,output,Filter2d::MAJORITY,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MAJORITY):
+      filter2d.doit(input,output,filter2d::MAJORITY,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::THRESHOLD):
+    case(filter2d::THRESHOLD):
       filter2d.setThresholds(threshold_opt);
       filter2d.setClasses(class_opt);
-      filter2d.doit(input,output,Filter2d::THRESHOLD,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+      filter2d.doit(input,output,filter2d::THRESHOLD,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::MIXED):
-      filter2d.doit(input,output,Filter2d::MIXED,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::MIXED):
+      filter2d.doit(input,output,filter2d::MIXED,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
-    case(Filter2d::DILATE):
+    case(filter2d::DILATE):
       if(dimZ_opt.size()){
         if(verbose_opt[0])
           std::cout<< "1-D filtering: dilate" << std::endl;
-        filter1d.morphology(input,output,Filter::DILATE,dimZ_opt[0]);
+        filter1d.morphology(input,output,filter::Filter::DILATE,dimZ_opt[0]);
       }
       else{
         if(angle_opt.size())
-          filter2d.morphology(input,output,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+          filter2d.morphology(input,output,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
         else
-          filter2d.morphology(input,output,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+          filter2d.morphology(input,output,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
       }
       break;
-    case(Filter2d::ERODE):
+    case(filter2d::ERODE):
       if(dimZ_opt[0]>0){
         if(verbose_opt[0])
           std::cout<< "1-D filtering: dilate" << std::endl;
-        filter1d.morphology(input,output,Filter::ERODE,dimZ_opt[0]);
+        filter1d.morphology(input,output,filter::Filter::ERODE,dimZ_opt[0]);
       }
       else{
         if(angle_opt.size())
-          filter2d.morphology(input,output,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+          filter2d.morphology(input,output,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
         else
-          filter2d.morphology(input,output,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+          filter2d.morphology(input,output,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
       }
       break;
-    case(Filter2d::CLOSE):{//closing
+    case(filter2d::CLOSE):{//closing
       ostringstream tmps;
       tmps << "/tmp/dilation_" << getpid() << ".tif";
       ImgWriterGdal tmpout;
       tmpout.open(tmps.str(),input);
       try{
         if(dimZ_opt.size()){
-          filter1d.morphology(input,tmpout,Filter::DILATE,dimZ_opt[0]);
+          filter1d.morphology(input,tmpout,filter::Filter::DILATE,dimZ_opt[0]);
         }
         else{
           if(angle_opt.size())
-            filter2d.morphology(input,tmpout,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+            filter2d.morphology(input,tmpout,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
           else
-            filter2d.morphology(input,tmpout,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+            filter2d.morphology(input,tmpout,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
         }
       }
       catch(std::string errorString){
@@ -291,13 +302,13 @@ int main(int argc,char **argv) {
       ImgReaderGdal tmpin;
       tmpin.open(tmps.str());
       if(dimZ_opt.size()){
-        filter1d.morphology(tmpin,output,Filter::ERODE,dimZ_opt[0]);
+        filter1d.morphology(tmpin,output,filter::Filter::ERODE,dimZ_opt[0]);
       }
       else{
         if(angle_opt.size())
-          filter2d.morphology(tmpin,output,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+          filter2d.morphology(tmpin,output,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
         else
-          filter2d.morphology(tmpin,output,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+          filter2d.morphology(tmpin,output,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
       }
       tmpin.close();
       if(remove(tmps.str().c_str( )) !=0){
@@ -305,31 +316,31 @@ int main(int argc,char **argv) {
       }
       break;
     }
-    case(Filter2d::OPEN):{//opening
+    case(filter2d::OPEN):{//opening
       ostringstream tmps;
       tmps << "/tmp/erosion_" << getpid() << ".tif";
       ImgWriterGdal tmpout;
       tmpout.open(tmps.str(),input);
       if(dimZ_opt.size()){
-        filter1d.morphology(input,tmpout,Filter::ERODE,dimZ_opt[0]);
+        filter1d.morphology(input,tmpout,filter::Filter::ERODE,dimZ_opt[0]);
       }
       else{
         if(angle_opt.size())
-          filter2d.morphology(input,tmpout,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+          filter2d.morphology(input,tmpout,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
         else
-          filter2d.morphology(input,tmpout,Filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+          filter2d.morphology(input,tmpout,filter2d::ERODE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
       }
       tmpout.close();
       ImgReaderGdal tmpin;
       tmpin.open(tmps.str());
       if(dimZ_opt.size()){
-        filter1d.morphology(tmpin,output,Filter::DILATE,dimZ_opt[0]);
+        filter1d.morphology(tmpin,output,filter::Filter::DILATE,dimZ_opt[0]);
       }
       else{
         if(angle_opt.size())
-          filter2d.morphology(tmpin,output,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
+          filter2d.morphology(tmpin,output,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0],angle_opt[0]);
         else
-          filter2d.morphology(tmpin,output,Filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
+          filter2d.morphology(tmpin,output,filter2d::DILATE,dimX_opt[0],dimY_opt[0],disc_opt[0]);
       }
       tmpin.close();
       if(remove(tmps.str().c_str( )) !=0){
@@ -337,16 +348,16 @@ int main(int argc,char **argv) {
       }
       break;
     }
-    case(Filter2d::HOMOG):{//spatially homogeneous
-      filter2d.doit(input,output,Filter2d::HOMOG,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::HOMOG):{//spatially homogeneous
+      filter2d.doit(input,output,filter2d::HOMOG,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       // filter2d.homogeneousSpatial(input,output,dimX_opt[0],disc_opt[0]);
       break;
     }
-    case(Filter2d::HETEROG):{//spatially heterogeneous
-      filter2d.doit(input,output,Filter2d::HETEROG,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::HETEROG):{//spatially heterogeneous
+      filter2d.doit(input,output,filter2d::HETEROG,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
     }
-    case(Filter2d::SOBELX):{//Sobel edge detection in X
+    case(filter2d::SOBELX):{//Sobel edge detection in X
       Vector2d<double> theTaps(3,3);
       theTaps[0][0]=-1.0;
       theTaps[0][1]=0.0;
@@ -361,7 +372,7 @@ int main(int argc,char **argv) {
       filter2d.filter(input,output,true);
       break;
     }
-    case(Filter2d::SOBELY):{//Sobel edge detection in Y
+    case(filter2d::SOBELY):{//Sobel edge detection in Y
       Vector2d<double> theTaps(3,3);
       theTaps[0][0]=1.0;
       theTaps[0][1]=2.0;
@@ -376,7 +387,7 @@ int main(int argc,char **argv) {
       filter2d.filter(input,output,true);
       break;
     }
-    case(Filter2d::SOBELXY):{//Sobel edge detection in XY
+    case(filter2d::SOBELXY):{//Sobel edge detection in XY
       Vector2d<double> theTaps(3,3);
       theTaps[0][0]=0.0;
       theTaps[0][1]=1.0;
@@ -391,7 +402,7 @@ int main(int argc,char **argv) {
       filter2d.filter(input,output,true);
       break;
     }
-    case(Filter2d::SOBELYX):{//Sobel edge detection in XY
+    case(filter2d::SOBELYX):{//Sobel edge detection in XY
       Vector2d<double> theTaps(3,3);
       theTaps[0][0]=2.0;
       theTaps[0][1]=1.0;
@@ -406,21 +417,21 @@ int main(int argc,char **argv) {
       filter2d.filter(input,output,true);
       break;
     }
-    case(Filter2d::SMOOTH):{//Smoothing filter
+    case(filter2d::SMOOTH):{//Smoothing filter
       filter2d.smooth(input,output,dimX_opt[0],dimY_opt[0]);
       break;
     }
-    case(Filter2d::SMOOTHNODATA):{//Smoothing filter
+    case(filter2d::SMOOTHNODATA):{//Smoothing filter
       filter2d.smoothNoData(input,output,dimX_opt[0],dimY_opt[0]);
       break;
     }
-    case(Filter2d::DENSITY):{//estimation of forest density
-      filter2d.doit(input,output,Filter2d::DENSITY,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+    case(filter2d::DENSITY):{//estimation of forest density
+      filter2d.doit(input,output,filter2d::DENSITY,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
     }
-    case(Filter2d::ORDER):{//order centre pixel with respect to values in window
+    case(filter2d::ORDER):{//order centre pixel with respect to values in window
       assert(dimX_opt[0]);
-      filter2d.doit(input,output,Filter2d::ORDER,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
+      filter2d.doit(input,output,filter2d::ORDER,dimX_opt[0],dimY_opt[0],down_opt[0],disc_opt[0]);
       break;
     }
     default:
diff --git a/src/apps/pkfs_svm.cc b/src/apps/pkfs_svm.cc
index a393062..9e502ec 100644
--- a/src/apps/pkfs_svm.cc
+++ b/src/apps/pkfs_svm.cc
@@ -335,7 +335,6 @@ int main(int argc, char *argv[])
     assert(offset_opt.size()==nband);
   if(scale_opt.size()>1)
     assert(scale_opt.size()==nband);
-  Histogram hist;
   for(int iband=0;iband<nband;++iband){
     if(verbose_opt[0]>1)
       std::cout << "scaling for band" << iband << std::endl;
diff --git a/src/apps/pklas2img.cc b/src/apps/pklas2img.cc
index 8496c8a..a19cd97 100644
--- a/src/apps/pklas2img.cc
+++ b/src/apps/pklas2img.cc
@@ -405,14 +405,14 @@ int main(int argc,char **argv) {
     //increase cells and thresholds until no points from the previous iteration are discarded.
     int dimx=dimx_opt[0];
     int dimy=dimy_opt[0];
-    Filter2d::Filter2d morphFilter;
+    filter2d::Filter2d morphFilter;
     morphFilter.setNoValue(0);
     Vector2d<float> currentOutput=outputData;
     int iteration=1;
     while(nchange&&iteration<maxIter_opt[0]){
       double hThreshold=maxSlope_opt[0]*dimx;
       Vector2d<float> newOutput;
-      nchange=morphFilter.morphology(currentOutput,newOutput,Filter2d::ERODE,dimx,dimy,disc_opt[0],hThreshold);
+      nchange=morphFilter.morphology(currentOutput,newOutput,filter2d::ERODE,dimx,dimy,disc_opt[0],hThreshold);
       currentOutput=newOutput;
       dimx+=2;//change from theory: originally double cellCize
       dimy+=2;//change from theory: originally double cellCize
@@ -430,7 +430,7 @@ int main(int argc,char **argv) {
     //increase cells and thresholds until no points from the previous iteration are discarded.
     int dimx=dimx_opt[0];
     int dimy=dimy_opt[0];
-    Filter2d::Filter2d theFilter;
+    filter2d::Filter2d theFilter;
     theFilter.setNoValue(0);
     Vector2d<float> currentOutput=outputData;
     double hThreshold=hThreshold_opt[0];
@@ -439,10 +439,10 @@ int main(int argc,char **argv) {
       std::cout << "iteration " << iteration << " with window size " << dimx << " and dh_max: " << hThreshold << std::endl;
       Vector2d<float> newOutput;
       try{
-        theFilter.morphology(outputData,currentOutput,Filter2d::ERODE,dimx,dimy,disc_opt[0],maxSlope_opt[0]);
-        theFilter.morphology(currentOutput,outputData,Filter2d::DILATE,dimx,dimy,disc_opt[0],maxSlope_opt[0]);
+        theFilter.morphology(outputData,currentOutput,filter2d::ERODE,dimx,dimy,disc_opt[0],maxSlope_opt[0]);
+        theFilter.morphology(currentOutput,outputData,filter2d::DILATE,dimx,dimy,disc_opt[0],maxSlope_opt[0]);
         if(postFilter_opt[0]=="bunting"){//todo: implement doit in Filter2d on Vector2d
-          theFilter.doit(outputData,currentOutput,Filter2d::MEDIAN,dimx,dimy,1,disc_opt[0]);
+          theFilter.doit(outputData,currentOutput,filter2d::MEDIAN,dimx,dimy,1,disc_opt[0]);
           outputData=currentOutput;
         }
       }
@@ -464,12 +464,12 @@ int main(int argc,char **argv) {
   else if(postFilter_opt[0]=="open"){
     if(composite_opt[0]!="min")
       std::cout << "Warning: composite option is not set to min!" << std::endl;
-    Filter2d::Filter2d morphFilter;
+    filter2d::Filter2d morphFilter;
     morphFilter.setNoValue(0);
     Vector2d<float> filterInput=outputData;
     try{
-      morphFilter.morphology(outputData,filterInput,Filter2d::ERODE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
-      morphFilter.morphology(filterInput,outputData,Filter2d::DILATE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
+      morphFilter.morphology(outputData,filterInput,filter2d::ERODE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
+      morphFilter.morphology(filterInput,outputData,filter2d::DILATE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
     }
     catch(std::string errorString){
       cout << errorString << endl;
@@ -479,12 +479,12 @@ int main(int argc,char **argv) {
   else if(postFilter_opt[0]=="close"){
     if(composite_opt[0]!="max")
       std::cout << "Warning: composite option is not set to max!" << std::endl;
-    Filter2d::Filter2d morphFilter;
+    filter2d::Filter2d morphFilter;
     morphFilter.setNoValue(0);
     Vector2d<float> filterInput=outputData;
     try{
-      morphFilter.morphology(outputData,filterInput,Filter2d::DILATE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
-      morphFilter.morphology(filterInput,outputData,Filter2d::ERODE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
+      morphFilter.morphology(outputData,filterInput,filter2d::DILATE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
+      morphFilter.morphology(filterInput,outputData,filter2d::ERODE,dimx_opt[0],dimy_opt[0],disc_opt[0],maxSlope_opt[0]);
     }
     catch(std::string errorString){
       cout << errorString << endl;
diff --git a/src/base/Makefile.in b/src/base/Makefile.in
index 11bb775..a0ddf10 100644
--- a/src/base/Makefile.in
+++ b/src/base/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -99,12 +99,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(libbase_adir)"
 HEADERS = $(libbase_a_HEADERS) $(noinst_HEADERS)
 ETAGS = etags
@@ -284,14 +278,14 @@ $(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libbase.a: $(libbase_a_OBJECTS) $(libbase_a_DEPENDENCIES) $(EXTRA_libbase_a_DEPENDENCIES) 
+libbase.a: $(libbase_a_OBJECTS) $(libbase_a_DEPENDENCIES) 
 	-rm -f libbase.a
 	$(libbase_a_AR) libbase.a $(libbase_a_OBJECTS) $(libbase_a_LIBADD)
 	$(RANLIB) libbase.a
 
 clean-noinstPROGRAMS:
 	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-pktestOption$(EXEEXT): $(pktestOption_OBJECTS) $(pktestOption_DEPENDENCIES) $(EXTRA_pktestOption_DEPENDENCIES) 
+pktestOption$(EXEEXT): $(pktestOption_OBJECTS) $(pktestOption_DEPENDENCIES) 
 	@rm -f pktestOption$(EXEEXT)
 	$(CXXLINK) $(pktestOption_OBJECTS) $(pktestOption_LDADD) $(LIBS)
 
@@ -334,7 +328,9 @@ uninstall-libbase_aHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(libbase_a_HEADERS)'; test -n "$(libbase_adir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(libbase_adir)'; $(am__uninstall_files_from_dir)
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libbase_adir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libbase_adir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -435,15 +431,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/base/Vector2d.h b/src/base/Vector2d.h
index 4b18e71..81d5909 100644
--- a/src/base/Vector2d.h
+++ b/src/base/Vector2d.h
@@ -26,7 +26,7 @@ along with pktools.  If not, see <http://www.gnu.org/licenses/>.
 #include <numeric>
 #include <gsl/gsl_matrix.h>
 #include "IndexValue.h"
-#include "algorithms/Histogram.h"
+#include "algorithms/StatFactory.h"
 
 using namespace std;
 template<class T> class Vector2d: public vector<vector <T> >
@@ -57,6 +57,7 @@ public:
   Vector2d<T> operator=(const Vector2d<T>& v1);
 //   ostream& operator<<(ostream& os, const Vector2d<T>& v);
 //   template<class T> ostream& operator<<(ostream& os, const Vector2d<T>& v);
+  template<class T1> friend ostream& operator<<(ostream & os, const Vector2d<T1>& v);
   Vector2d<T> sum(const Vector2d<T>& v1, const Vector2d<T>& v2) const;
   T max(int& x, int& y, double maxValue) const;
 
@@ -184,16 +185,21 @@ template<class T> void Vector2d<T>::selectCols(const list<int> &cols)
 	(*this)[irow].erase(((*this)[irow]).begin()+icol);
 }
 
-// template<class T> ostream& operator<<(ostream& os, const Vector2d<T>& v)
-// {
-//   for(int irow=0;irow<v.size();++irow){
-//     for(int icol=0;icol<v[irow].size();++icol){
-//       os << v[irow][icol] << "\t";
-//     }
-//     os << endl;
-//   }
-//   return os;
-// }
+template<class T1> ostream& operator<<(ostream& os, const Vector2d<T1>& v)
+{
+  for(int irow=0;irow<v.size();++irow){
+    for(int icol=0;icol<v[irow].size();++icol){
+      os << v[irow][icol] << "\t";
+    }
+    os << endl;
+  }
+  return os;
+  // os << theOption.getLongName() << ": ";
+  // for(int index=0;index<theOption.size();++index)
+  //   os << type2string<T>(theOption[index]) << " ";
+  // os << std::endl;
+  // return os;
+}
 
 template<class T> void Vector2d<T>::sort(Vector2d<T>& output)
 {
@@ -239,11 +245,11 @@ template<class T> void Vector2d<T>::scale(const T lbound, const T ubound, vector
   vector<T> pixel(nsample);
   T theMin;
   T theMax;
-  Histogram hist;
+  statfactory::StatFactory stat;
   scaledOutput.resize(nsample,nband);
   for(int iband=0;iband<nband;++iband){
     pixel=selectCol(iband);
-    hist.minmax(pixel, pixel.begin(), pixel.end(), theMin, theMax);
+    stat.minmax(pixel, pixel.begin(), pixel.end(), theMin, theMax);
     scaleVector[iband]=static_cast<double>(ubound-lbound)/(theMax-theMin);
     offsetVector[iband]=static_cast<double>(-theMin*scaleVector[iband])-lbound;
     for(int isample=0;isample<pixel.size();++isample)
diff --git a/src/fileclasses/Makefile.in b/src/fileclasses/Makefile.in
index 08d2a08..5144752 100644
--- a/src/fileclasses/Makefile.in
+++ b/src/fileclasses/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -50,7 +50,8 @@ AR = ar
 ARFLAGS = cru
 libfileClasses_a_AR = $(AR) $(ARFLAGS)
 libfileClasses_a_LIBADD =
-am__libfileClasses_a_SOURCES_DIST = FileReaderLas.h FileReaderLas.cc
+am__libfileClasses_a_SOURCES_DIST = FileReaderLas.h FileReaderAscii.h \
+	FileReaderLas.cc
 am__objects_1 =
 @USE_LAS_TRUE at am_libfileClasses_a_OBJECTS = $(am__objects_1) \
 @USE_LAS_TRUE@	FileReaderLas.$(OBJEXT)
@@ -70,7 +71,7 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libfileClasses_a_SOURCES)
 DIST_SOURCES = $(am__libfileClasses_a_SOURCES_DIST)
-am__libfileClasses_a_HEADERS_DIST = FileReaderLas.h
+am__libfileClasses_a_HEADERS_DIST = FileReaderLas.h FileReaderAscii.h
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -92,12 +93,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(libfileClasses_adir)"
 HEADERS = $(libfileClasses_a_HEADERS)
 ETAGS = etags
@@ -223,7 +218,7 @@ top_srcdir = @top_srcdir@
 # where to install the headers on the system
 @USE_LAS_TRUE at libfileClasses_adir = $(includedir)/fileclasses
 # the list of header files that belong to the library (to be installed later)
- at USE_LAS_TRUE@libfileClasses_a_HEADERS = FileReaderLas.h
+ at USE_LAS_TRUE@libfileClasses_a_HEADERS = FileReaderLas.h FileReaderAscii.h
 # the sources to add to the library and to add to the source distribution
 @USE_LAS_TRUE at libfileClasses_a_SOURCES = $(libfileClasses_a_HEADERS) FileReaderLas.cc
 all: all-am
@@ -263,7 +258,7 @@ $(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libfileClasses.a: $(libfileClasses_a_OBJECTS) $(libfileClasses_a_DEPENDENCIES) $(EXTRA_libfileClasses_a_DEPENDENCIES) 
+libfileClasses.a: $(libfileClasses_a_OBJECTS) $(libfileClasses_a_DEPENDENCIES) 
 	-rm -f libfileClasses.a
 	$(libfileClasses_a_AR) libfileClasses.a $(libfileClasses_a_OBJECTS) $(libfileClasses_a_LIBADD)
 	$(RANLIB) libfileClasses.a
@@ -306,7 +301,9 @@ uninstall-libfileClasses_aHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(libfileClasses_a_HEADERS)'; test -n "$(libfileClasses_adir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(libfileClasses_adir)'; $(am__uninstall_files_from_dir)
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libfileClasses_adir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libfileClasses_adir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -407,15 +404,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:
diff --git a/src/imageclasses/Makefile.in b/src/imageclasses/Makefile.in
index 2f7593a..89169bc 100644
--- a/src/imageclasses/Makefile.in
+++ b/src/imageclasses/Makefile.in
@@ -1,9 +1,9 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -91,12 +91,6 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z "$$files" \
-    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
-    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
-         $(am__cd) "$$dir" && rm -f $$files; }; \
-  }
 am__installdirs = "$(DESTDIR)$(libimageClasses_adir)"
 HEADERS = $(libimageClasses_a_HEADERS)
 ETAGS = etags
@@ -265,7 +259,7 @@ $(am__aclocal_m4_deps):
 
 clean-noinstLIBRARIES:
 	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-libimageClasses.a: $(libimageClasses_a_OBJECTS) $(libimageClasses_a_DEPENDENCIES) $(EXTRA_libimageClasses_a_DEPENDENCIES) 
+libimageClasses.a: $(libimageClasses_a_OBJECTS) $(libimageClasses_a_DEPENDENCIES) 
 	-rm -f libimageClasses.a
 	$(libimageClasses_a_AR) libimageClasses.a $(libimageClasses_a_OBJECTS) $(libimageClasses_a_LIBADD)
 	$(RANLIB) libimageClasses.a
@@ -311,7 +305,9 @@ uninstall-libimageClasses_aHEADERS:
 	@$(NORMAL_UNINSTALL)
 	@list='$(libimageClasses_a_HEADERS)'; test -n "$(libimageClasses_adir)" || list=; \
 	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
-	dir='$(DESTDIR)$(libimageClasses_adir)'; $(am__uninstall_files_from_dir)
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libimageClasses_adir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libimageClasses_adir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -412,15 +408,10 @@ install-am: all-am
 
 installcheck: installcheck-am
 install-strip:
-	if test -z '$(STRIP)'; then \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	      install; \
-	else \
-	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
-	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-	fi
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
 mostlyclean-generic:
 
 clean-generic:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list