ENH: Add versorTransformOptimizerv4 class to ITKv4

ITKv3 has specific optimizer classes for optimization of the versor
transforms.

itkVersorRigid3DTransformOptimizer --> for optimization of versorRigid
transform.

itkVersorTransformOptimizer --> for optimization of scaleVersor and
                                    scaleSkewVersor transforms.
The above optimizers are variants of the gradient descent optimizer
implmented in RegularStepGradientDescentOptimizer.

This patch adds the versor optimization capability to ITKv4.

The "AdvancedOneStep" function in gradientDescentOptimizerv4 class
is implemented differently than the ITKv3. Now, in ITKv4, the transform
update process is delegated to the metric at each iteration.

The metric, also, makes the moving transform update its parameters via
"UpdateTransformParameters" function that is a virtual function defined
in the "itk::Transform" class. Derived classes can override this
function
if needed, as it is done here by the itkVersorRigid3DTransform.

The "UpdateTransformParameters" function gets two parameters, the
gradient and a multiplication factor that is set to 1 as default.

In ITKv4 implementation, the gradient variable is modified by scales and
learning rate in a multi threaded procedure before it is passed to the
"UpdateTransformParameters" function.

However, in versor optimization, the learning rate should be used in
computations after the gradient is normalized.

Since the modification by learning rate is a multi threaded processing,
I preferred to keep the gradientDescentOptimizerv4 class unchanged, and
define a new derived optimizer class for the versor transforms optimization
that overrides the "AdvancedOneStep" function. In the overridden
implementation, the learning rate is passed to the "UpdateTransformParameters"
function as a factor, and the versor transform will apply the learning rate
to the normalized gradient.

Since the "itkScaleVersor3DTransform" and "itkScaleSkewVersor3DTransform"
classes are derived from the "VersorRigid3DTransform", the above
implementation works for them as well.

To test the new changes, the ImageRegistration8Test is converted to
ITKv4 framework. This test generates acceptable results compared to its
v3 version.

Change-Id: I37e6f43f1967b917fcb2139c5505daf65b7fb28d
COMP: Remove add_custom_command(SOURCE...

These are deprecated in future versions of CMake.

Co-authored by: Brad King <brad.king@kitware.com>

Change-Id: I49f3f3e7e1e884e86772c69bcb166dae29c53f8e
COMP: Wrap OptimizerParameterScalesEstimatorTemplate.

The class name changed and it became templated.  Fixes:

  /playpen/blowekamp/MacOSX-WrapITK/ITK-build/Wrapping/Modules/ITKOptimizersv4/itkOptimizerParameterScalesEstimator.xml:
  warning(5): Unknown type type: itk::OptimizerParameterScalesEstimator
  [typedef]
  /playpen/blowekamp/MacOSX-WrapITK/ITK-build/Wrapping/Modules/ITKOptimizersv4/itkOptimizerParameterScalesEstimator.xml:
  warning(4): ITK type not wrapped, or currently not known:
  itk::OptimizerParameterScalesEstimatorTemplate< double >

Change-Id: Ic6b4d6fba10d5d6c7b58de8d842bad6511e1ae7b
BUG: Wrap TransformFileReader, TransformFileWriter.

Missing CMakeLists.txt in the wrapping directory.  Need to explicitly include
the headers after "Template" was appended to the class name.

Suggested-by: Sami Koho <sami.koho@gmail.com>

Change-Id: I6f994bb18f37d5adf1d0f0311fa73506c41239a7
COMP: Fixed itkQuasiNewtonOptimizerv4 wrapping warnings

The warning :
/scratch/dashboards/Linux-x86_64-gcc4.4-WrapITK/ITK-build/Wrapping/Modules/ITKOptimizersv4/itkQuasiNewtonOptimizerv4.xml: warning(5): Unknown type type: itk::QuasiNewtonOptimizerv4 [typedef]
/scratch/dashboards/Linux-x86_64-gcc4.4-WrapITK/ITK-build/Wrapping/Modules/ITKOptimizersv4/itkQuasiNewtonOptimizerv4.xml: warning(4): ITK type not wrapped, or currently not known: itk::QuasiNewtonOptimizerv4Template< double >
COMP: Fixed itkGradientDescentOptimizerv4 wrapping warnings

I splitted the 3 wrapping calls in 3 separate files and fixed the wrapping.

The warnings :
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(5): Unknown type type: itk::GradientDescentOptimizerBasev4 [typedef]
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(5): Unknown type type: itk::GradientDescentOptimizerv4 [typedef]
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(5): Unknown type type: itk::ObjectToObjectOptimizerBase [typedef]
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(4): ITK type not wrapped, or currently not known: itk::GradientDescentOptimizerBasev4Template< double >
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(4): ITK type not wrapped, or currently not known: itk::GradientDescentOptimizerv4Template< double >
/home/kevin/kitware/ITK_Build/Wrapping/Modules/ITKOptimizersv4/itkGradientDescentOptimizerv4.xml: warning(4): ITK type not wrapped, or currently not known: itk::ObjectToObjectOptimizerBaseTemplate< double >

Should also hopefully fix the new error on the dashboard I introduced by fixing the itkQuasiNewtonOptimizerv4 warnings (http://review.source.kitware.com/#/c/14317/)
/home/kevin/kitware/ITK_Build/Wrapping/Typedefs/itkQuasiNewtonOptimizerv4.i:87: Warning 401: Nothing known about base class 'itk::GradientDescentOptimizerv4Template< float >'. Ignored.
/home/kevin/kitware/ITK_Build/Wrapping/Typedefs/itkQuasiNewtonOptimizerv4.i:87: Warning 401: Maybe you forgot to instantiate 'itk::GradientDescentOptimizerv4Template< float >' using %template.

Change-Id: I15b6af11690ed6efeaced68f73af5212ab5dc364
Merge branch 'release'

Change-Id: I370a45349d0bf37e80cba7696a0306782aaf3e95
Merge topic 'AddVersorOptimizerv4_v5'

80857f9c ENH: Add versorTransformOptimizerv4 class to ITKv4
Merge topic 'custom_command-source2'

0ad45762 COMP: Remove add_custom_command(SOURCE...