BUG: SignedMaurerDistanceMap in 4D

This patch fixes a bug in itkSignedMaurerDistanceMapImageFilter.hxx
that resulted in a seg fault when running the algorithm in
multi-threaded mode for any dimension greater than 3D.  The bug was
the result of incorrect construction of the vector "k", which resulted
in pixel accesses outside of the image.  This bug was not seen for
images of size 3D and below because the construction of the "k" vector
was only computed for one value or less.  But for any dimension 4D and
above, the computation was done in the wrong order leading to errors
that have now been corrected.

This patch also adds 3D and 4D test volumes for the Maurer algorithm
as well as code to test these volumes.  Previously, the algorithm was
only tested for 2D (degenerate 3D volumes with only one slice).  The
new test volumes embed a 3D (4D) binary cube in a 3D (4D) volume,
which enables easy visual validation of the correctness of the
distance map algorithm.  In these tests, the center 3D volume of the
4D distance map should be the same as the distance map of the 3D
volume.

itkSignedDanielssonDistanceMapImageFilterTest1.cxx and
itkSignedMaurerDistanceMapImageFilterTest.cxx were generalized to
operate on either 2D, 3D, or 4D images by templating over image
dimension.  This avoids code duplication in the tests.  The parameters
used in the itkSignedMaurerDistanceMapImageFilterTest.cxx test were
changed to match those in
itkSignedDanielssonDistanceMapImageFilterTest1.cxx to enable direct
comparison of the outputs of the two algorithms, and the comparisons
in the CMakeLists.txt compare the output volumes of the two algorithms
to ensure that they are the same.  As a result, the Maurer test images
have been replaced although it has been verified that the difference
between the old and new images was just a sign flip because of turning
the SetInsideIsPositive off (now consistent between Danielsson and
Maurer tests).

This fix addresses JIRA ticket
https://itk.icts.uiowa.edu/jira/browse/ITK-2907

Change-Id: Ifd3411db60d100efdd72d6c06593b88fdc6d0ac3
COMP: Make GPUFunctorBase destructor virtual

The patch addresses the following warning:

ITK/Modules/Core/GPUCommon/include/itkGPUFunctorBase.h:43:3: warning:
'itk::Functor::GPUFunctorBase' has virtual functions but non-virtual
destructor [-Wnon-virtual-dtor]
  ~GPUFunctorBase() {

Change-Id: I55a2f002c036553f47bb8c468238f88e44e54147
BUG: Scanline iterator in STAPLE filter not advanced to next line

An assert failed on debug build causing test failures. This detected
incorrect usage of the iterator where is was not being advanced to the
"NextLine" after each scanline.

Change-Id: I8e49ca9a37101f752fa68e05a1c865caf1ba6bd6
Merge topic 'FixWaringNonvirtualDestructor'

36c9d33 COMP: Make GPUFunctorBase destructor virtual
PERF: Use ImageScanlineIterator in ImageAlgorithm::Copy

Change-Id: I0c7ea3634916373072c16563ddfd7a4d29e13393
Merge topic 'SignedMaurer4D'

354f4fd BUG: SignedMaurerDistanceMap in 4D
Merge topic 'ImageScanlineIteartorForImageCopy'

96e6e2e PERF: Use ImageScanlineIterator in ImageAlgorithm::Copy
Merge topic 'FixSTAPLEIteratorNextLine'

c71df8b BUG: Scanline iterator in STAPLE filter not advanced to next line
COMP: Make the test stable by removing random source

Using a random source for an image regression test is poor
practice. Here we use a standard image as input.

Change-Id: I7193725f217b911ba00e8a001646802563977a15
Merge topic 'QuickViewTestRandomness'

b26ffe8 COMP: Make the test stable by removing random source