ENH: Improve mangling of itktiff library.

Separate the defines into a Common and Windows-Only section.

Include windows/bash commands to generate suggested symbols to include.

Remove old defines for symbols which no longer exist.

Sort the defines alphabetically.

Change-Id: I5a2af1cf8c9e7746b046cb2893988190a13ef1d7
ENH: Updated SCIFIO remote reference

Updated the SCIFIO remote reference. The SCIFIOImageIO module features
the following improvements and bug fixes:

* Takes advantage of the latest scifio-itk-bridge (bef14215)
* Enhanced error handling (stack trace on exceptions + exit on command failure)
* SetSeries(int) method for multi-series datasets
* GetSeriesCount() method to determine total number of series
* Fixed RGB image reading (was only reading 1/3 of image)
* Fixed handshaking issues (leaving bytes on the buffer)
* Improved SCIFIOImageIO->Write performance
* Completely refactored the itkSCIFIOImageIOTest
** Allows argument flags to open RGB images, series ranges,
   complete multi-series datasets, select number of dimensions,
   select pixel type, streaming divisions, etc..

Change-Id: I496e09f72322623416aaf037c821af0c5087d666
COMP: Do not warn about unused typedefs.

GCC 4.8 adds a warning about local unused typedefs, but making sure these types
are available is an important part of the ITK ConceptChecking framework.
Disable the check with a compiler flag.

Change-Id: I59040e9d445822d0ba9a0b846fe7f11e58bc76d3
DOC: Cleanup docs for ThreadedDomainPartitioner and subclasses

Also some style fixes, making parameter names consistent.

Change-Id: I3bfda18eb261bb08ced18bf0108bda074795ca87
ENH: Implement ThreadedImageRegionPartitioner using ImageRegionSplitter

The old ThreadedImageRegionPartitioner already had the same logic as
ImageRegionSplitterSlowDimension. This commit reduces code duplication.

Deprecate some old typedefs that no longer need to be explicitly
redefined.

Change-Id: I4c9231a9862926b674791547db873edc3881a5dc
COMP: Fix argument 'buffer' might be clobbered on GCC 4.8.

Fix warnings:

  /home/matt/src/ITK/Modules/IO/JPEG/src/itkJPEGImageIO.cxx:465:6: warning:
  argument ‘buffer’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]

By wrapping the setjmp call in its own function with limited local variables
according to:

  http://stackoverflow.com/questions/2024933/warning-might-be-clobbered-on-c-object-with-setjmp

Change-Id: I4adb989826f253aec921b3d4a221d565db8dadbe
COMP: Wrap TransformBaseTemplate, Transform, and TransformFile{Reader,Writer}.

These were not updated with the templated precision patch.

Change-Id: I9a6dc36d7730555efa7d8dd8e9fc6a72ff96e83e
BUG: Resolved Otsu/OtsuMultiple Discrepancy

When the number of thresholds is set to 1 for the
OtsuMultipleThresholdsCalculator, the computed threshold should be the
same as the computed threshold of OtsuThresholdCalculator.  However,
there were a number of discrepancies between the implementations of
the two algorithms leading to different computed thresholds.  The
equations used for the two filters are different because the Otsu uses
a simplified mathematical representation that only holds when there is
one threshold, but I have derived the equations and confirmed that
they lead to the same mathematical representation.  The discrepancies
have now been corrected (details below), and the algorithms now report
the same threshold.

Because the computed threshold values are slightly different from
before, I updated the regression images to reflect the new changes.
Also, I added a new test that compares the thresholds computed by the
two algorithms for a range of histogram bins.

The OtsuMultipleThresholdsCalculator and HistogramAlgorithmBase have
been corrected to change the GenerateData() method to Compute() and to
make the Update() method simply return Compute().  These classes do
not inherit from ProcessObject, so they are not part of the pipeline
and should therefore not have an Update() method.  The Update() method
is now marked as deprecated and surrounded by an
ITK_FUTURE_LEGACY_REMOVE preprocessor directive.

