ENH: Improved writing speed for TIFF images

Previously, in itkTIFFImageIO.cxx rowsperstrip was set to a default
value so that it would be calculated using the STRIP_SIZE_DEFAULT
defined to be 8 kB in tiffiop.h. However, this a very conservative
small number, and it leads to very small strips resulting in many io
operations, which can be slow when written over networks that require
encryption/decryption of each packet (such as sshfs). Conversely, if
the value is too high, a lot of extra memory is required to store the
strips before they are written out. Experiments writing TIFF images to
drives mapped by sshfs showed that a good tradeoff is achieved when
the STRIP_SIZE_DEFAULT is increased to 1 MB. Rather than change that
value in the third party libtiff library, we instead compute the
rowsperstrip in itkTIFFImageIO.cxx to lead to this same value.

This results in an increase in memory usage but no increase in writing
time when writing locally and significant writing time improvement
when writing over sshfs.  For example, writing a 2048x2048 uint16
image with 8 kB per strip leads to 2 rows per strip and takes about
120 seconds writing over sshfs. Using 1 MB per strip leads to 256 rows
per strip, which takes only 4 seconds to write over sshfs.

This has no effect on accuracy, only writing time.  All of the tests
still pass.

Change-Id: Id3a99fbcbcd430e6436dbf262aab2fc70b82937a
BUG: Verify ConfidenceConnected Seeds

Seeds outside image were resulting in segfaults. Now, seeds are
verified that they are inside the region, and if there are no valid
seeds a zero image is return consistent with the other region growing
algorithms.

Change-Id: Idcbf4deda92f417b216ced6fb79c5dc6fbf39c58
BUG: Verify seeds in VectorConfidenceConnected

Prevent segfault from invalid access. Only use valid seeds inside
region, return 0 image if there are no valid seeds. This behavior is
the same as other region growing algorithms.

Change-Id: I3f9d1525d1079502cbf9f44be47f02d385c9c15b
ENH: Check and use C++11 typetraits first

This patch changes the preference to use C++11 std::typetraits over
tr1. The typetraits have been integrated into C++11 in the std
namespace, this standard utilized over the extension.

Change-Id: I5dc9e19e4e7682e4b1c10c3873396386eba7d22b
Merge topic 'Cxx11TypeTraits'

ea13fd1 ENH: Check and use C++11 typetraits first
Merge topic 'ConfidenceConnectedSeedValidate'

18416bb BUG: Verify seeds in VectorConfidenceConnected
9225cb1 BUG: Verify ConfidenceConnected Seeds
BUG: Do not convert to make-escaped path for internal APIs

The KWSys SystemTools::ConvertToOutputPath method can add makefile
escape characters not suitable for passing paths to internal APIs.
Drop calls to it from ITK.

Change-Id: I124d6cea6e004ad47deed17379ca50392c0105b7
COMP: Use memcpy for raw memory copy

CID 1106738 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)

Its a good practice to use memcpy over strncpy for non-null
terminated char sequences.

Change-Id: Icd4373c0528e46f007dba5f3246eb9538ef11867
PERF: fix cppcheck issues in itk::ImageRegion

[Modules/Core/Common/include/itkImageRegion.h:184]: (performance) Variable 'same' is reassigned a value before the old one has been used.
[Modules/Core/Common/include/itkImageRegion.h:195]: (performance) Variable 'same' is reassigned a value before the old one has been used.

Change-Id: Ib03a09a37e92216d8a7ed05891eb2a5bd578858d
STYLE: fix cppcheck style warning

[Modules/Core/Common/include/itkNeighborhoodOperator.hxx:45]: (style) The scope of the variable 'swap_with' can be reduced.

Change-Id: I98f8ab8dde19b8107c3d08ad91c1d2b855fe529a
BUG: Use string constructor which calculates str length

CID 1106758 (#1 of 1): Out-of-bounds access (OVERRUN)

It is preferred to use std::string constructors with count the
c-string length as opposed to manually specifying the length with is
error prone.

Change-Id: Iad6ccb87fb9fba90bf6c13db26284d50662999b2
COMP: Resource leaks

CID 1081076 (#1 of 8): Resource leak (RESOURCE_LEAK)
All 8 leaks were similiar.
labelLine was not being removed for EXIT_FAILURE.

Change-Id: Idefc8cb9b9d6afaaa47424d2182f803961ba1d57
COMP: Resource leaks

CID 1081073 (#1 of 84): Resource leak (RESOURCE_LEAK)
All 4 leaks were similiar.
low, high and lowhigh were not being removed for EXIT_FAILURE.

Change-Id: I16985608942d6ac089719c7ba4135f34f2c7f3c1
BUG: Fix memory leaks in MINCImageIO

This resolves Coverity CIDs: 1125948, 1125949, 1125950, 1125951.

Change-Id: Ic896a4286eab3a269dfca0c56bcab0bf090e7b6b
BUG: Coverity resrouce leak in itkQuadEdgeTest1.

Fix covertity bug reported as: CID 1081081 (#1 of 8): Resource leak
(RESOURCE_LEAK) 8. leaked_storage: Variable "quadEdge1" going out of scope
leaks the storage it points to.

Change-Id: Ieb026e5d4917524396a783d3504c3f893790087e
BUG: Fix ostream format modification warnings

This resolves Coverity CIDs: 1125952, 1125953, 1125954, 1125955

Coverity warning:
"Changing format state of stream "std::cout" for category precision
without later restoring it."

Change-Id: I37c08b924326402558fd0e111f5d22560d9b9978
COMP: Fix coverity bug in itkQuadEdgeTest.

Fix coverity resource leak bug reported as:
CID 1081080 (#4 of 4): Resource leak (RESOURCE_LEAK) 6. leaked_storage:
Variable "quadEdge3" going out of scope leaks the storage it points to

Change-Id: I18ab92eac58aa131c73321c351e47721af856053
BUG: Fix uninitialized members of MINCImageIO

This resolves Coverity CID 1125957.

Change-Id: I5dff79f50830552460028121f27eba54de91700c
COMP: Uninitialized scalar variable

CID 1103571 (#1 of 1): Uninitialized scalar variable (UNINIT)
11. uninit_use: Using uninitialized value "NW".

switch statement did not have a default:. Added default: that throws
exception with an informative message.

Change-Id: Ic176d180ebd518cfa2509b12c5f8af2140e6685b
BUG: fix out of bounds access of array

address 3 coverity issues related to accessing m_Visitors out of
bounds.

CID 1081041 (#4-1 of 4): Out-of-bounds read (OVERRUN)
3. overrun-local: Overrunning array of 9 8-byte elements at element
index 9 (byte offset 72) by dereferencing pointer "&this->m_Visitors[id]"

Change-Id: Idf7e306c489a30e429ceff74d61849d5bbdb664f