ENH: Update OpenIGTLinkIF - Add new message converters. Fixes #3548 & #3738

Also update GUI to allow users to push MRML nodes (#3738)

From: Junichi Tokuda <tokuda@bwh.harvard.edu>

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23429 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Ensure DCMTK libraries are packaged.

This commit fixes a regression introduced in r23413 where call to
"find_package(DCMTK ..)" have been moved in the sub-project where
it was explicitly needed. By calling, "find_package(DCMTK ..)", it
now ensures that the variable "DCMTK_LIBRARIES" will be set.

Note that ideally DCMTK libraries could be installed leveraging the
fact the project is cmake'ified by installing the expected components.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23430 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Add test checking reference set to null or empty string are removed.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23431 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Consistently use "referencedNodeID" parameter name

To make maintenance of the code easier, the same parameter name
is used across all MRML node reference functions.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23432 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: update to new LandmarkRegistration

Now with interactive ThinPlate registration!
- uses real-time nonlinear transform updates
- compatible with transform visualization

Other improvments and upgrades, like VTKv6 support and
generalization of the plugin architecture.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23433 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: fix type of argument to SetGridExtent for LandmarkRegistration

Exposed by vtk v5 vs v6 testing.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23434 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix infinite loop when opening or closing a scene

This commit fixes a regression introduced by commit r23191.

Commit r23191 simplified the code introducing smart pointer, typedefs and
also updated "SetNthNodeReferenceID" and "SetAndObserveNthNodeReferenceID"
so that they have have similar code. It turns out that after this update
new reference where systematically created with an ID being an empty string
instead of being a NULL string.

Commits following r23191 also updated the MRML reference system and
attempted to fix what was most likely an issue with the "SetNth" methods.
See r23192, r23196]. These commits fixes the behavior of the SetNth methods
so that setting a reference N was always returning the
associated reference if the reference n-1 was removed.

It turned out that these changes caused more trouble than expected and
to fully support the new behavior, major and backward incompatible changes
in the displayable and storable nodes and also in the scene serialization
would have occur. For that reason, commit r23395 and r23414 have been
integrated to revert all commit updating the behavior but keeping the
"smart pointer" and "typedefs" updates around.

It is only by "reverting" these last commit that the issue fixed by
this commit was revealed.

Note for later:

 * In method almost doing the same thing, do not comment code without
clearly mentioning the reason.

 * If very similar functions are doing almost the same thing, re-factoring
the code is key to reduce the maintenance burden.

Finally, this commit also update method "UpdateNthNodeReference"
to set the ReferencingNode (it was done before the commit introducing
smart pointers), the questions are "Why is this needed ?" and
"What is causing the reference to be dissociated from a referencing node?"

Fixes #3754
Fixes #3768

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23435 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix crash in vtkMRMLNode::UpdateNthNodeReference

This commit fixes regression introduced in previous commit r23435.
Interestingly the message in previous commit raised the question about
the assignment ReferencingNode. It turns out that the method
UpdateNthNodeReference was indirectly called after destroying the
referencing node.

The following pseudo stack trace illustrates the issue:

