PERF: Remove IncreaseFrequencyOfMeasurement from inner loops

The Histogram::IncreaseFrequencyOfMeasurement uses a local
IncreaseFrequencyOfMeasurement::IndexType for the index. This is a
dynamically allocated array. When used in per-pixel loops most of the
time is spent in memory allocation. Move the index outside the loop to
remove the dynamic memory allocation in the inner-loop.

This results in an over 2X speed up for all automatic histogram
thresholding filters such as OtsuThresholdImageFilter.

After this observation, other uses of IncreaseFrequencyOfMeasurement
where replace with the extracted Index allocation. Speed up is
expected in numerous filters.

Change-Id: I7a862cc368cd935f4e05a71974c398317bb82dc5
KWSys 2014-03-12 (dd873734)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ dd873734 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' b3db597b..dd873734
Adrien Destugues (1):
      b1916e0a SystemInformation: Update CPU count code for Haiku

Brad King (2):
      9c653603 Process: Suppress IBM XL warning about infinite loop in test
      88c5a768 Set policy CMP0025 to NEW within KWSys

Clinton Stimpson (1):
      b3b20cc0 FStream: Add ability to detect BOM.

Jiri Malak (1):
      e66d99b8 SystemTools: Fix compilation with Open Watcom

Stephen Kelly (1):
      dd873734 SystemTools: Remove some unnecessary c_str() calls

Change-Id: Iaab29a7235b3f2620ebd811d2b992a7df955e50d
Merge branch 'upstream-kwsys' into update-kwsys

Change-Id: Ie364b6f35ebd83ab0098b07612183fa5239b7aeb
Merge topic 'update-kwsys'

65771a6e Merge branch 'upstream-kwsys' into update-kwsys
7a2efc3b KWSys 2014-03-12 (dd873734)
ENH: add reset function to resource probe

Change-Id: Ife65fdcdcce6b097cc6b0064e41e7c3792c10eaa
Merge branch 'FixLabelStatisticsRequiresSameInputRegions' into release

Change-Id: I5db199446741a5943eb87df798fd376fce76ff40
Merge branch 'release'

Change-Id: Icd39912812c605eb680ac1de67130eec567d8f3d
Merge topic 'VectorContainer-wrapping-release'

ab0f1e44 COMP: Duplicated VectorContainer wrapping for real types.
COMP: Duplicated VectorContainer wrapping for real types.

Change-Id: Ie69ba1aa527e0ef6738383a9cf4d87be55c2bd08
Merge topic 'RemoveHistogramIndexAllocation'

9baf9fba PERF: Remove IncreaseFrequencyOfMeasurement from inner loops
COMP: Remove extra calls to cmake_minimum_required

Drop calls to this command in subdirectories.  They are never used as
the top-level source directory.

Change-Id: I36d9447c424ca8a8d0daa6ae028ca1cb66eb68c2
COMP: Fix cmake_minimum_required call order

Call the command first in any given CMakeLists.txt file.  While at it,
update some calls to match ITK's current minimum of CMake 2.8.6 and drop
old policy settings accordingly.

Change-Id: Ice9bcab71494659b0e4840ce70b2500ccc929acd
COMP: Set CMake Policies CMP0025 and CMP0042 as necessary

CMake 3.0 introduces these policies to improve default behavior on OS X.
Set them explicitly in ITK to avoid policy warnings.  ITK already works
with the NEW behavior.

Policy CMP0042 affects shared libraries on OS X, enabling MACOSX_RPATH
by default.  Set it in directories where we create libraries.  Also tell
KWSys to enable MACOSX_RPATH explicitly instead of setting the policy.

Change-Id: I3411ede1ee88c62c8d10bec101740f5e5e23e55d
STYLE: Save deference iterator mapped type to variable

Saving results of require computation is good practice.

Change-Id: I31c3083c8d4e362f2be8faff54ad817687557fa6
PERF: switch to scanline and linear iterators

Use scanline iterator and only report progress after a line is
processed.

Change-Id: I5024b4759893e7b85958504abc90a0bd4a5f433e
Merge topic 'fix-CMP0025-CMP0042'

60974eae COMP: Set CMake Policies CMP0025 and CMP0042 as necessary
51b4ccc6 COMP: Fix cmake_minimum_required call order
1d5fe0b7 COMP: Remove extra calls to cmake_minimum_required
COMP: Remove deprecated 'register' keyword

See discussion form June 28, 2013
http://public.kitware.com/pipermail/cmake-developers/2013-June/007602.html

Modules/Core/Common/include/itkNeighborhoodIterator.hxx:102:3: warning:
'register' storage class specifier is deprecated [-Wdeprecated-register]

Change-Id: Ifc70628ac1b663c1bb8fea0577bd609121761a2d
Merge topic 'RemoveRegisterKeyword'

8703432e COMP: Remove deprecated 'register' keyword
ENH: Remove python dl dependency

I removed the dl import in the LibraryLoader class. dl is deprecated since python 2.6.
http://docs.python.org/2/library/dl.html
I also removed the calls to sys.setdlopenflags() which are no more needed.

Change-Id: Iec62c8d51e330cf81b610f5ffee9e8ca4268ad91
ENH: Remove psyco import

Psyco is no more maintained, see http://en.wikipedia.org/wiki/Psyco.
There seem also to be some memory overhead if you use it.
http://stackoverflow.com/questions/575385/why-not-always-use-psyco-for-python-code

Change-Id: I9cb86fedc6d21e3ff890cef57dae57c0b6689f9a