BUG: Fix GDCM buffer size when written pixel type is different.

Previous value was twice its correct value in itkGDCMSeriesReadImageWriterTest
where the written pixel type is short and the pre-rescaled pixel type is char.

Change-Id: I16537fac89c5937f9c7ec2017c091fba8a896b56
COMP: Disable array above bounds warnings in FixedArray for GCC 4.9.

False positives.

Change-Id: I9ba0a323c628f1ccdf665935fd19212f2bb2b1dc
BUG: Fix out of bounds access for image region size

This patch was detected by the following warning:
/.../SimpleITK-build/ITK-prefix/include/ITK-4.6/itkSize.h: In member
function 'void itk::LabelVotingImageFilter<TInputImage,
TOutputImage>::ThreadedGenerateData(const typename
itk::ImageToImageFilter<TInputImage,
TOutputImage>::OutputImageRegionType&, itk::ThreadIdType) [with
TInputImage = itk::Image<long unsigned int, 3u>, TOutputImage =
itk::Image<long unsigned int, 3u>]':
 /.../SimpleITK-build/ITK-prefix/include/ITK-4.6/itkSize.h:159:
 warning: array subscript is above array bounds

Change-Id: I474492d0654ed91844fac9851877907b41be534a
BUG: Increased OtsuThreshold computation precision

While debugging differences in the Debian 32-bits platform with SSE disable it
was found that the intermediate computations of the variance difference were
getting truncated in some platforms from 80bits floats used in internal FPU
registers, to 64bits ones used in memory. This truncation resulted in
inconsistent results across platforms.

In order to achieve cross-platform consistency, this patch introduces the use
of the "volatile" modifier in the declaration of intermediate computations of
inter-class variance differences. The "volatile" modifier instructs the
compiler not to keep values in the FPU registers, and instead store them in
memory, where they are actually fitted to the IEEE float/double representation.
This change ensures consistency of computation across platforms.

Change-Id: I2aa8833c06bba1bb9a06ef2a00ef4b2512bd6f46
Merge topic 'GCC49AboveBounds1'

07c38084 COMP: Disable array above bounds warnings in FixedArray for GCC 4.9.
BUG: Set output type to unsigned char when writing uchar in GDCMIO test.

In itkGDCMSeriesReadImageWriteTest, the GDCMImageIO is re-used on a writer
that is writing a unsigned char image.  However the ImageIO was originally
used to read an unsigned short image, and writing unsigned char data to an
unsigned short DICOM file is not supported by DICOM.

Use SetInternalComponentType to set the correct internal component type when
writing the unsigned char file.

Change-Id: I5410afc22678990a173e3bcfe578cfc984e16763
Merge topic 'debian32'

b3ca416b BUG: Increased OtsuThreshold computation precision
Merge topic 'GDCMRescalePixelTypes2'

1edae060 BUG: Set output type to unsigned char when writing uchar in GDCMIO test.
ce503c43 BUG: Fix GDCM buffer size when written pixel type is different.
BUG: Add export specification to DCMTKFileReader and utilities

Change-Id: I1ccd7d9a95cf8005abbc0b725bb4daabe891822e
Merge topic 'AddDCMTKFileReaderExportSpecification'

d34bfa4f BUG: Add export specification to DCMTKFileReader and utilities
Merge topic 'FixArrayBoundsForLabelVoting'

4030325b BUG: Fix out of bounds access for image region size
COMP: Add tolerance for comparing floating point

The multi-threaded accumulation can not ensure the order of the accumulations
and very slight differences can occur depending on the order of thread
processing that is done.  A very small tolerance was added to the test
to accomodate these very slight differences.

Improve debugging statements for test and info on timing and variables size.

Testing can require using larger sized images and a view of the performance
is needed in the test.  This patch adds timing for computing the metric
and the ability to more easily change the size of the images being tested.

Change-Id: I70e43c16e398de6c5d1c78b3cc7a00686903806b
PERF: Remove non-threadable algorithm components

During testing of thread optimization, some of the accumulation
operations were determined to be less efficient in each thread than
to just do them in single threaded mode.  The complicated code
constructs for having multiple threads remained in the single threaded
code parts.

The per thread PDF accumulations no longer need to be sub-divided
over the thread "BinStart[thread]-BinEnd[thread]" partitioning.

Change-Id: I5ae4461cfcf4ea2be7f32fdbf4d19764d169b12e

The vector of thread variables for the JointPDFSum were never
used in the threads.  Converted to a single value for simplifying
the code.

The accumulation phases of this algorithm are all occuring inside
of non threaded code sections.  There is a note stating that the
threaded implmentations of the accumulation process was not faster
than the single threaded version (presumably due to overhead issues).

Remove unnecessary block definition per thread variables:
m_ThreaderJointPDFStartBin[threadId]
m_ThreaderJointPDFEndBin[threadId]

Change-Id: Id14daf5d271928e0f38b46b7fc7c1c79eb65939a
PERF: Remove large foot print of PDF derivatives.

ITK-3286 Describes that the memory footprint is very
large for many threads and MattesMutualInformation
due to the amount of memory being allocated per thread.

Allocating memory is also the most time consuming portion
of the MI algorithm and drastically restricts the
scalability of the algorithm to many threads.

Performance Enhancments for minimizing number of
memory bufers needed to avoid false sharing by using
a queue based accumulation per thread that is periodically
syncronized with the primary pdf.  This approach
allows the time consuming part of each thread to
occur and the syncronized writing to the JointPDFDerivative
in parallel.

Each computation of a point was previously allocating new
memory.  This patch set checks if the currently allocated
memory is the proper size, and then re-initalizes that
memory if possible.

Change-Id: I72f1d1ea2be71a883a47fe71afc2724e5ec88fb8