STYLE: Clean up MetaDataObjectBase.

Change-Id: I5b712df23f37782fd2508a2479293966273aef53
STYLE: Clean up MetaDataObject.

Change-Id: I8b0b1fc0c20aaa3934e2e88265ee58e73fa61d8d
ENH: Add unit test for MetaDataObject.

Change-Id: Iba2063b65fe65ab142a8eacd3d71e94d26edb3d4
ENH: Add MetaDataObject Print specialization for common types.

A migration guide entry is added to explain the macro change.

Change-Id: Ie2187a034d8b59ed8b7f5b5d9778e57a9bb95f84
DOC: Improved Image Representation

The description of an image representation was missing the
direction cosines all together.  Understanding the physical
representation of an image, and it's relationship with
the index representation is a crucial element that must
be documented.

Change-Id: I5a103f878f84b4385cdccc7f7d0cb32dc803ffb7
STYLE: Fix template statements in SigmoidTransformFunction.

Change-Id: I727e4dfd5c055763bd17a6e75082baa4f367edb3
BUG: Remove public MetaDataObject constructors.

MetaDataObject uses the ::New() method and reference counting inherited from
LightObject -- these constructors cannot be used without improper memory
management.

Also remove the const type specializations of the Print macros -- these could
not be used in practice because the value could not get set.

Change-Id: Iee52b2693f56c50691d10ea3d989f22bf1d3eca0
BUG: Add missing private copy constructors to MetaDataObject.

Change-Id: I3aa89dd09f87626ba8aa2cbb8b642e6aad0fa07d
ENH: Explicitly specify internal linkage for internal observer objects

The Observer and SubjectImplementation are internal to the
itkObject.cxx file. Explicitly specify linkage.
COMP: Fix the writing of .idx files

The previous change to the print function broke the wrapping build.
This should fix the writing of the .idx files.

Fixed also imports of stringIO, we can even do it without six, see:
http://python3porting.com/stdlib.html

Use also from __future__ import unicode_literals, so that StrinIO
works on both Python 2 and 3

Fix also a problem in igenerator.py with the .h file creation, the \n
was misplaced.

Change-Id: Ia7f57f0bcfc1e21bc63370ffa0373c73db4c4943
Merge topic 'sigmoid-style'

3fe754fb STYLE: Fix template statements in SigmoidTransformFunction.
Merge topic 'metadataobject-copy'

75b18386 BUG: Add missing private copy constructors to MetaDataObject.
f5874d04 BUG: Remove public MetaDataObject constructors.
b34f4026 ENH: Add MetaDataObject Print specialization for common types.
c3e4cfba ENH: Add unit test for MetaDataObject.
a5a4fd97 STYLE: Clean up MetaDataObject.
73cd2040 STYLE: Clean up MetaDataObjectBase.
Merge topic 'FixPythonWrapping4'

419625e9 COMP: Fix the writing of .idx files
COMP: Fix python print import for .pth file creation

Fixes the following error:
CMake Error at Wrapping/install_wrapitk_compatibility.cmake:3 (file):
  file called with unknown argument
  "/tmp/imichka-insighttoolkit-QtOS/itk-build/Wrapping/Generators/Python/det_spp.py",
  line 2 from __future__ import print_functionSyntaxError: from __future__
  imports must occur at the beginning of the file"".

Change-Id: I7163eb556074c4e8d403254ce7e83986e959c7b6
COMP: Fix print import statement in itkExtras.py

Will fix the following error in the tests:

Traceback (most recent call last):
  File "/home/kevin/kitware/ITK/Wrapping/Generators/Python/Tests/CurvatureFlowImageFilter.py", line 24, in <module>
    import itk
  File "/home/kevin/kitware/ITK_Build/Wrapping/Generators/Python/itk.py", line 24, in <module>
    import itkExtras
  File "/home/kevin/kitware/ITK_Build/Wrapping/Generators/Python/itkExtras.py", line 28
    from __future__ import print_function
SyntaxError: from __future__ imports must occur at the beginning of the file
itkTestDriver: Process exited with return value: 1

Change-Id: I3880862f1fd85f05dd9e85d347bd5e33498275ec
ENH: Enable observed events to modify observers

There is no way to know if an object is executing an event, and it
wasn't safe to modify the observers when an event was being executed.

This patch is inspired by the ModifiedList implementation in the VTK
SubjectHelper class. It allows for recursive execution of events
and modification of the observers during execution.

The Command list items are saved on the stack recursively. Given that
it's not expected to utilize a large number of Observers with ITK, nor
is it expected to be common practice to delete Observers during event
execution, this method was chosen because it does not utilize any
dynamic memory allocation which causes reduce performance. This was
done at the expense of stack space. Additionally, when an observer is
deleted the search time is O(n^2), but it's safe.

Change-Id: Ia2068044454806b2cf018ba881126b65b152ac3c
Merge topic 'EnhanceDirectionCosDocumentation'

e4c851f3 DOC: Improved Image Representation
PERF: Minimize redundant function calls

The highest percentage of time in the MattesMutualInformation
filter was spent evaluating if specialized work needed to
be done for displacment fields.

In a minimalistic test case, prior to this change the registration
took 846 seconds, after this change, registration took 309 seconds.

bin/BRAINSFit   \
  "--costMetric" "MMI"  \
  "--failureExitCode" "-1"   \
  "--numberOfIterations" "1"  \
  "--numberOfHistogramBins" "50"  \
  "--splineGridSize" "7,5,6"  \
  "--numberOfSamples" "14000"   \
  "--minimumStepLength" "0.1"  \
  "--initializeTransformMode" "useCenterOfHeadAlign"  \
  "--transformType" "BSpline"  \
  "--fixedVolume"  "BRAINSTools-build/ExternalData/TestData/test.nii.gz"  \
  "--movingVolume" "BRAINSTools-build/ExternalData/TestData/rotation.rescale.rigid.nii.gz"  \
  "--outputVolume" "BRAINSTools-build/BRAINSFit/TestSuite/BRAINSFitTest_BSplineScaleRotationRescaleHeadMasks.test.nii.gz"  \
  "--outputTransform" "BRAINSTools-build/BRAINSFit/TestSuite/BRAINSFitTest_BSplineScaleRotationRescaleHeadMasks.h5"  \
  "--maxBSplineDisplacement" "7.3"

Change-Id: I3782e78cae99acfe577a40444882688ae5b76472
PERF: Pull loop termination constants out of loop

When evaluating loops, loop termination criteria that
are accessed via member functions should not be
used at every iteration.  Common static loop iteration
termination values are stored locally and reused.

Change-Id: Ia847f411640cce6921b28ac2a2da448c40ebe24c
ENH: Refactoring the CompositeTransform class

Prefer initialization to assignment (i.e. use class constructors
rather than resize variables).

Add const correctness, and use const references to temporary
local variables rather than copy constructing them.

Change-Id: I79a0dd7e3e22d3e5866b13b343c7f14296293606