More details on the Otsu computation changes are below:

For all of the tests, I used the 8-bit image
ExternalData/Testing/Data/Input/cthead1.png.  For each code line
below, the original line is shown with a "-" first, and the new line
is shown with a "+" first.  All of the comments are about the Otsu
because the MultipleOtsu is implemented more accurately.

In Otsu, the global mean was being computed incorrectly.  The original
and corrected code are as follows:
-    totalMean += ( j + 1 ) * relativeFrequency[j];
+    totalMean += j * relativeFrequency[j];

The initial left mean was being computed incorrectly.  By mathematical
definition, when the leftMean is computed from only the first bin of
the histogram, it is equal to the bin value itself.
-  double meanLeft = 1.0;
+  double meanLeft = 0.0;

The left mean was computed incorrectly in the loop.
-                   + ( j + 1 ) * relativeFrequency[j] ) / freqLeft;
+                   + j * relativeFrequency[j] ) / freqLeft;

The offset of 1 was incorrect in the GetMeasurement call.
-  this->GetOutput()->Set( static_cast<OutputType>(
   histogram->GetMeasurement( maxBinNumber + 1, 0 ) ) );
+  this->GetOutput()->Set( static_cast<OutputType>(
histogram->GetMeasurement( maxBinNumber, 0 ) ) );

Finally, there is a discrepancy in that Otsu uses GetMeasurement (as
shown above), but OtsuMultiple uses GetBinMax to get the final
threshold.  The difference is that GetMeasurement is the average of
GetBinMax and GetBinMin.  When the number of bins is large, this makes
almost no difference because the GetBinMin and GetBinMax are almost
the same.  But for small numbers of bins, the GetMeasurement is more
stable.  Here are some example results:

Bins: 4,8,16,32,64,128,256,512,1024
GetBinMin:      63.91, 63.83, 63.79, 79.71, 79.70, 81.69, 83.68,
83.67, 83.92
GetBinMax:     127.82, 95.74, 79.74, 87.68, 83.68, 83.68, 84.67,
84.17, 84.17
GetMeasurement: 95.86, 79.79, 71.76, 83.70, 81.69, 82.68, 84.17,
83.92, 84.05

The threshold results are as follows for different number of bins:

Bins: 4,8,16,32,64,128,256,512,1024
Old Otsu threshold: 159.77, 111.70, 87.71, 91.67, 85.68, 84.67, 85.17,
84.42, 84.30
New threshold:        95.86, 79.79, 71.76, 83.70, 81.69, 82.68, 84.17,
83.92, 84.05