(obtained while running the test "vtkMRMLVolumeNodeTest1"

Destructor of vtkMRMLVolumeNode (referencing node)
-> SetImageDataConnection(0)
-> SetImageDataToDisplayNodes()
-> GetNthDisplayNode(n)
-> GetNthNodeReference()
-> UpdateNthNodeReference(referenceRole, n)
-> UpdateNthNodeReference(reference, n)
this->ReferencingNode = this

Since ReferencingNode is a weakpointer to the object represented by "this"
and was indirectly called in the destructor of "this", this was
causing a double free or corruption error. It was reported in valgrind
as a "invalid read of size 8".

The test is now passing. But valgrind is still reporting the error
like this one:

Generic Warning: In /home/jchris/Projects/Slicer-2-SuperBuild-Debug/VTKv6/Common/Core/vtkDebugLeaks.cxx, line 292
Deleting unknown object: vtkMRMLVolumeNodeTestHelper1

They will be fixed in follow-up commit.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23436 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Add vtkMRMLDisplayableNode method definition to cpp file.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23437 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Add vtkMRMLStorableNode method definition to cpp file.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23438 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix "Deleting Unknown Object" warning in mrml node tests

This commits (1) changes the helper node class name associated with the
hierarchy node to be unique and (2) updates the helper node definitions
to be consistent with the helper node declared in vtkMRMLNodeTest1.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23439 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix valgrind issues in vtkMRMLVolumeNodeTest1

This commit fixes regression introduced by commit r19917. Instead
of re-implementing Get{I,J,K}ToRASDirection methods, the
macro "TEST_SET_GET_VECTOR3_DOUBLE_RANDOM" has been updated to directly
use the Set/Get method of the object. It then (1) avoids to return a
pointer and (2) avoids to access possibly uninitialized value with the
bracket operator.

Valgrind errors like this one are fixed:

[...]

==20657== Conditional jump or move depends on uninitialised value(s)
==20657==    at 0x626297: vtkMRMLVolumeNodeTest1(int, char**) (vtkMRMLVolumeNodeTest1.cxx:114)
==20657==    by 0x4717DC: main (MRMLCoreCxxTests.cxx:616)

[...]

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23440 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: LandmarkRegistration improvements (and fixed test on vtk5 and vtk6)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23441 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: fix method name difference between vtk 5 and 6

Fixes failing test on vtk 6.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23442 3bd1e089-480b-0410-8dfb-8563597acbee
COMP: Ensure SlicerExecutionModel variable expected by fixup script is set.

This commit fixes a regression introduced by commit r23413 moving
call to find_package where they are needed. By moving the find_package call
from the top-level CMakeLists.txt, variable expected by fixup script were
not set anymore.

It updates SlicerCPack to call find_package and ensure
variable SlicerExecutionModel_LIBRARY_DIRS expected by the fixup script
is set.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23443 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix "Deleting Unknown Object" warning in all mrml node tests

This commits (1) changes the helper node class name associated with the
hierarchy node to be unique and (2) updates the helper node definitions
to be consistent with the helper node declared in vtkMRMLNodeTest1.

Also remove debug output for vtkMRMLColorNodeTest1 and vtkMRMLUnitNodeTest1.
The extra verbosity was adding "noise" to the test output.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23444 3bd1e089-480b-0410-8dfb-8563597acbee
STYLE: Re-organize and simplify vtkMRMLColorTableNodeTest1

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23445 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Change vtkMRMLColorNode::GetColor to explicitly accept array of size 4

The function signature is now consistent with vtkLookupTable::GetTableValue.

Let's also note that when wrapped in python, an error will now be returned
if a list not having exactly a size of four is passed.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23446 3bd1e089-480b-0410-8dfb-8563597acbee
BUG: Fix memory initialization in vtkMRMLColorTableNode::SetNumberOfColors

This commit fixes a problem discovered while running the test
vtkMRMLColorTableNodeTest1 through valgrind. It basically ensures that
new table entry are initialized.

==26783== Conditional jump or move depends on uninitialised value(s)
==26783==    at 0x23B631D3: __printf_fp (printf_fp.c:404)
==26783==    by 0x23B62A9B: vfprintf (vfprintf.c:1654)
==26783==    by 0x23B875A4: vsnprintf (vsnprintf.c:119)
==26783==    by 0x2367E01F: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x23684455: std::ostreambuf_iterator<char, std::char_traits<char> > std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::_M_insert_float<double>(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x2368473F: std::num_put<char, std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, double) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x2368FA34: std::ostream& std::ostream::_M_insert<double>(double) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18)
==26783==    by 0x511352D: vtkMRMLColorNode::SetNameFromColor(int) (vtkMRMLColorNode.cxx:312)
==26783==    by 0x511336F: vtkMRMLColorNode::SetNamesFromColors() (vtkMRMLColorNode.cxx:295)
==26783==    by 0x512245B: vtkMRMLColorTableNode::SetColor(int, char const*, double, double, double, double) (vtkMRMLColorTableNode.cxx:1301)
==26783==    by 0x48750A: vtkMRMLColorTableNodeTest1(int, char**) (vtkMRMLColorTableNodeTest1.cxx:83)
==26783==    by 0x47215C: main (MRMLCoreCxxTests.cxx:616)

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23447 3bd1e089-480b-0410-8dfb-8563597acbee
ENH: Update vtkMRMLColorTableNodeTest1 to test against expected output

This commit updates the test to check that color table entry
can be written and read from a color table file.

Some background into ...

Commit r20729 attempted to implement a test checking that the color table
entry could be written to a scene and read from the scene. The issue was
that the test was only displaying value and was not testing against
expected value.
Then, in commit r22344, the color mrml nodes have been updated to
to not write anymore into the mrml scene.

The test wasn't reporting that no color could be read but was still
passing, this commit updates the test and check for expected values instead
of just displaying them.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23448 3bd1e089-480b-0410-8dfb-8563597acbee