BUG: itkPolyLineParametricPath infinite loop for degenerate paths

itkPolyLineParametricPath inherits EvalateDerivative and IncrementInput from its
superclass: itkParametricPath. IncrementInput uses a default
timestep and a derivative estimated from that default timestep to implement a
tooBig/tooSmall search strategy to find the next pixel along the path.

This strategy will result in oscillation between tooBig and tooSmall for
degenerate itkPolyLineParametricPath paths, such as those with a lot of
verticies at the beginning less than one image index away from each other
followed by a single vertex at the end that is multiple image indices away.

This patch overrides the inherited IncrementInputs and EvaluateDerivative
function and takes advantage of the fact that it is possible to calculate an
instantaneous derivative which allows to calculate the exact timestep to effect
a change in one pixel.

A test is also added for one of the degenerate paths mentioned in paragraph 2.

The ExtractOrthogonalSwatch2DImageFilterTest baseline image was updated due to
the old tooSmall/tooLarge search strategy not always honoring the 8-connected
neighborhood.

Change-Id: Ibe2d5b8fb913e6311ee0f3b977fdadf1321f0653
ENH: ExternalData: Partly generalize hash algo/ext handling

Use private global variables _ExternalData_REGEX_(ALGO|EXT) to match the
possible hash algorithm names and extensions in regular expressions.
Note that we cannot yet use "file(<algo>)" instead of "cmake -E md5sum"
to compute hashes because it requires CMake >= 2.8.7.  Therefore we also
cannot yet allow other hash algorithms.  Leave a TODO comment.

Change-Id: I9e569432833fa9b754ba62b192179c783d4a6ebf
ENH: ExternalData: Attach download rules to content links in IDEs

Each data file to be created in the build tree corresponds one-to-one with
a raw file or content link in the source tree.  Use the MAIN_DEPENDENCY of
add_custom_command to attach the build rule to the source tree file.  This
looks much nicer in the IDE project file browser and avoids ".rule" files.

Change-Id: Id8c5043be9baad39701522a074b24bc6a48ce233
ENH: ExternalData: Preserve escaped semicolons during argument expansion

The CMake language implicitly flattens lists so a ";" in a list element
must be escaped with a backslash.  List expansion removes backslashes
escaping semicolons to leave raw semicolons in the values.  Teach
ExternalData_Add_Test and ExternalData_Expand_Arguments to re-escape
semicolons found in list elements so the resulting argument lists work
as if constructed directly by the set() command.

For example:

  ExternalData_Add_Test(Data NAME test1 COMMAND ... "a\\;b")
  ExternalData_Expand_Arguments(Data args2 "c\\;d")
  add_test(NAME test2 COMMAND ... ${args2})

should be equivalent to

  set(args1 "a\\;b")
  add_test(NAME test1 COMMAND ... ${args1})
  set(args2 "c\\;d")
  add_test(NAME test2 COMMAND ... ${args2})

which is equivalent to

  add_test(NAME test1 COMMAND ... "a;b")
  add_test(NAME test2 COMMAND ... "c;d")

Note that it is not possible to make ExternalData_Add_Test act exactly
like add_test when quoted arguments contain semicolons because the CMake
language flattens lists when constructing function ARGN values.  This
re-escape approach at least allows test arguments to have semicolons.

While at it, teach ExternalData APIs to not transform "DATA{...;...}"
arguments because the contained semicolons are non-sensical.

Change-Id: I6ebd1e6a21a6621491343b0e85bf1502a3ae19f6
Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Merge topic 'ExternalData-updates'

5a11039 ENH: ExternalData: Preserve escaped semicolons during argument expansion
d42c3ab ENH: ExternalData: Attach download rules to content links in IDEs
48b7906 ENH: ExternalData: Partly generalize hash algo/ext handling
COMP: Fix all valid cppcheck warnings in "ITK/Module" directory

Previously four patches are sent about fixing cppcheck warnings in four
sub-directories as:
Module/Core
Module/Registration
Module/Segmentation
Module/Filtering

Now in this final patch all the valid remained cppcheck warnings of
Module directory are fixed.

Some of the cppcheck warnings are related to the functions that are not
used, but they may be used later by users. Such a warning is an example
of an invalid warning.

Some warnings are related to the intentionally created issues that are
provided in the test files. Such warnings are another example of what I
call invalid warnings.

The titles of major fixed issues are listed below:
- if possible, variables are passed by reference.
- prefix ++/-- operators are preferred for non-primitive types.
- initialization to assignment is preferred.
- if possible, the scope of variables are reduced.
- Throwing a copy of the caught exception instead of rethrowing the
original exception.

All the ITK tests are passed after the above changes.

Change-Id: Ia4a5fe36ae5de520aaeecb7e47f13371e5309704
STYLE: Improve SoftwareGuide documentation

There were errors in the processing of the ITKSoftwareGuide
example generation.

Only provide base image name for LaTeX
By only providing the base image name for LaTeX includegraphics,
then pdflatex or other tools can choose an image that is
most appropriate for that document building style.
For example pdflatex prefers .png images, adn latex prefers
.eps files.

Remove unused SoftwareGuide key word.
The NORMALIZE_EPS_OUTPUT_OF key word was not being processed
by the SoftwareGuide parsing.

The software guide formatting and reference code
for more consistent coding standards.

Change-Id: I09b64f43aad28ed309ea0c695ee5ebf08adfbc4b
Merge topic 'ITKSoftwareGuideUpdates_combined'

e3aff16 STYLE: Improve SoftwareGuide documentation
Merge topic 'moduleDir_cppcheck'

9c530ae COMP: Fix all valid cppcheck warnings in "ITK/Module" directory
Merge topic 'itkParametricPathOscillation'

706a6bf BUG: itkPolyLineParametricPath infinite loop for degenerate paths