The ImageJ Otsu plugin
(http://rsbweb.nih.gov/ij/plugins/otsu-thresholding.html) outputs a
threshold of 79.
The ImageJ MultipleOtsu plugin
(http://rsbweb.nih.gov/ij/plugins/multi-otsu-threshold.html) with 1
threshold outputs a threshold of 87.
Using Matlab, I get 84.
So they are not consistent, but they are all close.

Change-Id: Ic144200390e6c983c113e0655aea56713d3c17bd
Merge topic 'GCC4.8'

72f08b4 COMP: Fix argument 'buffer' might be clobbered on GCC 4.8.
737320d COMP: Do not warn about unused typedefs.
Merge topic 'Doc-ThreadedDomainPartitioner'

e0ac1bb DOC: Cleanup docs for ThreadedDomainPartitioner and subclasses
ENH: Deprecated SetProgress and removed Modified call

SetProgress is now marked as deprecated because filters should not be
calling SetProgress directly but should be using
UpdateProgress instead.  We also avoid the use of the itkSetClampMacro
because that macro calls Modified on the filter, which will cause the
filter to rerun even if it doesn't need to.  Thus, we implement the
SetClampMacro directly without the call to Modified.

We also explicitly clamp the input argument to UpdateProgress to
ensure that the value lies between 0.0 and 1.0.

Change-Id: I0564082c15a9518dc5a6449e86e519b7ebe76458
ENH: Deprecated SetProgress and removed Modified call

SetProgress is now marked as deprecated because filters should not be
calling SetProgress directly but should be using
UpdateProgress instead.  We also avoid the use of the itkSetClampMacro
because that macro calls Modified on the filter, which will cause the
filter to rerun even if it doesn't need to.  Thus, we implement the
SetClampMacro directly without the call to Modified.

We also explicitly clamp the input argument to UpdateProgress to
ensure that the value lies between 0.0 and 1.0.

Change-Id: I0564082c15a9518dc5a6449e86e519b7ebe76458
BUG: Need to set 3rd dir cosine for DICOM images

DICOM images are always read in DCMTKImageIO as 3D even when they're
single-slice files. This is because DICOM slice files always have a
3D orientation. But DCMTKImageIO::ReadImageIO was only setting the
third direction cosine if the Z dimension was greater than 1.

This accidentally worked in many cases, as the 3rd dir cosine is
initialized to 0 0 1.  But in cases where another dir cosine is
0 0 N (or close to that), it makes for degenerate orientation
matrices.

Change-Id: I33cd39e3cd715bdddf3791cbbe08e562d2eb6088
Merge topic 'DeprecatedSetProgress'

230666c ENH: Deprecated SetProgress and removed Modified call
Merge topic 'DICOM_DIRCOSINES_BUG'

df53542 BUG: Need to set 3rd dir cosine for DICOM images
Merge topic 'DeprecatedSetProgress'

c412fc4 ENH: Deprecated SetProgress and removed Modified call
ENH: Add a unit test for VectorImageToImageAdaptor.

Test VectorImageToImageAdaptor::SetPixel() method
and associated VectorImageToImageAccessor::Set() method.

DOC: A minor doc clean up for VectorImageToImageAdaptor.

Change-Id: I2d2f4fe9cafec5ab1151a7fb4cc99c9306add63e
KWSys 2013-07-10 (beef6819)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ beef6819 | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' 5b0d1bd9..beef6819
Andreas Mohr (1):
      f4928d44 Fix spelling and typos in comments and method documentation

Brad King (7):
      5c34ed2e SystemTools: Do not abort with no current directory
      709fb5c1 SystemTools: Fix FileIsDirectory for Windows drive letter roots
      9fd64779 SystemTools: Fix FileIsDirectory with long paths
      e3370418 SystemTools: Use COMPILE_DEFINITIONS to pass platform tests
      dccf7725 SystemTools: Touch with better than 1s resolution if possible
      d79a792e SystemTools: Fix CollapseFullPath to not erase root component
      beef6819 SystemTools: Implement IsSubDirectory without loop

Cory Quammen (1):
      3d1d4e7c SystemTools: MakeDirectory() reports failure if path is file

Paul Kunysch (1):
      2d263bc3 Process: Increase FD_SETSIZE on Cygwin

Rolf Eike Beer (3):
      e8269442 Tests: fix a warning with acc
      87abd647 SystemInformation: fix truncation warnings
      039d9598 fix warnings about sizeof() return value truncation

Sean McBride (2):
      13f5badd SystemInformation: Replace __GNUG__ with __GNUC__
      f6c4c247 RegularExpression: Remove 'register' storage specifier

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

Change-Id: I3b8af0ea982e327cfbfec758cbcb5234f15d662c
ENH: Add option ENABLED_SHARED to itk_module for shared libraries

Bump required cmake version to 2.8.6 for GenerateExportHeader.

This option enables shared libraries on windows and adds export
specification with gcc shared libraries. This option respects the
CMake variable BUILD_SHARED_LIBS.  Modules without this
specification can still be shared with gcc, but will be static with
msvc.

Change-Id: Ic1552ca64bb7e614e254cefe285802c96359ed3f